Fix issues reported by ansible-lint
This commit is contained in:
parent
a90840b1dc
commit
2e100d290f
59 changed files with 315 additions and 244 deletions
|
@ -6,31 +6,35 @@
|
|||
- ci
|
||||
- forgejo-runner
|
||||
block:
|
||||
- import_tasks: steps/create-service-directory.yml
|
||||
- import_tasks: steps/template-docker-compose.yml
|
||||
- name: Import tasks to create service directory
|
||||
ansible.builtin.import_tasks: tasks/steps/create-service-directory.yml
|
||||
- name: Import tasks to template docker compose file
|
||||
ansible.builtin.import_tasks: tasks/steps/template-docker-compose.yml
|
||||
|
||||
- name: Copy the config
|
||||
ansible.builtin.copy:
|
||||
src: config.yml
|
||||
dest: "{{ (service_path, 'config.yml') | path_join }}"
|
||||
mode: '0755'
|
||||
mode: "0755"
|
||||
|
||||
- name: Check if service.env already exists
|
||||
ansible.builtin.stat:
|
||||
path: "{{ (service_path, 'service.env') | path_join }}"
|
||||
register: svc_env_file
|
||||
|
||||
- import_tasks: prompt-registration-token.yml
|
||||
when: not svc_env_file.stat.exists or
|
||||
force_forgejo_runner_registration | default(False)
|
||||
- name: Import tasks to prompt for the registration token
|
||||
ansible.builtin.import_tasks: tasks/prompt-registration-token.yml
|
||||
when: not svc_env_file.stat.exists or force_forgejo_runner_registration | default(False)
|
||||
|
||||
- import_tasks: steps/template-service-env.yml
|
||||
|
||||
- import_tasks: steps/start-service.yml
|
||||
- name: Import tasks create a service.env file
|
||||
ansible.builtin.import_tasks: tasks/steps/template-service-env.yml
|
||||
- name: Import start tasks for common service
|
||||
ansible.builtin.import_tasks: tasks/start-common-service.yml
|
||||
|
||||
- name: Register runner
|
||||
ansible.builtin.command:
|
||||
cmd: docker compose run --rm -it app sh -c 'forgejo-runner register --no-interactive --token ${FORGEJO_RUNNER_REGISTRATION_TOKEN} --instance ${FORGEJO_INSTANCE_URL}'
|
||||
cmd: docker compose run --rm -it app sh -c
|
||||
'forgejo-runner register --no-interactive --token ${FORGEJO_RUNNER_REGISTRATION_TOKEN} --instance ${FORGEJO_INSTANCE_URL}'
|
||||
chdir: "{{ service_path }}"
|
||||
when: not svc_env_file.stat.exists or
|
||||
force_forgejo_runner_registration | default(False)
|
||||
when: not svc_env_file.stat.exists or force_forgejo_runner_registration | default(False)
|
||||
changed_when: true # "when" checks enough. We are sure to change something here.
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
---
|
||||
- name: Input forgejo-runner registration token
|
||||
ansible.builtin.pause:
|
||||
prompt: "Enter a secret"
|
||||
echo: no
|
||||
prompt: Enter a secret
|
||||
echo: false
|
||||
register: promt_registration_token
|
||||
|
||||
- name: Put registration token into env vars
|
||||
ansible.builtin.set_fact:
|
||||
svc_env: "{{ svc_env | combine({
|
||||
'FORGEJO_RUNNER_REGISTRATION_TOKEN': promt_registration_token.user_input
|
||||
}, recursive=True) }}"
|
||||
svc_env: "{{ svc_env | combine({'FORGEJO_RUNNER_REGISTRATION_TOKEN': promt_registration_token.user_input}, recursive=True) }}"
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
---
|
||||
svc:
|
||||
name: forgejo-runner
|
||||
|
||||
svc_env:
|
||||
FORGEJO_INSTANCE_URL: "https://git.serguzim.me/"
|
||||
FORGEJO_INSTANCE_URL: https://git.serguzim.me/
|
||||
FORGEJO_RUNNER_REGISTRATION_TOKEN:
|
||||
DOCKER_HOST: tcp://docker-in-docker:2375
|
||||
|
||||
|
@ -17,7 +18,7 @@ compose:
|
|||
services:
|
||||
app:
|
||||
hostname: "{{ ansible_facts.hostname }}"
|
||||
command: "forgejo-runner --config /config/config.yml daemon"
|
||||
command: forgejo-runner --config /config/config.yml daemon
|
||||
depends_on:
|
||||
- docker-in-docker
|
||||
links:
|
||||
|
@ -25,7 +26,7 @@ compose:
|
|||
docker-in-docker:
|
||||
image: docker:dind
|
||||
privileged: true
|
||||
command: "dockerd -H tcp://0.0.0.0:2375 --tls=false"
|
||||
command: dockerd -H tcp://0.0.0.0:2375 --tls=false
|
||||
networks:
|
||||
default:
|
||||
volumes:
|
||||
|
|
Reference in a new issue