fix getent_group not working

This commit is contained in:
2025-11-30 17:50:48 -06:00
parent 4e220486ff
commit 568efe9d89

View File

@@ -1,10 +1,10 @@
--- ---
## Checks/deploys a Linux system to be managed with Ansible. ## Checks/deploys a Linux system to be managed with Ansible.
- name: Gather all system groups # - name: Gather all system groups
ansible.builtin.getent: # ansible.builtin.getent:
database: group # database: group
split: ':' # split: ':'
# Add doas package # Add doas package
- name: Install doas (for Alpine systems). - name: Install doas (for Alpine systems).
@@ -23,7 +23,7 @@
name: ansible name: ansible
groups: wheel groups: wheel
append: yes append: yes
when: "'wheel' in ansible_facts.getent_group" # when: "'wheel' in ansible_facts.getent_group"
# Ansible user SSH pub key # Ansible user SSH pub key
# This is a really stupid way to do it, but alas. # This is a really stupid way to do it, but alas.
@@ -41,7 +41,6 @@
owner: ansible owner: ansible
group: ansible group: ansible
# Add required packages because Debian is lame
- name: Install standard packages if not already installed. - name: Install standard packages if not already installed.
# Looking at you LXCs. >.> # Looking at you LXCs. >.>
ansible.builtin.package: ansible.builtin.package:
@@ -74,7 +73,8 @@
name: nhadmin name: nhadmin
groups: wheel groups: wheel
append: yes append: yes
when: "'wheel' in ansible_facts.getent_group" # when: "'wheel' in ansible_facts.getent_group"
# Sysadmin user SSH pub key # Sysadmin user SSH pub key
# This is a really stupid way to do it, but alas. # This is a really stupid way to do it, but alas.
# This uses an environment variable named nhadmin_key in Semaphore which has the ssh-rsa pubkey. # This uses an environment variable named nhadmin_key in Semaphore which has the ssh-rsa pubkey.