Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. ├── ansible.cfg
  2. ├── hosts
  3. ├── playbooks
  4. │   └── add_user.yml
  5. └── roles
  6. └── add-user
  7. ├── files
  8. │   ├── ansible.pub
  9. │   ├── dhirendra.pub
  10. │   ├── nitigyas.pub
  11. │   └── vinayaks.pub
  12. ├── tasks
  13. │   └── main.yml
  14. └── vars
  15. └── main.yml
  16.  
  17. ---
  18. - name: AddUser in the server
  19. user:
  20. name: ansible
  21. password: $6$sHQAZJ32E$ujHauabN7ZTbOQ/zhT5899EIaFErOecXYvTEyhekexy4dydsAXTGdUpaB8M4fQf2UGpZgX/Zg2Uv6areeuv/r0
  22. comment: Ansible Configuration Mgmt
  23. shell: /bin/bash
  24.  
  25. - name: Add SSH key to users home direcotory
  26. authorized_key:
  27. user: "{{ item.name }}"
  28. key: "{{ item.file }}"
  29. state: present
  30. with_items:
  31. - ssh_vars
  32. ...
  33.  
  34. ---
  35. ssh_vars:
  36. - { name: "ansible" , file: 'ansible.pub' }
  37.  
  38. PLAY [backend1.greengst.com] *************************************************************************************************************
  39.  
  40. TASK [add-user : AddUser in the server] **************************************************************************************************
  41. ok: [backend1.greengst.com]
  42.  
  43. TASK [add-user : Add SSH key to users home direcotory] ***********************************************************************************
  44. fatal: [backend1.greengst.com]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'ansible.vars.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'name'nnThe error appears to have been in '/etc/ansible/roles/add-user/tasks/main.yml': line 9, column 3, but maynbe elsewhere in the file depending on the exact syntax problem.nnThe offending line appears to be:nnn- name: Add SSH key to users home direcotoryn ^ heren"}
  45. Debugger invoked
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement