Skip to content

Commit 6e1737f

Browse files
Merge pull request #50 from MonolithProjects/develop
Add static name for download destination folder
2 parents 6e1a1a2 + f3f7440 commit 6e1737f

File tree

8 files changed

+34
-40
lines changed

8 files changed

+34
-40
lines changed

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,16 @@ runner_user: "{{ lookup('env','USER') }}"
4545
# Directory where the local runner will be installed
4646
runner_dir: /opt/actions-runner
4747

48+
# Directory where the runner package will be dowloaded
49+
runner_pkg_tempdir: /tmp/gh_actions_runner
50+
4851
# Version of the GitHub Actions Runner
4952
runner_version: "latest"
5053

5154
# State in which the runner service will be after the role is done (started, stopped, absent)
5255
runner_state: "started"
5356

54-
# If found on the server, delete already existed runner service before install
57+
# If found on the server, delete already existing runner service and install it again
5558
reinstall_runner: no
5659

5760
# Do not show Ansible logs which may contain sensitive data (registration token)
@@ -63,10 +66,10 @@ github_server: "https://github.com"
6366
# Personal Access Token for your GitHub account
6467
access_token: "{{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
6568

66-
# Is it the runner for organization or not
69+
# Is it the runner for organization or not?
6770
runner_org: no
6871

69-
# Name to assign to this runner in GitHub (hostname as default)
72+
# Name to assign to this runner in GitHub (System hostname as default)
7073
runner_name: "{{ ansible_hostname }}"
7174

7275
# GitHub Repository user or Organization owner used for Runner registration

defaults/main.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ runner_user: "{{ lookup('env','USER') }}"
55
# Directory where the local runner will be installed
66
runner_dir: /opt/actions-runner
77

8+
# Directory where the runner package will be dowloaded
9+
runner_pkg_tempdir: /tmp/gh_actions_runner
10+
811
# Version of the GitHub Actions Runner
912
runner_version: "latest"
1013

1114
# State in which the runner service will be after the role is done (started, stopped, absent)
1215
runner_state: "started"
1316

14-
# If found on the server, delete already existed runner service before install
17+
# If found on the server, delete already existing runner service and install it again
1518
reinstall_runner: no
1619

1720
# Do not show Ansible logs which may contain sensitive data (registration token)
@@ -23,10 +26,10 @@ github_server: "https://github.com"
2326
# Personal Access Token for your GitHub account
2427
access_token: "{{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"
2528

26-
# Is it the runner for organization or not
29+
# Is it the runner for organization or not?
2730
runner_org: no
2831

29-
# Name to assign to this runner in GitHub (hostname as default)
32+
# Name to assign to this runner in GitHub (System hostname as default)
3033
runner_name: "{{ ansible_hostname }}"
3134

3235
# GitHub Repository user or Organization owner used for Runner registration

molecule/default/converge.yml

+3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
- name: Install
33
user: ansible
44
hosts: all
5+
gather_facts: yes
56
become: yes
67
vars:
78
- runner_user: ansible
89
- github_repo: ansible-github_actions_runner-testrepo
910
- github_account: monolithprojects
1011
- runner_version: "latest"
12+
- reinstall_runner: yes
1113
roles:
1214
- robertdebock.epel
1315
- ansible-github_actions_runner
@@ -16,6 +18,7 @@
1618
user: ansible
1719
hosts: all
1820
become: yes
21+
gather_facts: yes
1922
vars:
2023
- runner_user: ansible
2124
- github_repo: ansible-github_actions_runner-testrepo

molecule/default/molecule.yml

-12
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,6 @@ provisioner:
101101
converge: converge.yml
102102
cleanup: cleanup.yml
103103
log: false
104-
inventory:
105-
host_vars:
106-
CentOS8:
107-
ansible_python_interpreter: /usr/bin/python3
108-
Debian9:
109-
ansible_python_interpreter: /usr/bin/python3
110-
Debian10:
111-
ansible_python_interpreter: /usr/bin/python3
112-
Ubuntu18:
113-
ansible_python_interpreter: /usr/bin/python3
114-
Ubuntu20:
115-
ansible_python_interpreter: /usr/bin/python3
116104
verifier:
117105
name: testinfra
118106
directory: tests

molecule/default/requirements.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
---
22
- role: robertdebock.epel
3-
version: master
4-
# - role: monolithprojects.user_management
5-
# version: master
3+
version: 2.5.4

molecule/organization/molecule.yml

-12
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,6 @@ provisioner:
101101
converge: converge.yml
102102
cleanup: cleanup.yml
103103
log: false
104-
inventory:
105-
host_vars:
106-
CentOS8:
107-
ansible_python_interpreter: /usr/bin/python3
108-
Debian9:
109-
ansible_python_interpreter: /usr/bin/python3
110-
Debian10:
111-
ansible_python_interpreter: /usr/bin/python3
112-
Ubuntu18:
113-
ansible_python_interpreter: /usr/bin/python3
114-
Ubuntu20:
115-
ansible_python_interpreter: /usr/bin/python3
116104
verifier:
117105
name: testinfra
118106
directory: tests
+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
---
22
- role: robertdebock.epel
3-
version: master
4-
# - role: monolithprojects.user_management
5-
# version: master
3+
version: 2.5.4

tasks/install_runner.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,23 @@
4242
tags:
4343
- install
4444

45+
# - name: Create temporary directory for archive
46+
# tempfile:
47+
# state: directory
48+
# register: tempdir
49+
# run_once: yes
50+
# delegate_to: localhost
51+
# become: false
52+
# when: runner_version not in runner_installed.stdout
53+
# tags:
54+
# - install
55+
4556
- name: Create temporary directory for archive
46-
tempfile:
57+
file:
58+
path: "{{ runner_pkg_tempdir }}"
4759
state: directory
48-
register: tempdir
60+
recurse: yes
61+
mode: '0777'
4962
run_once: yes
5063
delegate_to: localhost
5164
become: false
@@ -56,7 +69,7 @@
5669
- name: Download runner package version - "{{ runner_version }}" (RUN ONCE)
5770
get_url:
5871
url: "https://github.com/actions/runner/releases/download/v{{ runner_version }}/actions-runner-linux-x64-{{ runner_version }}.tar.gz"
59-
dest: "{{ tempdir.path }}/actions-runner-linux-{{ runner_version }}.tar.gz"
72+
dest: "{{ runner_pkg_tempdir }}/actions-runner-linux-{{ runner_version }}.tar.gz"
6073
force: no
6174
run_once: yes
6275
become: false
@@ -67,7 +80,7 @@
6780

6881
- name: Unarchive package
6982
unarchive:
70-
src: "{{ tempdir.path }}/actions-runner-linux-{{ runner_version }}.tar.gz"
83+
src: "{{ runner_pkg_tempdir }}/actions-runner-linux-{{ runner_version }}.tar.gz"
7184
dest: "{{ runner_dir }}/"
7285
owner: "{{ runner_user }}"
7386
mode: 0755

0 commit comments

Comments
 (0)