This is a config file for Ansible to update all my computers
Overview This README provides instructions on how to use the Ansible configuration file to update all of your computers.
Requirements Ansible An inventory file that lists the computers you want to update Instructions Install Ansible. Create an inventory file that lists the computers you want to update. Save the Ansible configuration file in the same directory as your inventory file. Run the following command to update all of your computers: ansible-playbook -i inventory.yml update.yml
Code snippet
Here is an example of an inventory file:
Use code with caution. Learn more [all] localhost
[desktops] desktop1 desktop2
[laptops] laptop1 laptop2
Code snippet
Here is an example of an Ansible configuration file:
Use code with caution. Learn more [defaults] inventory = inventory.yml remote_tmp = $HOME/.ansible/tmp forks = 150 sudo_user = root transport = smart
[tasks]
name: Update all packages apt: update_cache: yes upgrade: yes [handlers]
name: Clean up file: state: absent path: /var/cache/apt/archives/_ [publish] hosts: all
Code snippet
To update all of the desktops and laptops in this example, you would run the following command:
Use code with caution. Learn more ansible-playbook -i inventory.yml update.yml
Code snippet
If you encounter any problems, please see the Ansible documentation for troubleshooting tips.