diff --git a/tasks/update-config-runner.yml b/tasks/update-config-runner.yml index 61523a1..e31f0b7 100644 --- a/tasks/update-config-runner.yml +++ b/tasks/update-config-runner.yml @@ -130,7 +130,7 @@ dest: "{{ temp_runner_config.path }}" regexp: '^\s*\[runners\.cache\.s3\]' line: ' [runners.cache.s3]' - state: "{{ 'present' if gitlab_runner.cache_s3_server_address is defined else 'absent' }}" + state: "{{ 'present' if gitlab_runner.cache_type == 's3' else 'absent' }}" insertafter: '^\s*\[runners\.cache\]' backrefs: no check_mode: no @@ -225,6 +225,7 @@ backrefs: no check_mode: no notify: restart_gitlab_runner + when: gitlab_runner.cache_type == 's3' - name: Set cache s3 bucket location option lineinfile: @@ -260,6 +261,7 @@ backrefs: no check_mode: no notify: restart_gitlab_runner + when: gitlab_runner.cache_type == 'gcs' - name: Set cache gcs credentials file lineinfile: @@ -351,7 +353,6 @@ check_mode: no notify: restart_gitlab_runner - - name: Set builds dir file option lineinfile: dest: "{{ temp_runner_config.path }}"