Removing the last remnants of nomad and getting k3s setup
This commit is contained in:
parent
826d334c3c
commit
5b4a440cb4
@ -6,9 +6,9 @@
|
||||
- name: Apply the base role to the nuc
|
||||
ansible.builtin.include_role:
|
||||
name: base
|
||||
- name: Ensure nomad fixes are applied to the nuc
|
||||
- name: Apply the k3s base role
|
||||
ansible.builtin.include_role:
|
||||
name: nomad
|
||||
name: k3s
|
||||
- name: Apply the proxy role
|
||||
ansible.builtin.include_role:
|
||||
name: proxy
|
||||
|
@ -15,7 +15,7 @@
|
||||
become: true
|
||||
tags:
|
||||
- setup
|
||||
- name: Run through nomad installation steps
|
||||
- name: Run through nomad removal steps
|
||||
tags: nomad
|
||||
ansible.builtin.include_tasks:
|
||||
file: nomad.yaml
|
||||
|
@ -33,23 +33,22 @@
|
||||
- name: Install consul
|
||||
ansible.builtin.apt:
|
||||
name: consul
|
||||
state: absent
|
||||
- name: Install nomad package
|
||||
ansible.builtin.apt:
|
||||
pkg: nomad
|
||||
- name: Copy in the consul configuration
|
||||
vars:
|
||||
ip: "{{ ansible_default_ipv4['address'] }}"
|
||||
ansible.builtin.template:
|
||||
src: consul.hcl
|
||||
dest: /etc/consul.d/consul.hcl
|
||||
mode: "0644"
|
||||
state: absent
|
||||
- name: Remove the bare metal consul template
|
||||
ansible.builtin.file:
|
||||
path: /etc/consul.d/consul.hcl
|
||||
state: absent
|
||||
- name: Start nomad
|
||||
ansible.builtin.systemd_service:
|
||||
name: nomad
|
||||
state: started
|
||||
enabled: true
|
||||
state: stopped
|
||||
enabled: false
|
||||
- name: Make sure the consul service is NOT available
|
||||
ansible.builtin.systemd_service:
|
||||
name: consul
|
||||
state: stopped
|
||||
enabled: true
|
||||
enabled: false
|
||||
|
11
ansible/roles/k3s/tasks/main.yaml
Normal file
11
ansible/roles/k3s/tasks/main.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
- name: Download the installation script
|
||||
ansible.builtin.get_url:
|
||||
url: https://get.k3s.io
|
||||
dest: /tmp
|
||||
register: install_script
|
||||
- name: Run installation script
|
||||
become: true
|
||||
environment:
|
||||
INSTALL_K3S_EXEC: server
|
||||
ansible.builtin.command:
|
||||
cmd: sh {{ install_script.dest }}
|
0
ansible/roles/k3s/vars/main.yaml
Normal file
0
ansible/roles/k3s/vars/main.yaml
Normal file
Loading…
Reference in New Issue
Block a user