Adjust for FreeBSD root group being wheel.

This commit is contained in:
Hyperling 2021-01-31 13:11:40 -06:00
parent 81d59aabb3
commit 319a717e68
3 changed files with 22 additions and 4 deletions

17
facts/user_names.yml Normal file
View File

@ -0,0 +1,17 @@
---
# Define users and groups for each OS
- name: Set Linux User Variables
ansible.builtin.set_fact:
root: root
root_group: root
ansible: ansible
when: ansible_distribution == "Pop!_OS" or
ansible_distribution == "Ubuntu"
- name: Set FreeBSD User Variables
ansible.builtin.set_fact:
root: root
root_group: wheel
ansible: ansible
when: ansible_distribution == "FreeBSD"

View File

@ -11,11 +11,12 @@
- include: facts/filesystem_names.yml
- include: facts/package_names.yml
- include: facts/service_names.yml
- include: facts/user_names.yml
tasks:
- include: tasks/packages.yml
- include: tasks/users.yml
- include: tasks/cron.yml
- include: tasks/packages.yml
- include: tasks/harden.yml

View File

@ -8,13 +8,13 @@
- name: Create Ansible User
user:
name: ansible
name: "{{ ansible }}"
system: yes
- name: Add Ansible Sudoers File
copy:
src: sudoers_ansible
dest: "{{ sudoers_install_dir }}"
owner: root
group: root
owner: "{{ root }}"
group: "{{ root_group }}"
mode: 0440