Skip to content

Commit b401bf5

Browse files
Merge pull request #126 from MonolithProjects/develop
Develop to Master
2 parents d03ff31 + 96c0fd6 commit b401bf5

17 files changed

+124
-291
lines changed

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: true
1717
steps:
1818
- name: checkout
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v3
2020
with:
2121
path: "${{ github.repository }}"
2222
- name: Molecule for Ansible - lint

.github/workflows/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
tag: "latest"
3434
steps:
3535
- name: checkout
36-
uses: actions/checkout@v2
36+
uses: actions/checkout@v3
3737
with:
3838
path: "${{ github.repository }}"
3939
- name: Molecule for Ansible - GHR Repository
@@ -53,7 +53,7 @@ jobs:
5353
fail-fast: false
5454
steps:
5555
- name: checkout
56-
uses: actions/checkout@v2
56+
uses: actions/checkout@v3
5757
with:
5858
path: "${{ github.repository }}"
5959
- name: Molecule for Ansible - GHR Organization

defaults/main.yml

-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ runner_name: "{{ ansible_hostname }}"
5151
# Will the runner be deployed on Github Enterprise server?
5252
runner_on_ghes: no
5353

54-
# Custom service name when using Github Enterprise server
55-
# DEPRECATED: this variable is deprecated in favor of "runner_on_ghes" and will be removed in release 1.15.
56-
# service_name: actions.runner._services.{{ runner_name }}.service
57-
5854
# GitHub Repository user or Organization owner used for Runner registration
5955
# github_account: "youruser"
6056

handlers/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
- name: Restart runner service
44
service:
55
name: "{{ runner_service }}"
6-
state: restarted
6+
state: restarted

molecule/default/cleanup.yml

+1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
- github_repo: ansible-github_actions_runner-testrepo
99
- github_account: monolithprojects-testorg
1010
- runner_state: absent
11+
- runner_name: test_name
1112
roles:
1213
- ansible-github_actions_runner

molecule/default/converge.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
- runner_user: ansible
99
- github_repo: ansible-github_actions_runner-testrepo
1010
- github_account: monolithprojects-testorg
11-
- runner_version: "latest"
12-
- service_name: awesome
11+
- runner_version: latest
12+
- runner_name: test_name
13+
- runner_on_ghes: yes
14+
- reinstall_runner: false
15+
- hide_sensitive_logs: no
1316
- runner_labels:
1417
- label1
1518
- repo-runner

molecule/org/converge.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- github_account: monolithprojects-testorg
99
- runner_org: yes
1010
- runner_state: "stopped"
11-
- runner_version: "2.274.2"
11+
- runner_version: "2.287.0"
1212
roles:
1313
- robertdebock.epel
14-
- ansible-github_actions_runner
14+
- ansible-github_actions_runner

molecule/repo/cleanup.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
- github_account: monolithprojects-testorg
1010
- runner_state: absent
1111
roles:
12-
- ansible-github_actions_runner
12+
- ansible-github_actions_runner

molecule/repo/converge.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
- github_repo: ansible-github_actions_runner-testrepo
1010
- github_account: monolithprojects-testorg
1111
- runner_version: "latest"
12-
- runner_labels:
12+
- runner_labels:
1313
- label1
1414
- repo-runner
1515
roles:
1616
- robertdebock.epel
17-
- ansible-github_actions_runner
17+
- ansible-github_actions_runner

tasks/assert.yml

-20
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
- github_account is defined
66
fail_msg: "github_account is not defined"
77
run_once: yes
8-
tags:
9-
- install
10-
- uninstall
118

129
- name: Check access_token variable (RUN ONCE)
1310
assert:
@@ -16,27 +13,10 @@
1613
- access_token | length > 0
1714
fail_msg: "access_token was not found or is using an invalid format."
1815
run_once: yes
19-
tags:
20-
- install
21-
- uninstall
2216

