Fix issues reported by ansible-lint (var prefixes)
This commit is contained in:
parent
0f9e4544b0
commit
39fd6ef5a2
24 changed files with 86 additions and 86 deletions
|
|
@ -1,7 +1,6 @@
|
|||
---
|
||||
forgejo_runner_env:
|
||||
FORGEJO_INSTANCE_URL: https://git.serguzim.me/
|
||||
FORGEJO_RUNNER_REGISTRATION_TOKEN:
|
||||
DOCKER_HOST: tcp://docker-in-docker:2375
|
||||
|
||||
forgejo_runner_compose:
|
||||
|
|
|
|||
|
|
@ -21,21 +21,14 @@
|
|||
- name: Check if .env already exists
|
||||
ansible.builtin.stat:
|
||||
path: "{{ (service_path, '.env') | path_join }}"
|
||||
register: env_file
|
||||
|
||||
- name: Import tasks to prompt for the registration token
|
||||
ansible.builtin.import_tasks: tasks/prompt-registration-token.yml
|
||||
when: not env_file.stat.exists or force_forgejo_runner_registration | default(False)
|
||||
register: forgejo_runner_env_file
|
||||
|
||||
- name: Import tasks create a .env file
|
||||
ansible.builtin.import_tasks: tasks/steps/template-service-env.yml
|
||||
|
||||
- name: Import tasks to prompt for the registration token
|
||||
ansible.builtin.import_tasks: tasks/prompt-registration-token.yml
|
||||
when: not forgejo_runner_env_file.stat.exists or force_forgejo_runner_registration | default(False)
|
||||
|
||||
- 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}'
|
||||
chdir: "{{ service_path }}"
|
||||
when: not env_file.stat.exists or force_forgejo_runner_registration | default(False)
|
||||
changed_when: true # "when" checks enough. We are sure to change something here.
|
||||
|
|
|
|||
|
|
@ -3,8 +3,11 @@
|
|||
ansible.builtin.pause:
|
||||
prompt: Enter a secret
|
||||
echo: false
|
||||
register: promt_registration_token
|
||||
register: forgejo_runner_promt_registration_token
|
||||
|
||||
- name: Put registration token into env vars
|
||||
ansible.builtin.set_fact:
|
||||
forgejo_runner_env: "{{ forgejo_runner_env | combine({'FORGEJO_RUNNER_REGISTRATION_TOKEN': promt_registration_token.user_input}, recursive=True) }}"
|
||||
- name: Register runner
|
||||
ansible.builtin.command:
|
||||
cmd: docker compose run --rm -it app sh -c
|
||||
'forgejo-runner register --no-interactive --token {{ forgejo_runner_promt_registration_token.user_input }} --instance ${FORGEJO_INSTANCE_URL}'
|
||||
chdir: "{{ service_path }}"
|
||||
changed_when: true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue