Added variable local_user for user running playbook

Useful if tasks store data on the local machine
dehydrated
Felix Stupp 4 years ago
parent 192a9c8b86
commit 7e0df4abc5
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -2,6 +2,8 @@
TIMEZONE: "Europe/Berlin"
local_user: "{{ lookup('env','USER') }}"
global_username: zocker
ansible_user: "{{ global_username }}"

@ -8,15 +8,15 @@
file:
state: directory
path: "./facts"
owner: zocker
group: zocker
owner: "{{ local_user }}"
group: "{{ local_user }}"
mode: "u=rwx,g=rx,o=rx"
delegate_to: localhost
- name: Download facts to file
copy:
content: "{{ ansible_facts | to_nice_yaml(indent=2) }}"
dest: "./facts/{{ ansible_fqdn }}.yml"
owner: zocker
group: zocker
owner: "{{ local_user }}"
group: "{{ local_user }}"
mode: "u=rw,g=r,o=r"
delegate_to: localhost

@ -60,8 +60,8 @@
template:
src: "peer.cfg"
dest: "{{ global_wireguard_peers_directory }}/{{ inventory_hostname }}"
owner: zocker
group: zocker
owner: "{{ local_user }}"
group: "{{ local_user }}"
mode: "u=rw,g=r,o="
delegate_to: localhost

Loading…
Cancel
Save