myos/ansible/roles/hosts/tasks/groups.yml

18 lines
434 B
YAML
Raw Normal View History

2021-07-12 21:04:06 +02:00
---
2021-07-14 21:38:30 +02:00
# file: tasks/groups.yml
2021-07-12 21:04:06 +02:00
2022-10-13 02:52:38 +02:00
- name: groups - remove floppy group - alpine
when: ansible_os_family|lower == "alpine"
group: gid="11" name="floppy" state="absent"
become: yes
2021-07-14 21:38:30 +02:00
- name: groups - create dns group
2021-07-12 21:04:06 +02:00
group: gid="11" name="dns" state="present" system="yes"
become: yes
2021-07-14 21:38:30 +02:00
- name: groups - add me to the dns group
2022-10-13 02:52:38 +02:00
when: ansible_user_uid != "0"
2021-07-12 21:04:06 +02:00
user: name="{{ansible_user_id}}" groups=dns append=yes
become: yes
2021-07-14 21:38:30 +02:00