working on configuring a k3s cluster

This commit is contained in:
2022-08-02 09:42:08 -04:00
parent 31ed336880
commit 3a0f4a84b1
23 changed files with 562 additions and 37 deletions

View File

@@ -23,7 +23,7 @@
cmd: sh -s --
stdin: "{{ k3s_installer.content }}"
- name: Setup bash completion
ansible.builtin.shell:
cmd: "kubectl completion bash >/etc/bash_completion.d/kubectl"
creates: /etc/bash_completion.d/kubectl
#- name: Setup bash completion
# ansible.builtin.shell:
# cmd: "kubectl completion bash >/etc/bash_completion.d/kubectl"
# creates: /etc/bash_completion.d/kubectl

View File

@@ -0,0 +1,34 @@
---
#$ curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
#$ chmod 700 get_helm.sh
#$ ./get_helm.sh
- name: Install required packages
apt:
name: "{{ item }}"
update_cache: yes
cache_valid_time: 3600
state: latest
with_items:
- curl
- bash-completion
- name: Fetch helm install script
ansible.builtin.uri:
url: https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
return_content: yes
creates: /usr/local/bin/helm
register: helm_installer
- debug:
var: helm_installer
- name: Run installer
async: 300
poll: 10
ansible.builtin.shell:
cmd: bash -s --
stdin: "{{ helm_installer.content }}"
# creates: /usr/local/bin/helm
when: helm_installer.changed

View File

@@ -7,9 +7,12 @@
register: k3s_service
- include_tasks: install.yml
# when: not k3s_service.stat.exists
when: not k3s_service.stat.exists
- name: Start service k3s, if not started
ansible.builtin.service:
name: k3s
state: started
- include_tasks: install_helm.yml