Debian Codegraph @

test/integration/targets/become_unprivileged/common_remote_group/setup.yml

raw
1 - name: Prep (as root)
2 hosts: ssh
3 gather_facts: yes
4 remote_user: root
5 tasks:
6 - name: Create group for unprivileged users
7 group:
8 name: commongroup
9
10 - name: Add them to the group
11 user:
12 name: "{{ item }}"
13 groups: commongroup
14 append: yes
15 with_items:
16 - unpriv1
17 - unpriv2
18
19 - name: Check if /usr/bin/setfacl exists
20 stat:
21 path: /usr/bin/setfacl
22 register: usr_bin_setfacl
23
24 - name: Check if /bin/setfacl exists
25 stat:
26 path: /bin/setfacl
27 register: bin_setfacl
28
29 - name: Set path to setfacl
30 set_fact:
31 setfacl_path: /usr/bin/setfacl
32 when: usr_bin_setfacl.stat.exists
33
34 - name: Set path to setfacl
35 set_fact:
36 setfacl_path: /bin/setfacl
37 when: bin_setfacl.stat.exists
38
39 - name: chmod -x setfacl to disable it
40 file:
41 path: "{{ setfacl_path }}"
42 mode: a-x
43 when: setfacl_path is defined