Guest User

Untitled

a guest
Dec 11th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. ---
  2. - hosts: mylist
  3. gather_facts: no
  4. pre_tasks:
  5. - name: get file name
  6. set_fact:
  7. fake_vault_file: "{{ inventory_hostname}}.txt"
  8. - name: get host specific creds from "fake" password vault
  9. set_fact:
  10. creds: "{{ lookup('file', fake_vault_file) | from_yaml }}"
  11. - name: set username
  12. set_fact:
  13. ansible_user: "{{ creds.username }}"
  14. - name: set ssh_private_key_file
  15. set_fact:
  16. ansible_ssh_private_key_file: "{{ creds.ssh_private_cred_file }}"
  17. - name: run setup
  18. setup:
  19.  
  20. tasks:
  21. - command: "ls"
  22. register: command_output
Add Comment
Please, Sign In to add comment