Removing the last remnants of nomad and getting k3s setup
Some checks failed
Ansible Linting / ansible-lint (push) Failing after 3s
Secops Linting and Safety Checks / checkov-scan-s3 (push) Failing after 15s

This commit is contained in:
shockrah 2025-07-10 20:47:27 -07:00
parent 826d334c3c
commit 5b4a440cb4
5 changed files with 23 additions and 13 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View 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 }}

View File