From ef99954177fd7263dd7a5eb354bc945b0f65c577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=97=AA=D1=94=CE=BD=CE=B9=CE=B7=20=E1=97=B7=CF=85=D0=BD?= =?UTF-8?q?=CA=9F?= Date: Tue, 25 May 2021 18:38:07 -0400 Subject: [PATCH 1/4] fix: only deploy k3s_server_manifests_dir on primary controller --- tasks/build/preconfigure-k3s-auto-deploying-manifests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/build/preconfigure-k3s-auto-deploying-manifests.yml b/tasks/build/preconfigure-k3s-auto-deploying-manifests.yml index 82b246d..604a4e0 100644 --- a/tasks/build/preconfigure-k3s-auto-deploying-manifests.yml +++ b/tasks/build/preconfigure-k3s-auto-deploying-manifests.yml @@ -9,7 +9,8 @@ become: "{{ k3s_become_for_directory_creation | ternary(true, false, k3s_become_for_all) }}" # https://rancher.com/docs/k3s/latest/en/advanced/#auto-deploying-manifests -- name: Ensure auto-deploying manifests are copied to controllers +- name: Ensure auto-deploying manifests are copied to the primary controller + run_once: true ansible.builtin.template: src: "{{ item }}" dest: "{{ k3s_server_manifests_dir }}/{{ item | basename | replace('.j2','') }}" From 2243766695343c45d1c0e4de0046a0a92db22a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=97=AA=D1=94=CE=BD=CE=B9=CE=B7=20=E1=97=B7=CF=85=D0=BD?= =?UTF-8?q?=CA=9F?= Date: Tue, 25 May 2021 18:39:48 -0400 Subject: [PATCH 2/4] fix: k3s_primary_control_node --- tasks/state-installed.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/state-installed.yml b/tasks/state-installed.yml index 81595f5..b17fd4c 100644 --- a/tasks/state-installed.yml +++ b/tasks/state-installed.yml @@ -36,7 +36,7 @@ - import_tasks: build/preconfigure-k3s-auto-deploying-manifests.yml when: - - k3s_control_node + - k3s_primary_control_node - k3s_server_manifests_templates | length > 0 - import_tasks: build/install-k3s.yml From 07fe0e29642902586936fa42e93e0f5f3bb5f2a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=97=AA=D1=94=CE=BD=CE=B9=CE=B7=20=E1=97=B7=CF=85=D0=BD?= =?UTF-8?q?=CA=9F?= Date: Tue, 25 May 2021 18:43:32 -0400 Subject: [PATCH 3/4] fix: update readme --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index d73b53d..8c49db9 100644 --- a/README.md +++ b/README.md @@ -61,22 +61,22 @@ below. Below are variables that are set against all of the play hosts for environment consistency. These are generally cluster-level configuration. -| Variable | Description | Default Value | -|----------------------------------|---------------------------------------------------------------------------------|--------------------------------| -| `k3s_state` | State of k3s: installed, started, stopped, downloaded, uninstalled, validated. | installed | -| `k3s_release_version` | Use a specific version of k3s, eg. `v0.2.0`. Specify `false` for stable. | `false` | -| `k3s_config_file` | Location of the k3s configuration file. | `/etc/rancher/k3s/config.yaml` | -| `k3s_build_cluster` | When multiple play hosts are available, attempt to cluster. Read notes below. | `true` | -| `k3s_registration_address` | Fixed registration address for nodes. IP or FQDN. | NULL | -| `k3s_github_url` | Set the GitHub URL to install k3s from. | https://github.com/k3s-io/k3s | -| `k3s_install_dir` | Installation directory for k3s. | `/usr/local/bin` | -| `k3s_install_hard_links` | Install using hard links rather than symbolic links. | `false` | -| `k3s_server_manifests_templates` | A list of Auto-Deploying Manifests Templates. | [] | -| `k3s_use_experimental` | Allow the use of experimental features in k3s. | `false` | -| `k3s_use_unsupported_config` | Allow the use of unsupported configurations in k3s. | `false` | -| `k3s_etcd_datastore` | Enable etcd embedded datastore (read notes below). | `false` | -| `k3s_debug` | Enable debug logging on the k3s service. | `false` | -| `k3s_registries` | Registries configuration file content. | `{ mirrors: {}, configs:{} }` | +| Variable | Description | Default Value | +|----------------------------------|------------------------------------------------------------------------------------|--------------------------------| +| `k3s_state` | State of k3s: installed, started, stopped, downloaded, uninstalled, validated. | installed | +| `k3s_release_version` | Use a specific version of k3s, eg. `v0.2.0`. Specify `false` for stable. | `false` | +| `k3s_config_file` | Location of the k3s configuration file. | `/etc/rancher/k3s/config.yaml` | +| `k3s_build_cluster` | When multiple play hosts are available, attempt to cluster. Read notes below. | `true` | +| `k3s_registration_address` | Fixed registration address for nodes. IP or FQDN. | NULL | +| `k3s_github_url` | Set the GitHub URL to install k3s from. | https://github.com/k3s-io/k3s | +| `k3s_install_dir` | Installation directory for k3s. | `/usr/local/bin` | +| `k3s_install_hard_links` | Install using hard links rather than symbolic links. | `false` | +| `k3s_server_manifests_templates` | A list of Auto-Deploying Manifests Templates (only deploys on primary controller). | [] | +| `k3s_use_experimental` | Allow the use of experimental features in k3s. | `false` | +| `k3s_use_unsupported_config` | Allow the use of unsupported configurations in k3s. | `false` | +| `k3s_etcd_datastore` | Enable etcd embedded datastore (read notes below). | `false` | +| `k3s_debug` | Enable debug logging on the k3s service. | `false` | +| `k3s_registries` | Registries configuration file content. | `{ mirrors: {}, configs:{} }` | ### K3S Service Configuration From 82085cb80b396b818ce1a1dca4e00cab8e035823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=97=AA=D1=94=CE=BD=CE=B9=CE=B7=20=E1=97=B7=CF=85=D0=BD?= =?UTF-8?q?=CA=9F?= Date: Tue, 25 May 2021 19:23:13 -0400 Subject: [PATCH 4/4] fix: remove run_once --- tasks/build/preconfigure-k3s-auto-deploying-manifests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/tasks/build/preconfigure-k3s-auto-deploying-manifests.yml b/tasks/build/preconfigure-k3s-auto-deploying-manifests.yml index 604a4e0..eb90a01 100644 --- a/tasks/build/preconfigure-k3s-auto-deploying-manifests.yml +++ b/tasks/build/preconfigure-k3s-auto-deploying-manifests.yml @@ -10,7 +10,6 @@ # https://rancher.com/docs/k3s/latest/en/advanced/#auto-deploying-manifests - name: Ensure auto-deploying manifests are copied to the primary controller - run_once: true ansible.builtin.template: src: "{{ item }}" dest: "{{ k3s_server_manifests_dir }}/{{ item | basename | replace('.j2','') }}"