-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreset.yml
30 lines (27 loc) · 828 Bytes
/
reset.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
- name: Setting variables based on key/value pairs in dict
hosts: localhost
gather_facts: false
tasks:
- name: Before
debug:
msg:
etc_pamd_root: "{{ etc_pamd_root | default('not set') }}"
etc_pamd_files: "{{ etc_pamd_root | default('not set') }}"
- name: dict2items
debug:
msg: "{{ path_vars | dict2items }}"
- name: Copy
set_fact:
"{{ item.key }}": "{{ item.value }}"
loop: "{{ path_vars | dict2items }}"
- name: After
debug:
msg:
etc_pamd_root: "{{ etc_pamd_root | default('not set') }}"
etc_pamd_files: "{{ etc_pamd_files | default('not set') }}"
vars:
path_vars:
etc_pamd_root: '/etc/pam.d'
etc_pamd_files:
- '/etc/pam.d/password-auth'
- '/etc/pam.d/system-auth'