Programming > Research Paper > Ansible - Automation Choral.txt (All)
# Workout - hostvars and inventory_hostname #Step 1 vim test.xml #Insert the following code inside test.yml. Press "i" without quotes to insert text. --- - name: built-in variables hosts: all ... tasks: - debug: var=hostvars[inventory_hostname] #Press "Esc" key and then write ":wq", without quotes, and then press "Enter" in order to save changes. #Step 2 ansible-playbook -i myhosts test.yml -------------------------- Hands On ----------------------------------- # Try It Out-Registered Variable touch afile.txt vim test.yml #Insert the following code inside test.yml. Press "i" without quotes to insert text. --- - hosts: all become: yes name: Copy file tasks: - debug: - template: src=afile.txt dest=/home/ubuntu/afile_copy.txt #Press "Esc" key and then write ":wq", without quotes, and then press "Enter" in order to save changes. ansible-playbook -i myhosts test.yml [Show More]
Last updated: 3 years ago
Preview 1 out of 9 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Jul 19, 2021
Number of pages
9
Written in
All
This document has been written for:
Uploaded
Jul 19, 2021
Downloads
0
Views
100
Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·