fix service not starting properly
Some checks failed
Deploy Containers / Prepare (push) Failing after 3s
Some checks failed
Deploy Containers / Prepare (push) Failing after 3s
This commit is contained in:
@@ -19,22 +19,30 @@
|
|||||||
mode: 0755
|
mode: 0755
|
||||||
when: not act_runner.stat.exists
|
when: not act_runner.stat.exists
|
||||||
|
|
||||||
|
- name: Copy Gitea Act Runner Config
|
||||||
|
template:
|
||||||
|
src: config.yml.j2
|
||||||
|
dest: "{{ data_dir }}/gitea/config.yml"
|
||||||
|
|
||||||
- name: Check if Act Runner is a Systemd Service
|
- name: Check if Act Runner is a Systemd Service
|
||||||
stat:
|
stat:
|
||||||
path: "/etc/systemd/system/act_runner.service"
|
path: "/etc/systemd/system/act_runner.service"
|
||||||
register: act_runner_service
|
register: act_runner_service
|
||||||
|
|
||||||
|
- name: Stop & remove systemd service
|
||||||
|
become: yes
|
||||||
|
shell: |
|
||||||
|
systemctl stop act_runner.service &&
|
||||||
|
rm /etc/systemd/system/act_runner.service
|
||||||
- name: Create Systemd Service
|
- name: Create Systemd Service
|
||||||
become: yes
|
become: yes
|
||||||
template:
|
template:
|
||||||
src: act_runner.service.j2
|
src: act_runner.service.j2
|
||||||
dest: "/etc/systemd/system/act_runner.service"
|
dest: "/etc/systemd/system/act_runner.service"
|
||||||
when: not act_runner_service.stat.exists
|
|
||||||
- name: Enable Systemd Service
|
- name: Enable Systemd Service
|
||||||
become: yes
|
become: yes
|
||||||
command: systemctl enable act_runner.service
|
command: systemctl enable act_runner.service
|
||||||
when: not act_runner_service.stat.exists
|
|
||||||
- name: Start Systemd Service
|
- name: Start Systemd Service
|
||||||
become: yes
|
become: yes
|
||||||
command: systemctl start act_runner.service
|
command: systemctl start act_runner.service
|
||||||
when: not act_runner_service.stat.exists
|
|
||||||
|
@@ -4,13 +4,13 @@ Documentation=https://gitea.com/gitea/act_runner
|
|||||||
After=docker.service
|
After=docker.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart={{ data_dir }}/gitea/act_runner daemon --instance {{ GITEA_INSTANCE_URL }} --token {{ GITEA_RUNNER_REGISTRATION_TOKEN }} --name {{ GITEA_RUNNER_NAME }} --labels {{ GITEA_RUNNER_LABELS }}
|
ExecStart={{ data_dir }}/gitea/act_runner daemon --config={{ data_dir }}/gitea/config.yml
|
||||||
ExecReload=/bin/kill -s HUP $MAINPID
|
ExecReload=/bin/kill -s HUP $MAINPID
|
||||||
WorkingDirectory={{ data_dir }}/gitea
|
WorkingDirectory={{ data_dir }}/gitea
|
||||||
TimeoutSec=0
|
TimeoutSec=0
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
Restart=always
|
Restart=always
|
||||||
User=act_runner
|
User=alex
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
16
roles/gitea-runner/templates/config.yml.j2
Normal file
16
roles/gitea-runner/templates/config.yml.j2
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
log:
|
||||||
|
level: info
|
||||||
|
|
||||||
|
runner:
|
||||||
|
file: .runner
|
||||||
|
capacity: 1
|
||||||
|
timeout: 3h
|
||||||
|
shutdown_timeout: 0s
|
||||||
|
insecure: false
|
||||||
|
fetch_timeout: 5s
|
||||||
|
fetch_interval: 2s
|
||||||
|
labels:
|
||||||
|
- "runner:host"
|
||||||
|
|
||||||
|
host:
|
||||||
|
workdir_parent: "{{ data_dir }}/gitea/job"
|
Reference in New Issue
Block a user