diff --git a/files/act_runner/act_runner.service b/files/act_runner/act_runner.service new file mode 100644 index 0000000..9f77d89 --- /dev/null +++ b/files/act_runner/act_runner.service @@ -0,0 +1,17 @@ +# /etc/systemd/system/act_runner.service +[Unit] +Description=Gitea Actions runner +Documentation=https://gitea.com/gitea/act_runner +#After=docker.service + +[Service] +ExecStart=/usr/local/bin/act_runner daemon --config /etc/act_runner/config.yaml +ExecReload=/bin/kill -s HUP $MAINPID +WorkingDirectory=/var/lib/act_runner +TimeoutSec=0 +RestartSec=10 +Restart=always +#User=act_runner + +[Install] +WantedBy=multi-user.target diff --git a/playbooks/software/act_runner.yml b/playbooks/software/act_runner.yml index 0866477..038526f 100644 --- a/playbooks/software/act_runner.yml +++ b/playbooks/software/act_runner.yml @@ -35,3 +35,23 @@ src: /usr/share/act_runner/act_runner-{{act_runner_version}} dest: /usr/local/bin/act_runner state: link + + - name: Copy act_runner.service + register: act_runner_service_file + copy: + src: ../../files/act_runner/act_runner.service + dest: /etc/systemd/system/act_runner.service + + # - name: ensure service + # ansible.builtin.systemd_service: + # name: act_runner + # state: started + # enabled: true + + - name: Just force systemd to reread configs + ansible.builtin.systemd_service: + daemon_reload: true + when: act_runner_service_file.changed + + + #### TODO авторегистрация на основе токенов \ No newline at end of file