-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8181 from vrutkovs/3.6-etcd-backport
[3.6] Backport etcd certificate updates from 3.7
- Loading branch information
Showing
18 changed files
with
212 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
playbooks/common/openshift-cluster/redeploy-certificates/etcd.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
- name: Generate new etcd CA | ||
hosts: oo_first_etcd | ||
roles: | ||
- role: openshift_etcd_facts | ||
tasks: | ||
- include_role: | ||
name: etcd | ||
tasks_from: ca | ||
vars: | ||
etcd_peers: "{{ groups.oo_etcd_to_config | default([], true) }}" | ||
etcd_certificates_etcd_hosts: "{{ groups.oo_etcd_to_config | default([], true) }}" | ||
when: | ||
- etcd_ca_setup | default(True) | bool | ||
static: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
- include: server_certificates.yml | ||
|
||
- include: master_etcd_certificates.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
playbooks/common/openshift-etcd/master_etcd_certificates.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
- name: Create etcd client certificates for master hosts | ||
hosts: oo_masters_to_config | ||
any_errors_fatal: true | ||
roles: | ||
- role: openshift_etcd_facts | ||
- role: openshift_etcd_client_certificates | ||
etcd_cert_subdir: "openshift-master-{{ openshift.common.hostname }}" | ||
etcd_cert_config_dir: "{{ openshift.common.config_base }}/master" | ||
etcd_cert_prefix: "master.etcd-" | ||
r_etcd_common_etcd_runtime: "{{ openshift.common.etcd_runtime }}" | ||
when: groups.oo_etcd_to_config is defined and groups.oo_etcd_to_config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
- name: Create etcd server certificates for etcd hosts | ||
hosts: oo_etcd_to_config | ||
any_errors_fatal: true | ||
roles: | ||
- role: openshift_etcd_facts | ||
post_tasks: | ||
- include_role: | ||
name: etcd_server_certificates | ||
vars: | ||
etcd_peers: "{{ groups.oo_etcd_to_config | default([], true) }}" | ||
etcd_certificates_etcd_hosts: "{{ groups.oo_etcd_to_config | default([], true) }}" | ||
r_etcd_common_etcd_runtime: "{{ openshift.common.etcd_runtime }}" | ||
static: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- name: etcd_client node config | ||
hosts: "{{ openshift_node_scale_up_group | default('this_group_does_not_exist') }}" | ||
roles: | ||
- role: openshift_facts | ||
- role: openshift_etcd_facts | ||
- role: openshift_etcd_client_certificates | ||
etcd_cert_prefix: flannel.etcd- | ||
etcd_cert_subdir: "openshift-node-{{ openshift.common.hostname }}" | ||
etcd_cert_config_dir: "{{ openshift.common.config_base }}/node" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
etcd_ca_host_group: "oo_etcd_to_config" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
- name: Check for CA indicator files | ||
stat: | ||
path: "{{ item.0 }}" | ||
delegate_to: "{{ item.1 }}" | ||
with_nested: | ||
- - /etc/etcd/ca | ||
- /etc/etcd/generated_certs | ||
- "{{ groups[etcd_ca_host_group] }}" | ||
register: __etcd_ca_host_stat | ||
run_once: true | ||
|
||
# Collect ansible_host (inventory hostname) of hosts with /etc/etcd/ca | ||
# and /etc/etcd/generated_certs directories. | ||
- set_fact: | ||
__etcd_ca_dir_hosts: "{{ __etcd_ca_host_stat.results | ||
| oo_collect('_ansible_delegated_vars.ansible_host', | ||
filters={'stat.path':'/etc/etcd/ca','stat.exists':True}) }}" | ||
__etcd_generated_certs_dir_hosts: "{{ __etcd_ca_host_stat.results | ||
| oo_collect('_ansible_delegated_vars.ansible_host', | ||
filters={'stat.path':'/etc/etcd/generated_certs','stat.exists':True}) }}" | ||
run_once: true | ||
|
||
# __etcd_ca_hosts is the intersection of hosts which have /etc/etcd/ca | ||
# and /etc/etcd/generated_certs directories. | ||
- set_fact: | ||
__etcd_ca_hosts: "{{ __etcd_ca_dir_hosts | intersect(__etcd_generated_certs_dir_hosts) }}" | ||
run_once: true | ||
|
||
# __etcd_ca_hosts should only contain one host. If more than one host | ||
# is able to be an etcd CA host then we will use the first. | ||
- set_fact: | ||
etcd_ca_host: "{{ __etcd_ca_hosts[0] }}" | ||
when: | ||
- __etcd_ca_hosts | length > 0 | ||
- etcd_ca_host is not defined | ||
|
||
# No etcd_ca_host was found in __etcd_ca_hosts. This is probably a | ||
# fresh installation so we will default to the first member of the | ||
# etcd host group. | ||
- set_fact: | ||
etcd_ca_host: "{{ groups[etcd_ca_host_group].0 }}" | ||
when: | ||
- etcd_ca_host is not defined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters