Skip to content

Commit 734639f

Browse files
Added tests for organization runner
1 parent 12a369a commit 734639f

File tree

6 files changed

+195
-13
lines changed

6 files changed

+195
-13
lines changed

.github/workflows/lifecycle.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
with:
1919
path: "${{ github.repository }}"
2020
- name: Molecule for Ansible - lint
21-
uses: MonolithProjects/action-molecule@v1.3.0
21+
uses: MonolithProjects/action-molecule@v1.4.0
2222
with:
2323
molecule_command: lint
2424

@@ -33,15 +33,31 @@ jobs:
3333
with:
3434
path: "${{ github.repository }}"
3535
- name: Molecule for Ansible - converge Default
36-
uses: MonolithProjects/action-molecule@v1.3.0
36+
uses: MonolithProjects/action-molecule@v1.4.0
3737
env:
3838
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
3939
with:
4040
molecule_command: converge
4141
- name: Molecule for Ansible - converge tag uninstall
42-
uses: MonolithProjects/action-molecule@v1.3.0
42+
uses: MonolithProjects/action-molecule@v1.4.0
4343
env:
4444
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
4545
with:
4646
molecule_command: converge
47+
converge_extra_args: '-e "uninstall_runner=yes" --tags uninstall'
48+
49+
- name: Molecule for Ansible - converge organizations
50+
uses: MonolithProjects/[email protected]
51+
env:
52+
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
53+
with:
54+
molecule_command: converge
55+
scenario: organization
56+
- name: Molecule for Ansible - converge organizations tag uninstall
57+
uses: MonolithProjects/[email protected]
58+
env:
59+
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
60+
with:
61+
molecule_command: converge
62+
scenario: organization
4763
converge_extra_args: '-e "uninstall_runner=yes" --tags uninstall'

molecule/default/molecule.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ platforms:
2626
- /sys/fs/cgroup:/sys/fs/cgroup:ro
2727
privileged: yes
2828
pre_build_image: yes
29-
- name: Fedora31
30-
image: monolithprojects/systemd-fedora31:latest
31-
command: /sbin/init
32-
tmpfs:
33-
- /run
34-
- /tmp
35-
volumes:
36-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
37-
privileged: yes
38-
pre_build_image: yes
29+
# - name: Fedora31
30+
# image: monolithprojects/systemd-fedora31:latest
31+
# command: /sbin/init
32+
# tmpfs:
33+
# - /run
34+
# - /tmp
35+
# volumes:
36+
# - /sys/fs/cgroup:/sys/fs/cgroup:ro
37+
# privileged: yes
38+
# pre_build_image: yes
3939
- name: Fedora32
4040
image: monolithprojects/systemd-fedora32:latest
4141
command: /sbin/init
@@ -132,5 +132,6 @@ scenario:
132132
- create
133133
- prepare
134134
- converge
135+
- idempotence
135136
- cleanup
136137
- destroy

molecule/organization/converge.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
- name: Converge
3+
user: ansible
4+
hosts: all
5+
become: yes
6+
vars:
7+
- runner_user: ansible
8+
- github_repo: ansible-github_actions_runner-testrepo
9+
- github_account: monolithprojects-testorg
10+
- runner_org: yes
11+
roles:
12+
- robertdebock.epel
13+
- ansible-github_actions_runner

molecule/organization/molecule.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
---
2+
driver:
3+
name: docker
4+
lint: |
5+
set -e
6+
yamllint .
7+
ansible-lint
8+
platforms:
9+
- name: CentOS7
10+
image: monolithprojects/systemd-centos7:latest
11+
command: /sbin/init
12+
tmpfs:
13+
- /run
14+
- /tmp
15+
volumes:
16+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
17+
privileged: yes
18+
pre_build_image: yes
19+
- name: CentOS8
20+
image: monolithprojects/systemd-centos8:latest
21+
command: /sbin/init
22+
tmpfs:
23+
- /run
24+
- /tmp
25+
volumes:
26+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
27+
privileged: yes
28+
pre_build_image: yes
29+
# - name: Fedora31
30+
# image: monolithprojects/systemd-fedora31:latest
31+
# command: /sbin/init
32+
# tmpfs:
33+
# - /run
34+
# - /tmp
35+
# volumes:
36+
# - /sys/fs/cgroup:/sys/fs/cgroup:ro
37+
# privileged: yes
38+
# pre_build_image: yes
39+
- name: Fedora32
40+
image: monolithprojects/systemd-fedora32:latest
41+
command: /sbin/init
42+
tmpfs:
43+
- /run
44+
- /tmp
45+
volumes:
46+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
47+
privileged: yes
48+
pre_build_image: yes
49+
- name: Ubuntu16
50+
image: monolithprojects/systemd-ubuntu16:latest
51+
command: /sbin/init
52+
tmpfs:
53+
- /run
54+
- /tmp
55+
volumes:
56+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
57+
privileged: yes
58+
pre_build_image: yes
59+
- name: Ubuntu18
60+
image: monolithprojects/systemd-ubuntu18:latest
61+
command: /sbin/init
62+
tmpfs:
63+
- /run
64+
- /tmp
65+
volumes:
66+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
67+
privileged: yes
68+
pre_build_image: yes
69+
- name: Ubuntu20
70+
image: monolithprojects/systemd-ubuntu20:latest
71+
command: /sbin/init
72+
tmpfs:
73+
- /run
74+
- /tmp
75+
volumes:
76+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
77+
privileged: yes
78+
pre_build_image: yes
79+
- name: Debian9
80+
image: monolithprojects/systemd-debian9:latest
81+
command: /sbin/init
82+
tmpfs:
83+
- /run
84+
- /tmp
85+
volumes:
86+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
87+
privileged: yes
88+
pre_build_image: yes
89+
- name: Debian10
90+
image: monolithprojects/systemd-debian10:latest
91+
command: /sbin/init
92+
tmpfs:
93+
- /run
94+
- /tmp
95+
volumes:
96+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
97+
privileged: yes
98+
pre_build_image: yes
99+
provisioner:
100+
name: ansible
101+
playbooks:
102+
converge: converge.yml
103+
cleanup: cleanup.yml
104+
log: false
105+
inventory:
106+
host_vars:
107+
CentOS8:
108+
ansible_python_interpreter: /usr/bin/python3
109+
Debian9:
110+
ansible_python_interpreter: /usr/bin/python3
111+
Debian10:
112+
ansible_python_interpreter: /usr/bin/python3
113+
Ubuntu18:
114+
ansible_python_interpreter: /usr/bin/python3
115+
Ubuntu20:
116+
ansible_python_interpreter: /usr/bin/python3
117+
verifier:
118+
name: ansible
119+
dependency:
120+
name: galaxy
121+
options:
122+
ignore-certs: True
123+
ignore-errors: True
124+
scenario:
125+
name: organization
126+
test_sequence:
127+
- dependency
128+
- lint
129+
- cleanup
130+
- destroy
131+
- syntax
132+
- create
133+
- prepare
134+
- converge
135+
- idempotence
136+
- cleanup
137+
- destroy
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
- role: robertdebock.epel
3+
version: master
4+
# - role: monolithprojects.user_management
5+
# version: master

molecule/organization/verify.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
# This is an example playbook to execute Ansible tests.
3+
4+
- name: Verify
5+
hosts: all
6+
gather_facts: false
7+
tasks:
8+
- name: Example assertion
9+
assert:
10+
that: true

0 commit comments

Comments
 (0)