Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inventory file:
- [usr@host automation]# cat inventory
- [nsm-064-1]
- 10.1.242.11 ansible_user=nsm csa_id=22222 ansible_ssh_pass=12345
- ------------
- Playbook
- [user@hostautomation]# cat playbooks/t.yml
- ---
- - hosts: all
- gather_facts: True
- become: True
- debugger: always
- vars:
- tasks:
- - debug:
- msg: "csa_id: {{csa_id}}"
- ------------
- Run Output
- [user@hostautomation]# ansible-playbook -i inventory --key-file /root/.ssh/id_rsa --limit nsm-064-1 playbooks/t.yml
- PLAY [all] **********************************************************************************************************************************************************************************************************************************
- TASK [Gathering Facts] **********************************************************************************************************************************************************************************************************************
- ok: [10.1.242.11]
- [10.1.242.11] TASK: Gathering Facts (debug)> c
- TASK [debug] ********************************************************************************************************************************************************************************************************************************
- ok: [10.1.242.11] => {
- "msg": "csa_id: 52"
- }
- [10.1.242.11] TASK: debug (debug)> c
- PLAY RECAP **********************************************************************************************************************************************************************************************************************************
- 10.1.242.11 : ok=2 changed=0 unreachable=0 failed=0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement