diff --git a/ansible/roles/k3s-agent/tasks/main.yml b/ansible/roles/k3s-agent/tasks/main.yml index 1c4d5a3..284e6d9 100644 --- a/ansible/roles/k3s-agent/tasks/main.yml +++ b/ansible/roles/k3s-agent/tasks/main.yml @@ -1,4 +1,10 @@ --- +- name: Create empty k3s env file + copy: + content: "" + dest: /etc/systemd/system/k3s.service.env + force: no + - name: Install k3s agent service get_url: url: https://raw.githubusercontent.com/rancher/k3s/master/k3s.service diff --git a/ansible/roles/k3s-server/tasks/main.yml b/ansible/roles/k3s-server/tasks/main.yml index d0acd34..3a3f9b5 100644 --- a/ansible/roles/k3s-server/tasks/main.yml +++ b/ansible/roles/k3s-server/tasks/main.yml @@ -1,4 +1,10 @@ --- +- name: Create empty k3s env file + copy: + content: "" + dest: /etc/systemd/system/k3s.service.env + force: no + - name: Install k3s server service get_url: url: https://raw.githubusercontent.com/rancher/k3s/master/k3s.service diff --git a/ansible/site.yml b/ansible/site.yml index 61e1670..84ac517 100644 --- a/ansible/site.yml +++ b/ansible/site.yml @@ -1,7 +1,7 @@ --- - name: Provision k3s nodes hosts: k3s-server:k3s-agents - remote_user: pi + remote_user: "{{ ssh_user }}" become: yes become_user: root @@ -11,7 +11,7 @@ - name: Provision k3s server node hosts: k3s-server - remote_user: pi + remote_user: "{{ ssh_user }}" become: yes become_user: root @@ -20,7 +20,7 @@ - name: Get k3s server config for all nodes hosts: all - remote_user: pi + remote_user: "{{ ssh_user }}" become: yes become_user: root @@ -29,7 +29,7 @@ - name: Provision k3s agent nodes hosts: k3s-agents - remote_user: pi + remote_user: "{{ ssh_user }}" become: yes become_user: root