Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts: mylist
- gather_facts: no
- pre_tasks:
- - name: get file name
- set_fact:
- fake_vault_file: "{{ inventory_hostname}}.txt"
- - name: get host specific creds from "fake" password vault
- set_fact:
- creds: "{{ lookup('file', fake_vault_file) | from_yaml }}"
- - name: set username
- set_fact:
- ansible_user: "{{ creds.username }}"
- - name: set ssh_private_key_file
- set_fact:
- ansible_ssh_private_key_file: "{{ creds.ssh_private_cred_file }}"
- - name: run setup
- setup:
- tasks:
- - command: "ls"
- register: command_output
Add Comment
Please, Sign In to add comment