|
70 | 70 | - name: Verify openvox-agent is installed |
71 | 71 | run: |- |
72 | 72 | bolt task run openvox_bootstrap::check version=8 test=gt --inventory inventory.yaml --targets test-agent-1 |
| 73 | +
|
| 74 | + # The rockylinux containers aren't set up for interacting with systemd |
| 75 | + # so using nested_vms for this test. |
| 76 | + test-install-and-stop: |
| 77 | + strategy: |
| 78 | + fail-fast: false |
| 79 | + matrix: |
| 80 | + os: |
| 81 | + - [debian, '12'] |
| 82 | + - [rocky, '9'] |
| 83 | + - [ubuntu, '24.04'] |
| 84 | + runs-on: ubuntu-22.04 |
| 85 | + steps: |
| 86 | + - uses: actions/checkout@v4 |
| 87 | + - id: install-bolt |
| 88 | + uses: ./.github/actions/bolt |
| 89 | + with: |
| 90 | + os-codename: jammy |
| 91 | + - id: vm-cluster |
| 92 | + uses: jpartlow/nested_vms@v1 |
| 93 | + with: |
| 94 | + os: ${{ matrix.os[0] }} |
| 95 | + os-version: ${{ matrix.os[1] }} |
| 96 | + os-arch: ${{ matrix.os[2] || 'x86_64' }} |
| 97 | + image_version: ${{ matrix.os[3] }} |
| 98 | + host-root-access: true |
| 99 | + ruby-version: '3.3' |
| 100 | + install-openvox: false |
| 101 | + # Note: the cpu_mode is set to host-model for the sake of |
| 102 | + # el-9 which expects at least x86_64-2 arch. This depends on |
| 103 | + # the runner's architecture being sufficient, and there is |
| 104 | + # probably a better way to get this set on the libvirt |
| 105 | + # domain instead. |
| 106 | + vms: |- |
| 107 | + [ |
| 108 | + { |
| 109 | + "role": "agent", |
| 110 | + "count": 1, |
| 111 | + "cpus": 2, |
| 112 | + "mem_mb": 4096, |
| 113 | + "cpu_mode": "host-model" |
| 114 | + } |
| 115 | + ] |
| 116 | + - name: Capture dereferenced inventory for use with openvox_bootstrap |
| 117 | + working-directory: kvm_automation_tooling |
| 118 | + run: |- |
| 119 | + bolt inventory --inventory terraform/instances/inventory.test.yaml show --format json --detail | \ |
| 120 | + jq '.inventory | with_entries(select(.key == "targets")) | del(.targets[0].groups)' | \ |
| 121 | + yq -P > ../inventory.yaml |
| 122 | + - name: Run openvox_bootstrap::install task on nested vm |
| 123 | + run: |- |
| 124 | + bolt task run openvox_bootstrap::install --inventory inventory.yaml --targets test-agent-1 stop_service=true |
| 125 | + - name: Verify openvox-agent is installed |
| 126 | + run: |- |
| 127 | + bolt task run openvox_bootstrap::check version=8 test=gt --inventory inventory.yaml --targets test-agent-1 |
| 128 | + - name: Verify service state |
| 129 | + run: |- |
| 130 | + set -e |
| 131 | + bolt command run '/opt/puppetlabs/bin/puppet resource service openvox-agent' --inventory inventory.yaml --targets test-agent-1 > service.state |
| 132 | + grep -E "ensure [ ]*=> [ ]*'stopped'" service.state |
| 133 | + grep -E "enable [ ]*=> [ ]*'false'" service.state |
0 commit comments