Skip to content

Commit 575333f

Browse files
Initial commit
0 parents  commit 575333f

File tree

9 files changed

+150
-0
lines changed

9 files changed

+150
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
molecule/default

.yamllint

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
# Based on ansible-lint config
3+
extends: default
4+
5+
rules:
6+
braces:
7+
max-spaces-inside: 1
8+
level: error
9+
brackets:
10+
max-spaces-inside: 1
11+
level: error
12+
colons:
13+
max-spaces-after: -1
14+
level: error
15+
commas:
16+
max-spaces-after: -1
17+
level: error
18+
comments: disable
19+
comments-indentation: disable
20+
document-start: disable
21+
empty-lines:
22+
max: 3
23+
level: error
24+
hyphens:
25+
level: error
26+
indentation: disable
27+
key-duplicates: enable
28+
line-length: disable
29+
new-line-at-end-of-file: disable
30+
new-lines:
31+
type: unix
32+
trailing-spaces: disable
33+
truthy: disable

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Role Name
2+
=========
3+
4+
A brief description of the role goes here.
5+
6+
Requirements
7+
------------
8+
9+
Any pre-requisites that may not be covered by Ansible itself or the role should
10+
be mentioned here. For instance, if the role uses the EC2 module, it may be a
11+
good idea to mention in this section that the boto package is required.
12+
13+
Role Variables
14+
--------------
15+
16+
A description of the settable variables for this role should go here, including
17+
any variables that are in defaults/main.yml, vars/main.yml, and any variables
18+
that can/should be set via parameters to the role. Any variables that are read
19+
from other roles and/or the global scope (ie. hostvars, group vars, etc.) should
20+
be mentioned here as well.
21+
22+
Dependencies
23+
------------
24+
25+
A list of other roles hosted on Galaxy should go here, plus any details in
26+
regards to parameters that may need to be set for other roles, or variables that
27+
are used from other roles.
28+
29+
Example Playbook
30+
----------------
31+
32+
Including an example of how to use your role (for instance, with variables
33+
passed in as parameters) is always nice for users too:
34+
35+
- hosts: servers
36+
roles:
37+
- { role: ansible-github_actions_runner, x: 42 }
38+
39+
License
40+
-------
41+
42+
BSD
43+
44+
Author Information
45+
------------------
46+
47+
An optional section for the role authors to include contact information, or a
48+
website (HTML is not allowed).

defaults/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
runner_dir: "/opt/actions-runner"
3+
runner_version: "2.165.2"
4+
access_token: "{{ GITHUB_ACCESS_TOKEN }}"
5+
github_server: "https://github.com"
6+
github_account: "monolithprojects"
7+
github_repo: "ansible-home_cluster"

handlers/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
# handlers file for ansible-github_actions_runner

meta/main.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
galaxy_info:
3+
author: Michal Muransky
4+
role_name: Github Actions runner
5+
description: Deploy Github Actions private runner
6+
company: MonolithProjects
7+
license: "license (MIT)"
8+
min_ansible_version: 2.4
9+
platforms:
10+
- name: EL
11+
versions:
12+
- 6
13+
- 7
14+
- name: Fedora
15+
versions:
16+
- all
17+
- name: Debian
18+
versions:
19+
- jessie
20+
- stretch
21+
- name: Ubuntu
22+
versions:
23+
- trusty
24+
- xenial
25+
- bionic
26+
galaxy_tags:
27+
- github
28+
- actions
29+
- private
30+
- local
31+
- runner
32+
- cicd
33+
dependencies: []

tasks/install_runner.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
- name: Create directory
3+
file:
4+
path: "{{ runner_dir }}"
5+
state: directory
6+
mode: '0755'
7+
recurse: yes
8+
9+
- name: Download runner package
10+
local_action:
11+
module: get_url
12+
url: "https://github.com/actions/runner/releases/download/v{{ runner_version }}/actions-runner-linux-x64-{{ runner_version }}.tar.gz"
13+
dest: ./actions-runner-linux.tar.gz
14+
run_once: yes
15+
16+
- name: Unarchive package
17+
unarchive:
18+
src: ./actions-runner-linux.tar.gz
19+
dest: "{{ runner_dir }}/"
20+
21+
- name: Run
22+
command: '{{ runner_dir }}/config.sh --url {{ github_server }}/{{ github_account }}/{{ github_repo }} --token {{ repo_token }}'

tasks/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
- include_tasks: install_runner.yml

vars/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
# vars file for ansible-github_actions_runner

0 commit comments

Comments
 (0)