Skip to content

Commit 6e8661c

Browse files
committed
(maint) Extract concrete inventory file for pr_testing workflow
The kvm_automation_tooling generated inventory files rely on a fork of the puppetlabs-terraform module plugins to extract target information from the Terraform state file (jpartlow/puppetlabs-terraform@include-module-when-resolving-references). This change came between v1 and v2 kvm_automation_tooling versions. When we run openvox_bootstrap tasks, in CI, the Bolt installation only has the base puppetlabs-terraform module to work with, so we need an inventory file with explicit target information (ip addresses) now that nested_vms is using kvm_automation_tooling@v2. The .inventory.targets from 'bolt inventory show --format json' is suitable as a concrete list of targets with a little massaging (there is a 'groups' entry that Bolt doesn't expect in an inventory file).
1 parent b811ef4 commit 6e8661c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/pr_testing_with_nested_vms.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,15 @@ jobs:
5858
"cpu_mode": "host-model"
5959
}
6060
]
61+
- name: Capture dereferenced inventory for use with openvox_bootstrap
62+
working-directory: kvm_automation_tooling
63+
run: |-
64+
bolt inventory --inventory terraform/instances/inventory.test.yaml show --format json --detail | \
65+
jq '.inventory | with_entries(select(.key == "targets")) | del(.targets[0].groups)' | \
66+
yq -P > ../inventory.yaml
6167
- name: Run openvox_bootstrap::install task on nested vm
6268
run: |-
63-
bolt task run openvox_bootstrap::install --inventory kvm_automation_tooling/terraform/instances/inventory.test.yaml --targets test-agent-1
69+
bolt task run openvox_bootstrap::install --inventory inventory.yaml --targets test-agent-1
6470
- name: Verify openvox-agent is installed
6571
run: |-
66-
bolt task run openvox_bootstrap::check version=8 test=gt --inventory kvm_automation_tooling/terraform/instances/inventory.test.yaml --targets test-agent-1
72+
bolt task run openvox_bootstrap::check version=8 test=gt --inventory inventory.yaml --targets test-agent-1

0 commit comments

Comments
 (0)