]> git.phdru.name Git - ansible.git/blobdiff - playbooks/roles/init-system2/tasks/main.yml
Feat: Combine Debian/RedHat playbooks and roles
[ansible.git] / playbooks / roles / init-system2 / tasks / main.yml
similarity index 57%
rename from playbooks/debian/roles/init-system2/tasks/main.yml
rename to playbooks/roles/init-system2/tasks/main.yml
index 48897d9a6b516f5a866cb28f39ead3b00cab26fb..c2e4a87188c77399a0629359e1c27bba4d1af320 100644 (file)
@@ -1,15 +1,18 @@
+- 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
@@ -21,5 +24,5 @@
     path: /usr/local/src
     state: directory
     owner: phd
-    group: staff
+    group: "{{ system_group }}"
     recurse: yes