I have a small and simple playbook to make a directory on two other servers which I have saved in a inventory file and passing the name 'dev-edge'.
When I try and run this, I get a:
a2s3421.fake.cor.com : ok=0 changed=0 unreachable=1 failed=0
a1s3433.fake.cor.com : ok=0 changed=0 unreachable=1 failed=0
I can 'ssh niall@g4t7459.houston.hpecorp.net'
so the servers can be reached from the ansible server.
I think this is because I am not passing my password, I have tried to use 'become_pass: XXXXX' but still doesn't work.
Can someone tell me how to add/request a password in a playbook? Or is there another reason why I would be getting a unreachable error when running the playbook??
Thanks for the help Frostie.
'Playbook'
- hosts: dev-edge
remote_user: "{{ user }}"
tasks:
- name: create directories
become: yes
become_user: niall
command: mkdir /opt/apps/niall_test