-
Notifications
You must be signed in to change notification settings - Fork 52
55 lines (48 loc) · 1.52 KB
/
run-playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Deployment Tests
run-name: Test Deployment
on:
push:
pull_request:
schedule:
- cron: '23 9 * * 0'
permissions:
contents: read
jobs:
Ubuntu_22:
runs-on: ubuntu-22.04
steps:
- name: Check out repo code
uses: actions/checkout@v4
- name: Install ansible
run: |
sudo apt update
sudo sudo apt install software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install ansible
- name: Ensure base playbook requirements
# should mirror the steps for advanced config creation
# does not use the `make` command since it requires input and we cannot input in a Runner
run: |
mkdir -p ./inventory/group_vars/all
cp ./roles/hmsdocker/defaults/main/*.yml ./inventory/group_vars/all
chmod 0600 ./inventory/group_vars/all/*.yml
make install-reqs
- name: Run playbook
run: >-
sudo ansible-playbook
-i inventory/hosts.yml
hms-docker.yml
--diff
--extra-vars "@.github/extra-vars.yml"
- name: Check containers
run: |
sleep 60
sudo pip3 install -r .github/workflows/scripts/requirements.txt
sudo make verify-containers
- name: Run playbook again to ensure API keys are retrieved
run: >-
sudo ansible-playbook
-i inventory/hosts.yml
hms-docker.yml
--diff
--extra-vars "@.github/extra-vars.yml"