mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-05-08 01:47:37 -02:30
Use include/import tasks (#2192)
import_tasks will consume far less memory, so it should be used whenever it is compatible.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
---
|
||||
- include: sync_kube_master_certs.yml
|
||||
- import_tasks: sync_kube_master_certs.yml
|
||||
when: inventory_hostname in groups['kube-master']
|
||||
|
||||
- include: sync_kube_node_certs.yml
|
||||
- import_tasks: sync_kube_node_certs.yml
|
||||
when: inventory_hostname in groups['k8s-cluster']
|
||||
|
||||
# Issue admin certs to kube-master hosts
|
||||
- include: ../../../vault/tasks/shared/issue_cert.yml
|
||||
- include_tasks: ../../../vault/tasks/shared/issue_cert.yml
|
||||
vars:
|
||||
issue_cert_common_name: "admin"
|
||||
issue_cert_copy_ca: "{{ item == kube_admin_certs_needed|first }}"
|
||||
@@ -37,7 +37,7 @@
|
||||
run_once: true
|
||||
|
||||
# Issue master components certs to kube-master hosts
|
||||
- include: ../../../vault/tasks/shared/issue_cert.yml
|
||||
- include_tasks: ../../../vault/tasks/shared/issue_cert.yml
|
||||
vars:
|
||||
issue_cert_common_name: "kubernetes"
|
||||
issue_cert_alt_names: "{{ kube_cert_alt_names }}"
|
||||
@@ -63,7 +63,7 @@
|
||||
notify: set secret_changed
|
||||
|
||||
# Issue node certs to k8s-cluster nodes
|
||||
- include: ../../../vault/tasks/shared/issue_cert.yml
|
||||
- include_tasks: ../../../vault/tasks/shared/issue_cert.yml
|
||||
vars:
|
||||
# Need to strip out the 'node-' prefix from the cert name so it can be used
|
||||
# with the node authorization plugin ( CN matches kubelet node name )
|
||||
@@ -80,7 +80,7 @@
|
||||
when: inventory_hostname in groups['k8s-cluster']
|
||||
|
||||
# Issue proxy certs to k8s-cluster nodes
|
||||
- include: ../../../vault/tasks/shared/issue_cert.yml
|
||||
- include_tasks: ../../../vault/tasks/shared/issue_cert.yml
|
||||
vars:
|
||||
issue_cert_common_name: "system:kube-proxy"
|
||||
issue_cert_copy_ca: "{{ item == kube_proxy_certs_needed|first }}"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
- include: check-certs.yml
|
||||
- import_tasks: check-certs.yml
|
||||
tags:
|
||||
- k8s-secrets
|
||||
- facts
|
||||
|
||||
- include: check-tokens.yml
|
||||
- import_tasks: check-tokens.yml
|
||||
tags:
|
||||
- k8s-secrets
|
||||
- facts
|
||||
@@ -69,11 +69,11 @@
|
||||
delegate_to: "{{groups['kube-master'][0]}}"
|
||||
when: gen_tokens|default(false)
|
||||
|
||||
- include: "gen_certs_{{ cert_management }}.yml"
|
||||
- include_tasks: "gen_certs_{{ cert_management }}.yml"
|
||||
tags:
|
||||
- k8s-secrets
|
||||
|
||||
- include: upd_ca_trust.yml
|
||||
- import_tasks: upd_ca_trust.yml
|
||||
tags:
|
||||
- k8s-secrets
|
||||
|
||||
@@ -111,6 +111,6 @@
|
||||
kube_proxy_cert_serial: "{{ node_certificate_serials.results[1].stdout|default() }}"
|
||||
when: inventory_hostname in groups['k8s-cluster']
|
||||
|
||||
- include: gen_tokens.yml
|
||||
- import_tasks: gen_tokens.yml
|
||||
tags:
|
||||
- k8s-secrets
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
set_fact:
|
||||
kube_admin_cert_list: "{{ kube_admin_cert_list|d([]) + ['admin-' + inventory_hostname + '.pem'] }}"
|
||||
|
||||
- include: ../../../vault/tasks/shared/sync_file.yml
|
||||
- include_tasks: ../../../vault/tasks/shared/sync_file.yml
|
||||
vars:
|
||||
sync_file: "{{ item }}"
|
||||
sync_file_dir: "{{ kube_cert_dir }}"
|
||||
@@ -24,7 +24,7 @@
|
||||
set_fact:
|
||||
sync_file_results: []
|
||||
|
||||
- include: ../../../vault/tasks/shared/sync_file.yml
|
||||
- include_tasks: ../../../vault/tasks/shared/sync_file.yml
|
||||
vars:
|
||||
sync_file: "{{ item }}"
|
||||
sync_file_dir: "{{ kube_cert_dir }}"
|
||||
@@ -44,7 +44,7 @@
|
||||
set_fact:
|
||||
sync_file_results: []
|
||||
|
||||
- include: ../../../vault/tasks/shared/sync_file.yml
|
||||
- include_tasks: ../../../vault/tasks/shared/sync_file.yml
|
||||
vars:
|
||||
sync_file: ca.pem
|
||||
sync_file_dir: "{{ kube_cert_dir }}"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
set_fact:
|
||||
kube_node_cert_list: "{{ kube_node_cert_list|default([]) + ['node-' + inventory_hostname + '.pem'] }}"
|
||||
|
||||
- include: ../../../vault/tasks/shared/sync_file.yml
|
||||
- include_tasks: ../../../vault/tasks/shared/sync_file.yml
|
||||
vars:
|
||||
sync_file: "{{ item }}"
|
||||
sync_file_dir: "{{ kube_cert_dir }}"
|
||||
@@ -24,7 +24,7 @@
|
||||
set_fact:
|
||||
sync_file_results: []
|
||||
|
||||
- include: ../../../vault/tasks/shared/sync_file.yml
|
||||
- include_tasks: ../../../vault/tasks/shared/sync_file.yml
|
||||
vars:
|
||||
sync_file: ca.pem
|
||||
sync_file_dir: "{{ kube_cert_dir }}"
|
||||
@@ -40,7 +40,7 @@
|
||||
set_fact:
|
||||
kube_proxy_cert_list: "{{ kube_proxy_cert_list|default([]) + ['kube-proxy-' + inventory_hostname + '.pem'] }}"
|
||||
|
||||
- include: ../../../vault/tasks/shared/sync_file.yml
|
||||
- include_tasks: ../../../vault/tasks/shared/sync_file.yml
|
||||
vars:
|
||||
sync_file: "{{ item }}"
|
||||
sync_file_dir: "{{ kube_cert_dir }}"
|
||||
|
||||
Reference in New Issue
Block a user