Browse Source
[etcd] Sometimes, we do not need to run etcd role on all nodes. (#9173)
[etcd] Sometimes, we do not need to run etcd role on all nodes. (#9173)
* WIP: sometimes,we not run etcd * fix ansible lint * like calico(kdd) cni, no need run etcdpull/9270/head
Samuel Liu
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 140 additions and 58 deletions
Split View
Diff Options
-
7cluster.yml
-
2roles/etcd/defaults/main.yml
-
38roles/etcd/tasks/check_certs.yml
-
78roles/etcd/tasks/gen_certs_script.yml
-
32roles/etcd/tasks/gen_nodes_certs_script.yml
-
18roles/etcd/tasks/main.yml
-
16scale.yml
-
7upgrade-cluster.yml
@ -0,0 +1,32 @@ |
|||
--- |
|||
- name: Gen_certs | Set cert names per node |
|||
set_fact: |
|||
my_etcd_node_certs: [ 'ca.pem', |
|||
'node-{{ inventory_hostname }}.pem', |
|||
'node-{{ inventory_hostname }}-key.pem'] |
|||
tags: |
|||
- facts |
|||
|
|||
- name: "Check_certs | Set 'sync_certs' to true on nodes" |
|||
set_fact: |
|||
sync_certs: true |
|||
with_items: |
|||
- "{{ my_etcd_node_certs }}" |
|||
|
|||
- name: Gen_certs | Gather node certs |
|||
shell: "set -o pipefail && tar cfz - -C {{ etcd_cert_dir }} {{ my_etcd_node_certs|join(' ') }} | base64 --wrap=0" |
|||
args: |
|||
executable: /bin/bash |
|||
warn: false |
|||
no_log: "{{ not (unsafe_show_logs|bool) }}" |
|||
register: etcd_node_certs |
|||
check_mode: no |
|||
delegate_to: "{{ groups['etcd'][0] }}" |
|||
changed_when: false |
|||
|
|||
- name: Gen_certs | Copy certs on nodes |
|||
shell: "set -o pipefail && base64 -d <<< '{{ etcd_node_certs.stdout|quote }}' | tar xz -C {{ etcd_cert_dir }}" |
|||
args: |
|||
executable: /bin/bash |
|||
no_log: "{{ not (unsafe_show_logs|bool) }}" |
|||
changed_when: false |
Write
Preview
Loading…
Cancel
Save