Skip to content

Commit ecd62c7

Browse files
committed
gitlab: Update molecule tests to catch missing become directives
Signed-off-by: Norman Ziegner <[email protected]>
1 parent 0fdb8a3 commit ecd62c7

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

molecule/gitlab/molecule.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ platforms:
1313
image: "${MOLECULE_IMAGE:-ghcr.io/hifis-net/ubuntu-systemd:24.04}"
1414
pre_build_image: true
1515
privileged: true
16-
systemd: "always"
16+
systemd: true
1717
tty: true
1818
override_command: false
1919
provisioner:
@@ -29,6 +29,7 @@ provisioner:
2929
inventory:
3030
host_vars:
3131
instancegitlab:
32+
ansible_user: "ansible"
3233
gitlab_edition: "gitlab-ce"
3334
gitlab_ip_range: "0.0.0.0/0"
3435
gitlab_additional_configurations:

molecule/gitlab/prepare.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
---
77
- name: "Prepare"
88
hosts: "all"
9+
become: true
910
tasks:
1011
- name: "Install depenencies for OS family RedHat"
1112
when:
@@ -21,20 +22,6 @@
2122
state: "present"
2223
update_cache: true
2324

24-
# Workaround to prevent "sudo: PAM account management error" because of non-readable shadows file on AlmaLinux
25-
- name: "Get file stats for /etc/shadow"
26-
ansible.builtin.stat:
27-
path: "/etc/shadow"
28-
register: "shadow"
29-
30-
- name: "Fix permissions for /etc/shadow"
31-
ansible.builtin.file:
32-
path: "/etc/shadow"
33-
owner: "root"
34-
group: "{{ shadow.stat.gr_name }}"
35-
mode: "0640"
36-
when: "not shadow.stat.rusr"
37-
3825
- name: "Install depenencies for OS family Debian"
3926
when: "ansible_facts.os_family == 'Debian'"
4027
block:

molecule/gitlab/verify.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
---
77
- name: "Verify"
88
hosts: "all"
9+
become: true
910
tasks:
1011
- name: "Gather package facts"
1112
ansible.builtin.package_facts:

0 commit comments

Comments
 (0)