Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ├── ansible.cfg
- ├── hosts
- ├── playbooks
- │ └── add_user.yml
- └── roles
- └── add-user
- ├── files
- │ ├── ansible.pub
- │ ├── dhirendra.pub
- │ ├── nitigyas.pub
- │ └── vinayaks.pub
- ├── tasks
- │ └── main.yml
- └── vars
- └── main.yml
- ---
- - name: AddUser in the server
- user:
- name: ansible
- password: $6$sHQAZJ32E$ujHauabN7ZTbOQ/zhT5899EIaFErOecXYvTEyhekexy4dydsAXTGdUpaB8M4fQf2UGpZgX/Zg2Uv6areeuv/r0
- comment: Ansible Configuration Mgmt
- shell: /bin/bash
- - name: Add SSH key to users home direcotory
- authorized_key:
- user: "{{ item.name }}"
- key: "{{ item.file }}"
- state: present
- with_items:
- - ssh_vars
- ...
- ---
- ssh_vars:
- - { name: "ansible" , file: 'ansible.pub' }
- PLAY [backend1.greengst.com] *************************************************************************************************************
- TASK [add-user : AddUser in the server] **************************************************************************************************
- ok: [backend1.greengst.com]
- TASK [add-user : Add SSH key to users home direcotory] ***********************************************************************************
- 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"}
- Debugger invoked
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement