]> git.phdru.name Git - ansible.git/blob - playbooks/roles/setup-usrlocal/tasks/main.yml
c2e4a87188c77399a0629359e1c27bba4d1af320
[ansible.git] / playbooks / roles / setup-usrlocal / tasks / main.yml
1 - set_fact:
2     system_group: "{% if ansible_facts.os_family == 'Debian' %}staff{% elif ansible_facts.os_family == 'RedHat' %}wheel{% endif %}"
3
4 - name: Setup /usr/local
5   become: true
6   file:
7     path: /usr/local
8     state: directory
9     owner: root
10     group: "{{ system_group }}"
11     recurse: yes
12
13 - name: Setup directories under /usr/local
14   become: true
15   command: "find /usr/local -type d -exec chown root.{{ system_group }} {} + -exec chmod ug+rwx,o+rx,g+s {} +"
16
17 - name: Setup files under /usr/local
18   become: true
19   command: find /usr/local -type f -exec chmod ug+rwX,o+rX {} +
20
21 - name: Setup /usr/local/src
22   become: true
23   file:
24     path: /usr/local/src
25     state: directory
26     owner: phd
27     group: "{{ system_group }}"
28     recurse: yes