Rework vagrant inventory handling + support for multiples inventories

The current way to handle a custom inventory in vagrant is a bit
hackish, copy files around and can break Vagrantfile parsing in
cornercase scenarios (removing vagrant inventories, or the inventory
copied into vagrant inventory).

Instead, simply pass additional inventories to the ansible-playbook
command lines as raw arguments with `-i`.
This also makes supporting multiples inventories trivial, so we add a
new `$inventories` variable for that purpose.
This commit is contained in:
Max Gautier
2024-09-12 13:56:12 +02:00
parent d54cfba6c2
commit 1e769b7260
2 changed files with 8 additions and 19 deletions

View File

@@ -35,7 +35,8 @@ cleanup-packet:
create-vagrant:
vagrant up
cp $(CI_PROJECT_DIR)/inventory/sample/vagrant_ansible_inventory $(INVENTORY)
cp $(CI_PROJECT_DIR)/.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory $(INVENTORY)
delete-vagrant:
vagrant destroy -f