k3s-ansible
k3s-ansible copied to clipboard
Please rename master and node with k3s_master and k3s_node
When using this in a complex configuration is rather confusing to have "master" and "node" in the host group since they might not refer to k3s, would be nice to have k3s_master and k3s_node used instead. I easily changed the role to work like this but i think it should be brought upstream.
I would prefer to have these be default variables that could be overridden.
Here's an example from a recent playbook I wrote
# roles/hostname/tasks/main.yml
- name: Add all hosts to /etc/hosts
become: true
lineinfile:
dest: "/etc/hosts"
line: "{{ hostvars[item]['ansible_host'] }} {{ item }} "
regexp: "{{ hostvars[item]['ansible_host'] }}"
state: present
loop: "{{ groups[cockroach_group] }}"
tags:
- test
# inventory/main.yml
all:
children:
cr_nodes:
vars:
cockroach_group: cr_nodes
hosts:
roach01:
roach02:
roach03:
I don't think adding things in the /etc/hosts file is a good idea but that's out of scope ^^ What is the rational behind the wontfix @itwars ?
With the HA PR this has been reworked so the names are now correctly server and agent which K3s uses now.