mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-10-31 06:26:19 -02:30
Replace injected Ansible fact variables in etcd role (#13338)
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
- name: Set Backup Directory
|
- name: Set Backup Directory
|
||||||
set_fact:
|
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
|
listen: Restart etcd
|
||||||
|
|
||||||
- name: Create Backup Directory
|
- name: Create Backup Directory
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- role: adduser
|
- role: adduser
|
||||||
user: "{{ addusers.etcd }}"
|
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
|
- role: adduser
|
||||||
user: "{{ addusers.kube }}"
|
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
|
- role: etcd_defaults
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
- name: Gen_certs | target ca-certificate store file
|
- name: Gen_certs | target ca-certificate store file
|
||||||
set_fact:
|
set_fact:
|
||||||
ca_cert_path: |-
|
ca_cert_path: |-
|
||||||
{% if ansible_os_family == "Debian" -%}
|
{% if ansible_facts['os_family'] == "Debian" -%}
|
||||||
/usr/local/share/ca-certificates/etcd-ca.crt
|
/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
|
/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
|
/etc/ssl/certs/etcd-ca.pem
|
||||||
{%- elif ansible_os_family == "Suse" -%}
|
{%- elif ansible_facts['os_family'] == "Suse" -%}
|
||||||
/etc/pki/trust/anchors/etcd-ca.pem
|
/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
|
/usr/share/ca-certs/etcd-ca.pem
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
tags:
|
tags:
|
||||||
@@ -26,12 +26,12 @@
|
|||||||
|
|
||||||
- name: Gen_certs | update ca-certificates (Debian/Ubuntu/SUSE/Flatcar) # noqa no-handler
|
- name: Gen_certs | update ca-certificates (Debian/Ubuntu/SUSE/Flatcar) # noqa no-handler
|
||||||
command: update-ca-certificates
|
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
|
- name: Gen_certs | update ca-certificates (RedHat) # noqa no-handler
|
||||||
command: update-ca-trust extract
|
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
|
- name: Gen_certs | update ca-certificates (ClearLinux) # noqa no-handler
|
||||||
command: clrtrust add "{{ ca_cert_path }}"
|
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"
|
||||||
|
|||||||
@@ -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.
|
## 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.
|
## 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`
|
## 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 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
|
## etcd_quota_backend_bytes, you may encounter out of memory terminations of the etcd cluster. Please check
|
||||||
|
|||||||
Reference in New Issue
Block a user