From 4030c8985d3efa63265847c252fe832eb93a7cad Mon Sep 17 00:00:00 2001 From: Besmir Zanaj Date: Feb 12 2020 22:01:14 +0000 Subject: fix cache_type variable check --- diff --git a/tasks/update-config-runner.yml b/tasks/update-config-runner.yml index e31f0b7..36c3718 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_type == 's3' else 'absent' }}" + state: "{{ 'present' if gitlab_runner.cache_type is defined else 'absent' }}" insertafter: '^\s*\[runners\.cache\]' backrefs: no check_mode: no @@ -225,7 +225,7 @@ backrefs: no check_mode: no notify: restart_gitlab_runner - when: gitlab_runner.cache_type == 's3' + when: gitlab_runner.cache_type is defined and gitlab_runner.cache_type == 's3' - name: Set cache s3 bucket location option lineinfile: @@ -261,7 +261,7 @@ backrefs: no check_mode: no notify: restart_gitlab_runner - when: gitlab_runner.cache_type == 'gcs' + when: gitlab_runner.cache_type is defined and gitlab_runner.cache_type == 'gcs' - name: Set cache gcs credentials file lineinfile: