mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2025-12-25 18:23:05 +01:00
Do not rely on ansible_user (#214)
* Apply "become" on roles instead of plays This leads to facts being gathered for the "regular" login user, instead of root. * Do not rely on ansible_user Instead of reading ansible_user (which may or may not be defined), this patch lets the roles rely on Ansible facts [1]. [1]: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
file:
|
||||
path: /tmp/k3s
|
||||
state: directory
|
||||
owner: "{{ ansible_user }}"
|
||||
owner: "{{ ansible_user_id }}"
|
||||
mode: 0755
|
||||
with_items: "{{ groups['master'] }}"
|
||||
run_once: true
|
||||
@@ -12,7 +12,7 @@
|
||||
template:
|
||||
src: "metallb.crs.j2"
|
||||
dest: "/tmp/k3s/metallb-crs.yaml"
|
||||
owner: "{{ ansible_user }}"
|
||||
owner: "{{ ansible_user_id }}"
|
||||
mode: 0755
|
||||
with_items: "{{ groups['master'] }}"
|
||||
run_once: true
|
||||
|
||||
Reference in New Issue
Block a user