Skip to content

Commit 25b45db

Browse files
committed
use full path for inventory
1 parent c6e613b commit 25b45db

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/workflows/gcp-vm.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,11 @@ jobs:
6161
run: |
6262
ansible-playbook -i "localhost ansible_connection=local", ansible/playbook-gcp-vm-create.yaml
6363
64-
# TODO: move this out of the playbook, so it can be reused.
6564
- name: Run Ansible playbook on the VM
6665
run: |
67-
ansible-playbook -i inventory.ini ansible/playbook.yaml
66+
ansible-playbook -i /tmp/inventory.ini ansible/playbook.yaml
6867
69-
- name: Always runs after failure
68+
- name: Always delete VM after failure
7069
if: failure()
7170
env:
7271
GCP_PROJECT_ID: ${{ env.GCP_PROJECT_ID }}

ansible/playbook-gcp-vm-create.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
mode: '0600'
2121

2222
- name: Install Python packages into Ansible's pipx venv
23+
# Base on: https://github.com/ansible-collections/google.cloud/blob/master/requirements.txt
2324
ansible.builtin.command:
2425
cmd: "{{ ansible_playbook_python }} -m pip install requests google-auth google-cloud-storage"
2526
changed_when: true
@@ -76,4 +77,4 @@
7677
content: |
7778
[gcp]
7879
{{ external_ip }} ansible_user={{ ansible_user }} ansible_ssh_private_key_file=~/.ssh/id_rsa
79-
dest: inventory.ini
80+
dest: /tmp/inventory.ini

0 commit comments

Comments
 (0)