infra-ansible

ansible script to ship alpine/ssh/wireguard

git clone https://9o.is/git/infra-ansible.git

commit f4ee787cd03fdfea52af8079ed04acf5c55fcaa4
parent 96fde2c3ed1b03a0fe4b79ae174e53555dd335a8
Author: Jul <jul@9o.is>
Date:   Thu, 16 May 2024 03:07:44 +0800

Revert "install latest k0s stable version"

This reverts commit 6188690605e089e06c41cd17cd2cbbd160abcb15.

Diffstat:
Mhost/group_vars/all | 1+
Mhost/roles/k0s/tasks/prepare.yml | 12++++--------
2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/host/group_vars/all b/host/group_vars/all @@ -1,4 +1,5 @@ wireguard_port: 62620 +k0s_version: v1.30.0+k0s.0 wg_client_ip: 10.0.0.2 wg_client_public_key: ZlBc9LbWP4CBm/9aIbZ2dwPZQbkYdvi7TZimAo5czWk= diff --git a/host/roles/k0s/tasks/prepare.yml b/host/roles/k0s/tasks/prepare.yml @@ -6,22 +6,18 @@ path: '{{ k0s_distros }}' state: directory -- name: Get stable version - command: curl https://docs.k0sproject.io/stable.txt - register: k0s_version - -- name: Download k0s binary k0s-{{ k0s_version.stdout }}-amd64 +- name: Download k0s binary k0s-{{ k0s_version }}-amd64 delegate_to: localhost become: false get_url: - url: https://github.com/k0sproject/k0s/releases/download/{{ k0s_version.stdout }}/k0s-{{ k0s_version.stdout }}-amd64 + url: https://github.com/k0sproject/k0s/releases/download/{{ k0s_version }}/k0s-{{ k0s_version }}-amd64 dest: '{{ k0s_distros }}' - when: item == 'x86_64' and not (k0s_distros + '/k0s-' + k0s_version.stdout + '-amd64') is exists + when: item == 'x86_64' and not (k0s_distros + '/k0s-' + k0s_version + '-amd64') is exists with_items: '{{ ansible_facts.architecture }}' - name: Upload k0s binary copy: - src: '{{ k0s_distros }}/k0s-{{ k0s_version.stdout }}-amd64' + src: '{{ k0s_distros }}/k0s-{{ k0s_version }}-amd64' dest: '/usr/local/bin/k0s' owner: root group: root