Skip to content

Commit

Permalink
add runner role
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpugh committed Mar 21, 2024
1 parent 9c4fb54 commit b1824b4
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 5 deletions.
File renamed without changes.
21 changes: 21 additions & 0 deletions ansible/group_vars/ash_host.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

# Set a list of github usernames to:
# - Create a system user with sudo privileges.
# - Add all of the users's Github SSH keys to authorized_keys.
#
# WARNING: Change this, unless you want to give me access to your server.
#
ash_admin_users:
- jonpugh


# Pass the list of users to geerlingguy.security and geerlingguy.github.
security_ssh_allowed_users: "{{ ash_admin_users }}"
github_users: "{{ ash_admin_users }}"
security_sudoers_passwordless: "{{ ash_admin_users }}"

# Replace with your repo information. Get the runner token under Settings > Actions > Runners > New Runner
ash_github_runners:
- repo_url: https://github.com/jonpugh/ash-ops
runner_token: AAAZ7ND5U5YBRA6D5PFS5TTF7R6RY
user: platform
6 changes: 4 additions & 2 deletions playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@
- role: ash.ddev
tags: ash, ddev

# - role: ash.runner
# tags: ash
- role: ash.runner
tags:
- ash
- runner
1 change: 1 addition & 0 deletions roles/ash.runner/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ash_github_runner_path: /usr/share/github-runner
20 changes: 17 additions & 3 deletions roles/ash.runner/tasks/github.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
---

# See

# See Your repo > Settings > Actions > Runner > New Runner
- name: Install GitHub Runner
shell: curl -s -L https://example.com/archive.tar.gz | tar xvz - -C /usr/share/github-runner
shell:
cmd: "{{ item }}"
with_items:
- mkdir {{ ash_github_runner_path }} -p
- curl -o {{ ash_github_runner_path }}/actions-runner-linux-x64-2.314.1.tar.gz -L https://github.com/actions/runner/releases/download/v2.314.1/actions-runner-linux-x64-2.314.1.tar.gz
- cd {{ ash_github_runner_path }} && tar xzf {{ ash_github_runner_path }}/actions-runner-linux-x64-2.314.1.tar.gz
- cd {{ ash_github_runner_path }} && ./bin/installdependencies.sh
- chown {{ ash_platform_user }}:{{ ash_platform_user }} {{ ash_github_runner_path }} -R

- name: Configure GitHub Runner
command:
cmd: ./config.sh --url {{ item.repo_url }} --token {{ item.runner_token }}
chdir: "{{ ash_github_runner_path }}"
become: true
become_user: "{{ item.user }}"
with_items: "{{ ash_github_runners }}"

0 comments on commit b1824b4

Please sign in to comment.