diff --git a/group_vars/all/vars.yml b/group_vars/all/vars.yml index 4e0ed8e..cbead80 100644 --- a/group_vars/all/vars.yml +++ b/group_vars/all/vars.yml @@ -2,6 +2,8 @@ TIMEZONE: "Europe/Berlin" +local_user: "{{ lookup('env','USER') }}" + global_username: zocker ansible_user: "{{ global_username }}" diff --git a/playbooks/store-facts.yml b/playbooks/store-facts.yml index bef0844..4528af3 100644 --- a/playbooks/store-facts.yml +++ b/playbooks/store-facts.yml @@ -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 diff --git a/roles/wireguard/application/tasks/main.yml b/roles/wireguard/application/tasks/main.yml index 2def39c..c24424e 100644 --- a/roles/wireguard/application/tasks/main.yml +++ b/roles/wireguard/application/tasks/main.yml @@ -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