Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify remap user tasks from os_setup role #16

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading