I am trying to setup Ansible to manage Linux boxes from different customers and here are what we have to work with.
- No Pub key authentication - I wanted it as much as you do but it won't happen any time soon.
- We login as root and each customer has a different root password for all linux boxes. We are pushing for disable direct root login and do everything via
sudobut again, it will take some time.
I managed to create a ansible vault file for each customer with
ansible_ssh_pass in it and following play-book works fine.
--- - hosts: - SERV01 - SERV02 vars_files: - roles/common/vault/main.yml tasks: - name: enable and start ntpd service: name=ntpd enabled=yes state=running
Now I would like to know how can I use vault files from command line, but none of the following worked.
ansible customer1 -m shell -a "var_files:roles/common/vault/main.yml uptime" --ask-vault-pass ansible customer1 -m shell -a "uptime" -e "vars_files:roles/common/vault/main.yml" --ask-vault-pass
What am I doing wrong ?