Skip to content

Commit

Permalink
Merge pull request #16 from kysrpex/remap_user_single_task
Browse files Browse the repository at this point in the history
Unify remap user tasks from os_setup role
  • Loading branch information
kysrpex authored Nov 15, 2023
2 parents da11586 + 728f5ed commit 672561c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 67 deletions.
10 changes: 3 additions & 7 deletions roles/os_setup/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@
include_tasks: powertools.yml
when: enable_powertools

- name: Include remap_user task for RHEL8
include_tasks: remap_user/centos8.yml
when: enable_remap_user and ansible_os_family == "RedHat" and ansible_distribution_major_version == '8'

- name: Include remap_user task for RHEL9
include_tasks: remap_user/rhel9.yml
when: enable_remap_user and ansible_os_family == "RedHat" and ansible_distribution_major_version == '9'
- name: Include remap_user task
include_tasks: remap_user.yml
when: enable_remap_user and ansible_os_family == "RedHat"

- name: Create user task
include_tasks: create_user.yml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
# Rocky9 uses GID 999 and UID 999
# both of which we need to map to the galaxy user and group.

# RHEL uses GID 999 and UID 999, both of which need to be
# mapped to the galaxy user and group.

- name: Get all groups
getent:
Expand All @@ -18,9 +17,9 @@
- name: Check for GID 999 group
ansible.builtin.shell:
cmd: grep 999 /etc/group
ignore_errors: true
register: check_group
changed_when: false
failed_when: check_group.rc not in (0, 1)

- name: Print return information from the previous task
ansible.builtin.debug:
Expand Down Expand Up @@ -48,11 +47,11 @@
- name: Check for UID 999 in user file
ansible.builtin.shell:
cmd: grep 999 /etc/passwd
ignore_errors: true
register: check_user
changed_when: false
failed_when: check_user.rc not in (0, 1)

- name: Print return information from the previous task2
- name: Print return information from the previous task
ansible.builtin.debug:
var: check_user
when: debug
Expand Down
54 changes: 0 additions & 54 deletions roles/os_setup/tasks/remap_user/centos8.yml

This file was deleted.

0 comments on commit 672561c

Please sign in to comment.