Add ansible for k3s
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2022-02-19 20:11:28 +01:00
parent ecc308735c
commit f2c81dc9ac
10 changed files with 103 additions and 2 deletions

View File

@@ -0,0 +1,10 @@
---
- name: Download k3s binary x64
get_url:
url: https://github.com/k3s-io/k3s/releases/download/{{ k3s_version }}/k3s
checksum: sha256:https://github.com/k3s-io/k3s/releases/download/{{ k3s_version }}/sha256sum-amd64.txt
dest: /usr/local/bin/k3s
owner: root
group: root
mode: 0755
when: ansible_facts.architecture == "x86_64"

View File

@@ -0,0 +1,31 @@
---
- name: Enable IPv4 forwarding
sysctl:
name: net.ipv4.ip_forward
value: "1"
state: present
reload: yes
- name: Enable IPv6 forwarding
sysctl:
name: net.ipv6.conf.all.forwarding
value: "1"
state: present
reload: yes
when: ansible_all_ipv6_addresses
# Setup user
- name: Add the user 'kjuulh' and add it to 'sudo'
user:
name: kjuulh
group: sudo
state: present
- name: "add authorized keys"
authorized_key:
user: kjuulh
state: present
key: "{{ lookup('file', pub_key) }}"
- name: Wait for apt to unlock
shell: while sudo fuser /var/lib/dpkg/lock >/dev/null >2&1; do sleep 5; done;