From b29f827d9e309f9819e35cbabeee759befac0dae Mon Sep 17 00:00:00 2001 From: Adam Leiner Date: Tue, 28 Jan 2025 08:50:54 -0500 Subject: [PATCH] updating documentation --- roles/rke2/defaults/main.yml | 92 +++++++++++++++++---- roles/rke2/tasks/NOT_USED_cluster_state.yml | 66 --------------- terraform.tfstate | 9 ++ 3 files changed, 83 insertions(+), 84 deletions(-) delete mode 100644 roles/rke2/tasks/NOT_USED_cluster_state.yml create mode 100644 terraform.tfstate diff --git a/roles/rke2/defaults/main.yml b/roles/rke2/defaults/main.yml index 8828a7fa..854f88d6 100644 --- a/roles/rke2/defaults/main.yml +++ b/roles/rke2/defaults/main.yml @@ -1,19 +1,19 @@ --- -rke2_kubernetes_api_server_host: "" -rke2_tarball_install_dir: "/usr/local" -rke2_install_local_tarball_path: "" -rke2_install_tarball_url: "" -rke2_images_urls: [] -rke2_images_local_tarball_path: [] -rke2_channel: "stable" -rke2_audit_policy_config_file_path: "" -rke2_registry_config_file_path: "" -rke2_pod_security_admission_config_file_path: "" -rke2_add_iptables_rules: false -rke2_manifest_config_directory: "" -rke2_manifest_config_post_run_directory: "" -rke2_force_tarball_install: false + +# Variables shown below include their default values. Please override via groupvars as necessary. + +# Installation: + +## Specific version of RKE2 you wish to install. Blank defaults to latest and requires an Internet connection. rke2_install_version: "" + +## When using Internet to install RKE2, which repositories should be searched (stable or latest) +rke2_channel: "stable" + +## RPM Install Specific Variables + +### These two repos can point to the same 'baseurl' all of the RPMs are in the same repo. +### Common YUM repo that contains RKE2 SELinux. rke2_common_yum_repo: name: rancher-rke2-common description: "Rancher RKE2 Common Latest" @@ -22,6 +22,7 @@ rke2_common_yum_repo: gpgkey: "https://rpm.rancher.io/public.key" enabled: true +### Versioned YUM repo that contains RKE2 Server, Agent, and Common RPMs. rke2_versioned_yum_repo: name: "rancher-rke2-v{{ rke2_version_majmin }}" # noqa jinja[spacing] description: "Rancher RKE2 Version" @@ -29,9 +30,65 @@ rke2_versioned_yum_repo: gpgcheck: true gpgkey: "https://rpm.rancher.io/public.key" enabled: true -rke2_kubelet_node_name: - - "nodeNameNotFound" -rke2_config: {} + +## Tarball Install Specific Variables: + +### If installing via Tarball, the location to extract the contents. +rke2_tarball_install_dir: "/usr/local" + +### Path, local to Ansible control host, where the install Tarball can be found. If installing on a RPM-based OS, this will override the RPM install and force a Tarball install. +rke2_install_local_tarball_path: "" + +### #URL where the install Tarball can be found. If installing on a RPM-based OS, this will override the RPM install and force a Tarball install. +rke2_install_tarball_url: "" + +### RHEL-based OS's default to RPMs for installation, set to 'true' to force ansible to use a tarball. Designed for use on an Internet connected system where you want to use the Tarball available from the GitHub. +rke2_force_tarball_install: false + +## Images to load directly into RKE2 via agent/images directory: + +### URL of image tarball. +rke2_images_urls: [] + +### Path, local to Ansible control host, where an image Tarball can be found. +rke2_images_local_tarball_path: [] + +# Configuration: + +## Defines common RKE2 config options for the whole cluster. +cluster_rke2_config: {} + +## Defines common RKE2 config options for the server or agent group. +group_rke2_config: {} + +## Defines RKE2 config options for a specific server or agent node +host_rke2_config: {} + +## API Address for Cluster if behind Loadbalancer or Virtual IP. +rke2_kubernetes_api_server_host: "" + +## Path, local to Ansible control host, where audit policy can be found. +rke2_audit_policy_config_file_path: "" + +## Path, local to Ansible control host, where registries config can be found. +rke2_registry_config_file_path: "" + +## Path, local to Ansible control host, where PSA policy can be found. +rke2_pod_security_admission_config_file_path: "" + +## Set 'true' if Ansible should automatically add IPTABLES rules to allow for Kubernetes traffic. +rke2_add_iptables_rules: false + +## Path, local to Ansible control host, where manifests can be found that will be added (to server/manifests directory) and automatically applied after first server is up. +rke2_manifest_config_directory: "" + +## Path, local to Ansible control host, where manifests can be found that will be added (to server/manifests directory) and automatically applied after last server is up. +rke2_manifest_config_post_run_directory: "" + +## Path, local to Ansible control host, where systemd environment file config can be found (Proxy Config). +rke2_systemd_env_config_file_path: "" + +# Should not be changed: rke2_metrics_running: false rke2_node_ready: "false" rke2_api_server_running: false @@ -41,4 +98,3 @@ rke2_reboot: false rke2_version_majmin: "" rke2_version_rpm: "" rke2_package_state: "installed" -rke2_systemd_env_config_file_path: "" diff --git a/roles/rke2/tasks/NOT_USED_cluster_state.yml b/roles/rke2/tasks/NOT_USED_cluster_state.yml deleted file mode 100644 index 130fe3d2..00000000 --- a/roles/rke2/tasks/NOT_USED_cluster_state.yml +++ /dev/null @@ -1,66 +0,0 @@ ---- - -- name: Check for existing cluster - when: - - rke2_running is defined - - rke2_running - block: - - name: Check for node-token (existing cluster) - ansible.builtin.stat: - path: /var/lib/rancher/rke2/server/node-token - register: node_token_tmp - - - name: Read node-token (existing cluster) - ansible.builtin.slurp: - src: /var/lib/rancher/rke2/server/node-token - register: rke2_config_token_tmp - when: - - node_token_tmp.stat.exists - - - name: Set node-token fact (existing cluster) - ansible.builtin.set_fact: - rke2_config_token: "{{ rke2_config_token_tmp.content | b64decode | regex_replace('\n', '') }}" - when: - - "rke2_config_token_tmp.content is defined" - - rke2_config_token_tmp.content | length != 0 - - - name: Set node-token fact on all hosts (existing cluster) - ansible.builtin.set_fact: - rke2_config_token: "{{ hostvars[item]['rke2_config_token'] }}" - delegate_to: localhost - run_once: true - loop: "{{ groups['all'] }}" - when: "hostvars[item]['rke2_config_token'] is defined" - - - name: Debug found token - ansible.builtin.debug: - msg: "rke2_config_token: {{ rke2_config_token }}" - when: rke2_config_token != "" - - - name: Read host with token (existing cluster) - ansible.builtin.set_fact: - existing_join_host: "{{ ansible_hostname }}" - when: - - node_token_tmp.stat.exists - - - name: Set join server fact on all hosts (existing cluster) - ansible.builtin.set_fact: - rke2_kubernetes_api_server_host: "{{ hostvars[item]['existing_join_host'] }}" - delegate_to: localhost - run_once: true - loop: "{{ groups['all'] }}" - when: - - "hostvars[item]['existing_join_host'] is defined" - - hostvars[item]['rke2_kubernetes_api_server_host'] == "" - vars: - rke2_kubernetes_api_server_host: "{{ existing_join_host | default('') }}" - -- name: No existing cluster found and api server not set - ansible.builtin.set_fact: - rke2_kubernetes_api_server_host: "{{ hostvars[groups['rke2_servers'][0]].inventory_hostname }}" - when: - - rke2_kubernetes_api_server_host == "" - -- name: Debug found join_server - ansible.builtin.debug: - msg: "Join Server: {{ rke2_kubernetes_api_server_host }}" diff --git a/terraform.tfstate b/terraform.tfstate new file mode 100644 index 00000000..b2469b20 --- /dev/null +++ b/terraform.tfstate @@ -0,0 +1,9 @@ +{ + "version": 4, + "terraform_version": "1.5.7", + "serial": 1, + "lineage": "c2c97bd2-db3d-8bef-4f3e-cd6f43b8cad5", + "outputs": {}, + "resources": [], + "check_results": null +}