+- 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: "{{ system_group }}"
+ recurse: yes
+
+- name: Setup directories under /usr/local
+ become: true
+ 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
+ command: find /usr/local -type f -exec chmod ug+rwX,o+rX {} +
+
+- name: Setup /usr/local/src
+ become: true
+ file:
+ path: /usr/local/src
+ state: directory
+ owner: phd
+ group: "{{ system_group }}"
+ recurse: yes