Replace injected Ansible fact variables in etcd role (#13338)

This commit is contained in:
Nikhil Kumar
2026-09-10 11:24:34 +00:00
committed by GitHub
parent 5e5b072597
commit cfa983e8c7
4 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -7,7 +7,7 @@
- name: Set Backup Directory
set_fact:
etcd_backup_directory: "{{ etcd_backup_prefix }}/etcd-{{ ansible_date_time.date }}_{{ ansible_date_time.time }}"
etcd_backup_directory: "{{ etcd_backup_prefix }}/etcd-{{ ansible_facts['date_time']['date'] }}_{{ ansible_facts['date_time']['time'] }}"
listen: Restart etcd
- name: Create Backup Directory
+2 -2
View File
@@ -2,8 +2,8 @@
dependencies:
- role: adduser
user: "{{ addusers.etcd }}"
when: not (ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk", "ClearLinux"] or is_fedora_coreos)
when: not (ansible_facts['os_family'] in ["Flatcar", "Flatcar Container Linux by Kinvolk", "ClearLinux"] or is_fedora_coreos)
- role: adduser
user: "{{ addusers.kube }}"
when: not (ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk", "ClearLinux"] or is_fedora_coreos)
when: not (ansible_facts['os_family'] in ["Flatcar", "Flatcar Container Linux by Kinvolk", "ClearLinux"] or is_fedora_coreos)
- role: etcd_defaults
+8 -8
View File
@@ -2,15 +2,15 @@
- name: Gen_certs | target ca-certificate store file
set_fact:
ca_cert_path: |-
{% if ansible_os_family == "Debian" -%}
{% if ansible_facts['os_family'] == "Debian" -%}
/usr/local/share/ca-certificates/etcd-ca.crt
{%- elif ansible_os_family == "RedHat" -%}
{%- elif ansible_facts['os_family'] == "RedHat" -%}
/etc/pki/ca-trust/source/anchors/etcd-ca.crt
{%- elif ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"] -%}
{%- elif ansible_facts['os_family'] in ["Flatcar", "Flatcar Container Linux by Kinvolk"] -%}
/etc/ssl/certs/etcd-ca.pem
{%- elif ansible_os_family == "Suse" -%}
{%- elif ansible_facts['os_family'] == "Suse" -%}
/etc/pki/trust/anchors/etcd-ca.pem
{%- elif ansible_os_family == "ClearLinux" -%}
{%- elif ansible_facts['os_family'] == "ClearLinux" -%}
/usr/share/ca-certs/etcd-ca.pem
{%- endif %}
tags:
@@ -26,12 +26,12 @@
- name: Gen_certs | update ca-certificates (Debian/Ubuntu/SUSE/Flatcar) # noqa no-handler
command: update-ca-certificates
when: etcd_ca_cert.changed and ansible_os_family in ["Debian", "Flatcar", "Flatcar Container Linux by Kinvolk", "Suse"]
when: etcd_ca_cert.changed and ansible_facts['os_family'] in ["Debian", "Flatcar", "Flatcar Container Linux by Kinvolk", "Suse"]
- name: Gen_certs | update ca-certificates (RedHat) # noqa no-handler
command: update-ca-trust extract
when: etcd_ca_cert.changed and ansible_os_family == "RedHat"
when: etcd_ca_cert.changed and ansible_facts['os_family'] == "RedHat"
- name: Gen_certs | update ca-certificates (ClearLinux) # noqa no-handler
command: clrtrust add "{{ ca_cert_path }}"
when: etcd_ca_cert.changed and ansible_os_family == "ClearLinux"
when: etcd_ca_cert.changed and ansible_facts['os_family'] == "ClearLinux"
+1 -1
View File
@@ -49,7 +49,7 @@ etcd_extra_vars: {}
## Etcd is restricted by default to 512M on systems under 4GB RAM, 512MB is not enough for much more than testing.
## Set this if your etcd nodes have less than 4GB but you want more RAM for etcd. Set to 0 for unrestricted RAM.
## This value is only relevant when deploying etcd with `etcd_deployment_type: docker`
etcd_memory_limit: "{% if ansible_memtotal_mb < 4096 %}512M{% else %}0{% endif %}"
etcd_memory_limit: "{% if ansible_facts['memtotal_mb'] < 4096 %}512M{% else %}0{% endif %}"
## Etcd has a default of 2G for its space quota. If you put a value in etcd_memory_limit which is less than
## etcd_quota_backend_bytes, you may encounter out of memory terminations of the etcd cluster. Please check