Initial commit: Ansible playbook for Gitea Act Runner deployment
Some checks failed
Ansible Lint / Ansible Lint Check (push) Has been cancelled
Some checks failed
Ansible Lint / Ansible Lint Check (push) Has been cancelled
Automated deployment of act_runner on Ubuntu 20.04+ servers: - Docker CE installation (DEB822 format) - Node.js 24.x via NodeSource - act_runner binary with SHA256 verification - systemd service with security hardening - CI: ansible-lint via Gitea Actions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
54
roles/act_runner/tasks/nodejs.yml
Normal file
54
roles/act_runner/tasks/nodejs.yml
Normal file
@@ -0,0 +1,54 @@
|
||||
---
|
||||
# =============================================================================
|
||||
# Gitea Act Runner - Node.js Installation
|
||||
# =============================================================================
|
||||
#
|
||||
# Installs Node.js LTS via NodeSource:
|
||||
# https://github.com/nodesource/distributions
|
||||
#
|
||||
# Node.js is required because:
|
||||
# - Many GitHub Actions are written in JavaScript
|
||||
# - Popular actions like checkout, cache, upload-artifact need Node.js
|
||||
# - The runner itself may need Node.js for certain operations
|
||||
#
|
||||
# =============================================================================
|
||||
|
||||
# Install prerequisites for NodeSource setup script.
|
||||
- name: Install Node.js prerequisites
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- ca-certificates
|
||||
- curl
|
||||
- gnupg
|
||||
state: present
|
||||
|
||||
# Download NodeSource setup script.
|
||||
# This script adds the NodeSource APT repository.
|
||||
- name: Download NodeSource setup script
|
||||
ansible.builtin.get_url:
|
||||
url: "https://deb.nodesource.com/setup_{{ act_runner_nodejs_version }}.x"
|
||||
dest: /tmp/nodesource_setup.sh
|
||||
mode: '0755'
|
||||
|
||||
# Execute the NodeSource setup script to configure APT repository.
|
||||
# Script is safe to re-run (idempotent).
|
||||
- name: Execute NodeSource setup script
|
||||
ansible.builtin.command:
|
||||
cmd: /tmp/nodesource_setup.sh
|
||||
args:
|
||||
creates: /etc/apt/sources.list.d/nodesource.list
|
||||
register: act_runner_nodesource_result
|
||||
changed_when: act_runner_nodesource_result.rc == 0
|
||||
|
||||
# Install Node.js from NodeSource repository.
|
||||
- name: Install Node.js
|
||||
ansible.builtin.apt:
|
||||
name: nodejs
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
# Clean up setup script.
|
||||
- name: Remove NodeSource setup script
|
||||
ansible.builtin.file:
|
||||
path: /tmp/nodesource_setup.sh
|
||||
state: absent
|
||||
Reference in New Issue
Block a user