+- set_fact:
+ system_group: "{% if ansible_facts.os_family == 'Debian' %}staff{% elif ansible_facts.os_family == 'RedHat' %}wheel{% endif %}"
+
- name: Setup /usr/local
become: true
file:
path: /usr/local
state: directory
owner: root
- group: staff
+ group: "{{ system_group }}"
recurse: yes
- name: Setup directories under /usr/local
become: true
- command: find /usr/local -type d -exec chown root.staff {} + -exec chmod ug+rwx,o+rx,g+s {} +
+ command: "find /usr/local -type d -exec chown root.{{ system_group }} {} + -exec chmod ug+rwx,o+rx,g+s {} +"
- name: Setup files under /usr/local
become: true
path: /usr/local/src
state: directory
owner: phd
- group: staff
+ group: "{{ system_group }}"
recurse: yes