Skip to content

Commit ce1a55f

Browse files
committed
gitlab: Add explicit become directives
Signed-off-by: Norman Ziegner <[email protected]>
1 parent 26386f4 commit ce1a55f

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

roles/gitlab/tasks/configure.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
---
77

88
- name: "Copy gitlab-secrets.json"
9+
become: true
910
ansible.builtin.copy:
1011
src: "{{ gitlab_secrets_file }}"
1112
dest: "/etc/gitlab/gitlab-secrets.json"
@@ -60,6 +61,7 @@
6061
- "Reconfigure Non Primary GitLab"
6162

6263
- name: "Create file to prevent Gitlab to restart before migrations"
64+
become: true
6365
ansible.builtin.copy:
6466
content: ""
6567
dest: "/etc/gitlab/skip-auto-reconfigure"
@@ -70,6 +72,7 @@
7072
when: "gitlab_is_primary"
7173

7274
- name: "Create file to prevent Gitlab to backup database"
75+
become: true
7376
ansible.builtin.copy:
7477
content: ""
7578
dest: "/etc/gitlab/skip-auto-backup"

roles/gitlab/tasks/feature-flag.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
---
77

88
- name: "Check if feature flag is already enabled for {{ gitlab_feature_flag.name }}"
9+
become: true
910
ansible.builtin.command:
1011
cmd: "gitlab-rails runner 'is_feature_enabled = Feature.enabled?(:{{ gitlab_feature_flag.name }}); puts is_feature_enabled'"
1112
register: "__gitlab_is_feature_enabled"
1213
changed_when: false
1314

1415
- name: "Enable or disable feature flag {{ gitlab_feature_flag.name }}"
16+
become: true
1517
ansible.builtin.command:
1618
cmd: "gitlab-rails runner 'Feature.{{ 'enable' if gitlab_feature_flag.enabled else 'disable' }}(:{{ gitlab_feature_flag.name }})'"
1719
changed_when: true

roles/gitlab/tasks/reconfigure.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
- "gitlab_is_primary"
3131

3232
- name: "Remove file that indicates a failed reconfigure"
33+
become: true
3334
ansible.builtin.file:
3435
path: "/etc/gitlab/reconfigure_failed"
3536
state: "absent"

0 commit comments

Comments
 (0)