full install of k3s is working
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Adrien Reslinger 2020-10-17 01:53:34 +02:00
parent 1ec1ebb89d
commit d341a283a0
2 changed files with 13 additions and 7 deletions

View file

@ -1,4 +1,10 @@
--- ---
- name: Install Wireguard
include_role:
name: wireguard
# when:
# - kubernetes_cni == "wireguard"
- name: Check if /usr/local/bin/k3s already existe - name: Check if /usr/local/bin/k3s already existe
stat: stat:
path: /usr/local/bin/k3s path: /usr/local/bin/k3s
@ -13,7 +19,7 @@
owner: root owner: root
mode: 0755 mode: 0755
when: when:
- k3s_bin.stat.exists - not k3s_bin.stat.exists
- ansible_machine == "x86_64" - ansible_machine == "x86_64"
- name: retreive k3s binary for arm64 - name: retreive k3s binary for arm64
@ -24,7 +30,7 @@
owner: root owner: root
mode: 0755 mode: 0755
when: when:
- k3s_bin.stat.exists - not k3s_bin.stat.exists
- ansible_machine == "arm64" - ansible_machine == "arm64"
- name: retreive k3s binary for armv6/armv7 - name: retreive k3s binary for armv6/armv7
@ -35,7 +41,7 @@
owner: root owner: root
mode: 0755 mode: 0755
when: when:
- k3s_bin.stat.exists - not k3s_bin.stat.exists
- (ansible_machine == "armv7l") or (ansible_machine == "armv6l") - (ansible_machine == "armv7l") or (ansible_machine == "armv6l")
- name: Create tools link - name: Create tools link
@ -72,14 +78,14 @@
thinpool: kubernetes thinpool: kubernetes
size: "{{ item.size }}" size: "{{ item.size }}"
with_items: with_items:
- { name: var_lib_k3s, vg: vg_sys, size: 10g, mount_point: /var/lib/rancher/k3s} - { name: var_lib_k3s, vg: vg_sys, size: 10g, mount_point: /var/lib/rancher/k3s, mount_opts: "discard"}
- name: create file system on containerd lv - name: create file system on containerd lv
filesystem: filesystem:
fstype: ext4 fstype: ext4
dev: "/dev/{{ item.vg }}/{{ item.name }}" dev: "/dev/{{ item.vg }}/{{ item.name }}"
with_items: with_items:
- { name: var_lib_k3s, vg: vg_sys, size: 10g, mount_point: /var/lib/rancher/k3s} - { name: var_lib_k3s, vg: vg_sys, size: 10g, mount_point: /var/lib/rancher/k3s, mount_opts: "discard"}
- name: mount logical volumes - name: mount logical volumes
mount: mount:
@ -89,7 +95,7 @@
opts: "{{ item.mount_opts }}" opts: "{{ item.mount_opts }}"
state: mounted state: mounted
with_items: with_items:
- { name: var_lib_k3s, vg: vg_sys, size: 10g, mount_point: /var/lib/rancher/k3s} - { name: var_lib_k3s, vg: vg_sys, size: 10g, mount_point: /var/lib/rancher/k3s, mount_opts: "discard"}
- name: Enable k3s on boot - name: Enable k3s on boot
service: service:

View file

@ -1,3 +1,3 @@
{% if kubernetes_master|bool %} {% if not kubernetes_master|bool %}
NODE_TOKEN={{ kubernetes_server_token }} NODE_TOKEN={{ kubernetes_server_token }}
{% endif %} {% endif %}