...
First, type the following command in terminal of ubuntu on windows
Code Block |
---|
unzip playbooks.zip
cd playbooks
sudo nano inventory |
...
- Now run the Ansible script in terminal of ubuntu on windows
Example 1
for example, you have received for your issue a playbooks.zip order from the Kunbus Support to apply some tasks on your device or to solve a problem.
...
The playbooks.zip folder contains as standard:
Inventory
"Test.yml" file
a folder "files" with other files in it.
Type the following command in the ubuntu terminal on Windows to ping the device you want to reach.
Code Block |
---|
cd playbooks #if you are not if the file playbooks
ansible bet -i inventory -m ping |
...
Example 2
you have received for your issue a playbooks.zip with the following content, after unzip it.
...
Test2.yml is in this case the YAML file that contains the instructions to perform a task.
...
This script does nothing else than:
Copy the file "interfaces" in order files from the host to the repository "./etc/network/interfaces” in Target System
The following commands are then executed.
sudo systemctl disable dhcp.service
sudo systemctl enable networking
sudo reboot
Type the following command in terminal of ubuntu on windows to run the "TestTest2.yml" file
Code Block |
---|
cd playbooks #if you are not if the file playbooks ansible-playbook -i inventory -u pi TestTest2.yml |
After a successful running of the script, you will get a message like shown on the following picture:
...
Type the following command in the ubuntu terminal on Windows to ping the device you want to reach.
Code Block |
---|
ansible bet -i inventory -m ping |
...