2317
- name: Check runner_org variable (RUN ONCE)
2418
assert:
2519
that:
2620
- runner_org == True or runner_org == False
2721
fail_msg: "runner_org should be a boolean value"
2822
run_once: yes
29-
tags:
30-
- install
31-
- uninstall
32-
33-
- name: GHES service_name deprecation check (RUN ONCE)
34-
assert:
35-
that:
36-
- service_name is not defined
37-
fail_msg: '[DEPRECATION WARNING]: Variable "service_name" will is deprecated and will be removed in release 1.15. Start using "running_on_ghes" boolean variable.'
38-
ignore_errors: yes
39-
run_once: yes
40-
tags:
41-
- install
42-
- uninstall

tasks/collect_info.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
- block:
3+
- name: Set complete API url for repo runner
4+
set_fact:
5+
github_full_api_url: "{{ github_api_url }}/repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners"
6+
when: not runner_org
7+
8+
- name: Set complete API url for org runner
9+
set_fact:
10+
github_full_api_url: "{{ github_api_url }}/orgs/{{ github_owner | default(github_account) }}/actions/runners"
11+
when: runner_org | bool
12+
13+
- name: Get registration token (RUN ONCE)
14+
uri:
15+
url: "{{ github_full_api_url }}/registration-token"
16+
headers:
17+
Authorization: "token {{ access_token }}"
18+
Accept: "application/vnd.github.v3+json"
19+
method: POST
20+
status_code: 201
21+
force_basic_auth: yes
22+
register: registration
23+
run_once: yes
24+
25+
- name: Check currently registered runners for repo (RUN ONCE)
26+
uri:
27+
url: "{{ github_full_api_url }}"
28+
headers:
29+
Authorization: "token {{ access_token }}"
30+
Accept: "application/vnd.github.v3+json"
31+
method: GET
32+
status_code: 200
33+
force_basic_auth: yes
34+
register: registered_runners
35+
run_once: yes
36+
37+
- name: Check service facts
38+
service_facts:
39+
40+
check_mode: false

tasks/collect_info_org.yml

-64
This file was deleted.

tasks/collect_info_repo.yml

-63
This file was deleted.

tasks/install_deps.yml

-14
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
state: present
1313
update_cache: yes
1414
when: (ansible_distribution == "Debian" and ansible_distribution_major_version == "9")
15-
tags:
16-
- install
1715

1816
- name: Install dependencies on Debian Buster
1917
package:
@@ -27,8 +25,6 @@
2725
state: present
2826
update_cache: yes
2927
when: (ansible_distribution == "Debian" and ansible_distribution_major_version == "10")
30-
tags:
31-
- install
3228

3329
- name: Install dependencies on Debian Bullseye
3430
package:
@@ -42,8 +38,6 @@
4238
state: present
4339
update_cache: yes
4440
when: (ansible_distribution == "Debian" and ansible_distribution_major_version == "11")
45-
tags:
46-
- install
4741

4842
- name: Install dependencies on Ubuntu Xenial systems
4943
package:
@@ -57,8 +51,6 @@
5751
state: present
5852
update_cache: yes
5953
when: (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "16")
60-
tags:
61-
- install
6254

6355
- name: Install dependencies on Ubuntu Bionic systems
6456
package:
@@ -72,8 +64,6 @@
7264
state: present
7365
update_cache: yes
7466
when: (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "18")
75-
tags:
76-
- install
7767

7868
- name: Install dependencies on Ubuntu Focal systems
7969
package:
@@ -87,8 +77,6 @@
8777
state: present
8878
update_cache: yes
8979
when: (ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "20")
90-
tags:
91-
- install
9280

9381
- name: Install dependencies on RHEL/CentOS/Fedora systems
9482
package:
@@ -105,5 +93,3 @@
10593
(ansible_distribution == "CentOS") or
10694
(ansible_distribution == "Fedora") or
10795
(ansible_distribution == "Rocky")
108-
tags:
109-
- install

0 commit comments

Comments
 (0)