feat: changed lxc to vm in k3s
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
---
|
||||
- name: Configure cloud-init - IP
|
||||
ansible.builtin.command: qm set "{{ k3s_vmid }}" --ipconfig0 ip="{{ k3s_vm_host }}"/21,gw=10.0.0.1
|
||||
|
||||
- name: Configure cloud-init - User
|
||||
ansible.builtin.command: qm set "{{ k3s_vmid }}" --ciuser "root"
|
||||
|
||||
- name: Configure cloud-init - Password
|
||||
ansible.builtin.command: qm set "{{ k3s_vmid }}" --cipassword "{{ ansible_ssh_pass }}"
|
||||
|
||||
- name: Copy SSH Pub key
|
||||
ansible.builtin.copy:
|
||||
src: ~/.ssh/id_rsa.pub
|
||||
dest: /tmp/ansible_controller-key.pub
|
||||
mode: 0600
|
||||
|
||||
- name: Configure cloud-init - SSH Key
|
||||
ansible.builtin.command: qm set "{{ k3s_vmid }}" --sshkey /tmp/ansible_controller-key.pub
|
||||
|
||||
- name: Configure networking
|
||||
ansible.builtin.command: qm set "{{ k3s_vmid }}" --net0 virtio={{ k3s_mac_addr }},bridge=vmbr0
|
||||
Reference in New Issue
Block a user