mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-19 18:07: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,5 +1,5 @@
|
||||
---
|
||||
- include: ../shared/create_mount.yml
|
||||
- include_tasks: ../shared/create_mount.yml
|
||||
vars:
|
||||
create_mount_path: "{{ item.name }}"
|
||||
create_mount_default_lease_ttl: "{{ item.default_lease_ttl }}"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
- include: ../shared/create_role.yml
|
||||
- include_tasks: ../shared/create_role.yml
|
||||
vars:
|
||||
create_role_name: "{{ item.name }}"
|
||||
create_role_group: "{{ item.group }}"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
- include: ../shared/issue_cert.yml
|
||||
- import_tasks: ../shared/issue_cert.yml
|
||||
vars:
|
||||
issue_cert_common_name: "{{ vault_pki_mounts.vault.roles[0].name }}"
|
||||
issue_cert_alt_names: "{{ groups['vault'] + ['localhost'] + (vault_ca_options['vault']['alt_names'].split(','))|default() }}"
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
---
|
||||
- include: ../shared/check_vault.yml
|
||||
- import_tasks: ../shared/check_vault.yml
|
||||
when: inventory_hostname in groups.vault
|
||||
|
||||
- include: sync_secrets.yml
|
||||
- import_tasks: sync_secrets.yml
|
||||
when: inventory_hostname in groups.vault
|
||||
|
||||
- include: ../shared/find_leader.yml
|
||||
- import_tasks: ../shared/find_leader.yml
|
||||
when: inventory_hostname in groups.vault and vault_cluster_is_initialized
|
||||
|
||||
- include: sync_vault_certs.yml
|
||||
- import_tasks: sync_vault_certs.yml
|
||||
when: inventory_hostname in groups.vault
|
||||
|
||||
- include: sync_etcd_certs.yml
|
||||
- import_tasks: sync_etcd_certs.yml
|
||||
when: inventory_hostname in groups.etcd
|
||||
|
||||
- include: start_vault_temp.yml
|
||||
- import_tasks: start_vault_temp.yml
|
||||
when: inventory_hostname == groups.vault|first and not vault_cluster_is_initialized
|
||||
|
||||
- name: vault | Set fact about vault leader url
|
||||
@@ -22,17 +22,17 @@
|
||||
vault_leader_url: "{{ hostvars[groups.vault|first]['vault_leader_url'] }}"
|
||||
when: not vault_cluster_is_initialized
|
||||
|
||||
- include: create_mounts.yml
|
||||
- import_tasks: create_mounts.yml
|
||||
when: inventory_hostname == groups.vault|first
|
||||
|
||||
- include: ../shared/auth_backend.yml
|
||||
- include_tasks: ../shared/auth_backend.yml
|
||||
vars:
|
||||
auth_backend_description: A Username/Password Auth Backend primarily used for services needing to issue certificates
|
||||
auth_backend_path: userpass
|
||||
auth_backend_type: userpass
|
||||
when: inventory_hostname == groups.vault|first
|
||||
|
||||
- include: create_roles.yml
|
||||
- include_tasks: create_roles.yml
|
||||
with_items:
|
||||
- "{{ vault_pki_mounts.vault }}"
|
||||
- "{{ vault_pki_mounts.etcd }}"
|
||||
@@ -40,7 +40,7 @@
|
||||
loop_var: mount
|
||||
when: inventory_hostname in groups.vault
|
||||
|
||||
- include: ../shared/gen_ca.yml
|
||||
- include_tasks: ../shared/gen_ca.yml
|
||||
vars:
|
||||
gen_ca_cert_dir: "{{ vault_pki_mounts.vault.cert_dir }}"
|
||||
gen_ca_mount_path: "{{ vault_pki_mounts.vault.name }}"
|
||||
@@ -51,7 +51,7 @@
|
||||
and not vault_cluster_is_initialized
|
||||
and vault_ca_cert_needed
|
||||
|
||||
- include: ../shared/gen_ca.yml
|
||||
- include_tasks: ../shared/gen_ca.yml
|
||||
vars:
|
||||
gen_ca_cert_dir: "{{ vault_pki_mounts.etcd.cert_dir }}"
|
||||
gen_ca_mount_path: "{{ vault_pki_mounts.etcd.name }}"
|
||||
@@ -59,7 +59,7 @@
|
||||
gen_ca_vault_options: "{{ vault_ca_options.etcd }}"
|
||||
when: inventory_hostname in groups.etcd and vault_etcd_ca_cert_needed
|
||||
|
||||
- include: gen_vault_certs.yml
|
||||
- import_tasks: gen_vault_certs.yml
|
||||
when: inventory_hostname in groups.vault and vault_api_cert_needed
|
||||
|
||||
- include: ca_trust.yml
|
||||
- import_tasks: ca_trust.yml
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
|
||||
- include: ../shared/sync_file.yml
|
||||
- include_tasks: ../shared/sync_file.yml
|
||||
vars:
|
||||
sync_file: "ca.pem"
|
||||
sync_file_dir: "{{ vault_etcd_cert_dir }}"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
|
||||
- include: ../shared/sync_file.yml
|
||||
- include_tasks: ../shared/sync_file.yml
|
||||
vars:
|
||||
sync_file: "{{ item }}"
|
||||
sync_file_dir: "{{ vault_secrets_dir }}"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
- include: ../shared/sync_file.yml
|
||||
- include_tasks: ../shared/sync_file.yml
|
||||
vars:
|
||||
sync_file: "ca.pem"
|
||||
sync_file_dir: "{{ vault_cert_dir }}"
|
||||
@@ -14,7 +14,7 @@
|
||||
set_fact:
|
||||
sync_file_results: []
|
||||
|
||||
- include: ../shared/sync_file.yml
|
||||
- include_tasks: ../shared/sync_file.yml
|
||||
vars:
|
||||
sync_file: "api.pem"
|
||||
sync_file_dir: "{{ vault_cert_dir }}"
|
||||
|
||||
Reference in New Issue
Block a user