In this video I integrate an Ansible inventory with Github for better tracking and management of an Ansible hosts inventory.
Previous video showing Github integration for playbooks:
• Ansible Tower: Github Integration for...
1) Create a 'hosts' file in the Github repository you want to use:
[all]
your-server-1
your-server-2
your-server-3
[category1]
your-server-1
your-server-2
[category2]
your-server-3
2) Either create a new project to point to a Github repository or using an existing one you've already created to sync your playbooks.
3) Create a new Inventory, and Save it.
4) Within the Inventory, select the Sources tab at top, add (+), from Source choose 'Sourced From a Project'.
5) Under 'Inventory File' enter 'hosts' - the name of your host file.
6) Choose 'Update Options' (Update on Launch will update the inventory before launching a playbook/job using this inventory).
7) Save. Attempt Sync from Inventory section. If it fails (red cloud) Sync from the Projects section.
8) Go back to Inventories and Sources tab. Sync again. Cloud should turn green.
9) View the Hosts in the Hosts tab.
10) In the Templates section choose the new inventory and the appropriate groups from that file.
11) Inventory is now successfully integrated into Github and jobs/playbooks can be run with this inventory.
12) Remember: The host groups to use from the inventory file are applied in the playbook itself.
Watch video Ansible Tower: Github Inventory Integration online without registration, duration hours minute second in high quality. This video was added by user CyberScribe.org 08 May 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 9,787 once and liked it 81 people.