Skip to content

Commit 4326f44

Browse files
committed
Renamed k3s_control_node_address -> k3s_registration_address
1 parent 85576d6 commit 4326f44

File tree

15 files changed

+53
-19
lines changed

15 files changed

+53
-19
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ vagrant/ubuntu-*.log
99
__pycache__
1010
ansible.cfg
1111
pyratlabs-issue-dump.txt
12+
.cache

CHANGELOG.md

+17
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@
1414
---
1515
-->
1616

17+
## 2021-03-14, v2.8.0
18+
19+
Happy π day!
20+
21+
### Notable changes
22+
23+
- Updated GitHub Actions, resolved linting errors.
24+
- Renamed `k3s_control_node_address` -> `k3s_registration_address`
25+
26+
### Breaking changes
27+
28+
- A task has been added to rename `k3s_control_node_address` to
29+
`k3s_registration_address` for any users still using this variable name,
30+
however this might still break something.
31+
32+
---
33+
1734
## 2021-02-28, v2.7.1
1835

1936
### Notable changes

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ consistency. These are generally cluster-level configuration.
6767
| `k3s_release_version` | Use a specific version of k3s, eg. `v0.2.0`. Specify `false` for stable. | `false` |
6868
| `k3s_config_file` | Location of the k3s configuration file. | `/etc/rancher/k3s/config.yaml` |
6969
| `k3s_build_cluster` | When multiple play hosts are available, attempt to cluster. Read notes below. | `true` |
70-
| `k3s_control_node_address` | Use a specific control node address. IP or FQDN. | NULL |
70+
| `k4s_registration_address` | Fixed registration address for nodes. IP or FQDN. | NULL |
7171
| `k3s_github_url` | Set the GitHub URL to install k3s from. | https://github.com/k3s-io/k3s |
7272
| `k3s_install_dir` | Installation directory for k3s. | `/usr/local/bin` |
7373
| `k3s_install_hard_links` | Install using hard links rather than symbolic links. | `false` |
@@ -314,7 +314,7 @@ stable release:
314314
```yaml
315315
- hosts: k3s_nodes
316316
vars:
317-
k3s_control_node_address: loadbalancer # Typically a load balancer.
317+
k3s_registration_address: loadbalancer # Typically a load balancer.
318318
k3s_server:
319319
datastore-endpoint: "postgres://postgres:verybadpass@database:5432/postgres?sslmode=disable"
320320
pre_tasks:

meta/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
galaxy_info:
44
role_name: k3s
5+
namespace: xanmanning
56
author: Xan Manning
67
description: Ansible role for installing k3s as either a standalone server or HA cluster
78
company: Pyrat Ltd.

molecule/highavailabilitydb/converge.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
become: true
66
vars:
77
molecule_is_test: true
8-
k3s_control_node_address: loadbalancer
8+
k3s_registration_address: loadbalancer
99
k3s_server:
1010
datastore-endpoint: "postgres://postgres:verybadpass@database:5432/postgres?sslmode=disable"
1111
pre_tasks:

tasks/build/configure-k3s-cluster.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@
7979
- import_tasks: ../validate/state/control-plane.yml
8080
when: not k3s_skip_validation
8181

82-
- meta: flush_handlers
82+
- name: Flush Handlers
83+
meta: flush_handlers
8384

8485
- import_tasks: ../validate/state/nodes.yml
8586
when: not k3s_skip_validation

tasks/build/docker/amazon/install.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
- restart docker
99
become: "{{ k3s_become_for_package_install | ternary(true, false, k3s_become_for_all) }}"
1010

11-
- meta: flush_handlers
11+
- name: Flush Handlers
12+
meta: flush_handlers

tasks/build/docker/archlinux/install.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
- restart docker
1313
become: "{{ k3s_become_for_package_install | ternary(true, false, k3s_become_for_all) }}"
1414

15-
- meta: flush_handlers
15+
- name: Flush Handlers
16+
meta: flush_handlers

tasks/build/docker/opensuse-leap/install.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
- restart docker
1313
become: "{{ k3s_become_for_package_install | ternary(true, false, k3s_become_for_all) }}"
1414

15-
- meta: flush_handlers
15+
- name: Flush Handlers
16+
meta: flush_handlers

tasks/build/docker/suse/install.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
- restart docker
1313
become: "{{ k3s_become_for_package_install | ternary(true, false, k3s_become_for_all) }}"
1414

15-
- meta: flush_handlers
15+
- name: Flush Handlers
16+
meta: flush_handlers

tasks/build/install-k3s.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
or (k3s_primary_control_node and k3s_controller_list | length > 1))
1212
- not ansible_check_mode
1313

14-
- meta: flush_handlers
14+
- name: Flush Handlers
15+
meta: flush_handlers
1516

1617
- include_tasks: install-k3s-node.yml
1718
when: k3s_build_cluster

tasks/build/preconfigure-k3s.yml

+13-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
k3s_build_cluster: false
66
when:
77
- ansible_play_hosts_all | length < 2
8-
- k3s_control_node_address is not defined
8+
- k3s_registration_address is not defined
99

1010
- name: Ensure k3s control node fact is set
1111
ansible.builtin.set_fact:
@@ -93,13 +93,21 @@
9393
check_mode: false
9494
when: k3s_control_delegate is not defined
9595

96-
- name: Ensure the control node address is registered in Ansible
96+
- name: Ensure the node registration address is defined from k3s_control_node_address
9797
ansible.builtin.set_fact:
98-
k3s_control_node_address: "{{ hostvars[k3s_control_delegate].ansible_host | default(hostvars[k3s_control_delegate].ansible_fqdn) }}"
98+
k3s_registration_address: "{{ k3s_control_node_address }}"
9999
check_mode: false
100-
when: k3s_control_node_address is not defined
100+
when: k3s_control_node_address is defined
101101

102-
when: k3s_control_node_address is not defined
102+
- name: Ensure the node registration address is defined
103+
ansible.builtin.set_fact:
104+
k3s_registration_address: "{{ hostvars[k3s_control_delegate].ansible_host | default(hostvars[k3s_control_delegate].ansible_fqdn) }}"
105+
check_mode: false
106+
when:
107+
- k3s_registration_address is not defined
108+
- k3s_control_node_address is not defined
109+
110+
when: k3s_registration_address is not defined
103111
or k3s_control_delegate is not defined
104112

105113
- name: Ensure k3s_runtime_config is set for control plane

tasks/state-installed.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
- ('docker' in k3s_runtime_config and k3s_runtime_config.docker)
3030
- ('rootless' not in k3s_runtime_config or not k3s_runtime_config.rootless)
3131

32-
- meta: flush_handlers
32+
- name: Flush Handlers
33+
meta: flush_handlers
3334

3435
- import_tasks: build/download-k3s.yml
3536

@@ -49,4 +50,4 @@
4950
when:
5051
- k3s_build_cluster is defined
5152
- k3s_build_cluster
52-
- k3s_control_node_address is defined
53+
- k3s_registration_address is defined

templates/k3s.service.j2

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ ExecStart={{ k3s_install_dir }}/k3s
2929
{% if k3s_control_node %}
3030
server
3131
{% if (k3s_etcd_datastore is defined and k3s_etcd_datastore) and (k3s_primary_control_node is not defined or not k3s_primary_control_node) and k3s_controller_list | length > 1 %}
32-
--server https://{{ k3s_control_node_address }}:{{ k3s_control_plane_port | default(6443) }}
32+
--server https://{{ k3s_registration_address }}:{{ k3s_control_plane_port | default(6443) }}
3333
--token-file {{ k3s_token_location }}
3434
{% endif %}
3535
{% if k3s_server is defined %}
3636
--config {{ k3s_config_file }}
3737
{% endif %}
3838
{% else %}
3939
agent
40-
--server https://{{ k3s_control_node_address }}:{{ k3s_control_plane_port | default(6443) }}
40+
--server https://{{ k3s_registration_address }}:{{ k3s_control_plane_port | default(6443) }}
4141
--token-file {{ k3s_token_location }}
4242
{% if k3s_agent is defined %}
4343
--config {{ k3s_config_file }}

vars/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ k3s_ensure_directories_exist:
107107
# Config items that should not appear in k3s_server or k3s_agent
108108
k3s_config_exclude:
109109
- setting: server
110-
correction: k3s_control_node_address
110+
correction: k3s_registration_address
111111
- setting: cluster-init
112112
correction: k3s_etcd_datastore
113113
- setting: token

0 commit comments

Comments
 (0)