k3s-ansible icon indicating copy to clipboard operation
k3s-ansible copied to clipboard

Please rename master and node with k3s_master and k3s_node

Open johnuopini opened this issue 4 years ago • 2 comments

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.

johnuopini avatar Dec 03 '20 09:12 johnuopini

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:

senorsmile avatar Apr 08 '21 11:04 senorsmile

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 ?

St0rmingBr4in avatar Apr 21 '21 22:04 St0rmingBr4in

With the HA PR this has been reworked so the names are now correctly server and agent which K3s uses now.

dereknola avatar Nov 09 '23 17:11 dereknola