bf0af1cd3d
* using separated vault roles for generate certs with different `O` (Organization) subject field; * configure vault roles for issuing certificates with different `CN` (Common name) subject field; * set `CN` and `O` to `kubernetes` and `etcd` certificates; * vault/defaults vars definition was simplified; * vault dirs variables defined in kubernetes-defaults foles for using shared tasks in etcd and kubernetes/secrets roles; * upgrade vault to 0.8.1; * generate random vault user password for each role by default; * fix `serial` file name for vault certs; * move vault auth request to issue_cert tasks; * enable `RBAC` in vault CI;
58 lines
2 KiB
YAML
58 lines
2 KiB
YAML
---
|
|
|
|
- name: sync_kube_master_certs | Create list of needed kube admin certs
|
|
set_fact:
|
|
kube_admin_cert_list: "{{ kube_admin_cert_list|d([]) + ['admin-' + item + '.pem'] }}"
|
|
with_items: "{{ groups['kube-master'] }}"
|
|
|
|
- include: ../../../vault/tasks/shared/sync_file.yml
|
|
vars:
|
|
sync_file: "{{ item }}"
|
|
sync_file_dir: "{{ kube_cert_dir }}"
|
|
sync_file_group: "{{ kube_cert_group }}"
|
|
sync_file_hosts: "{{ groups['kube-master'] }}"
|
|
sync_file_is_cert: true
|
|
sync_file_owner: kube
|
|
with_items: "{{ kube_admin_cert_list|d([]) }}"
|
|
|
|
- name: sync_kube_master_certs | Set facts for kube admin sync_file results
|
|
set_fact:
|
|
kube_admin_certs_needed: "{{ kube_admin_certs_needed|default([]) + [item.path] }}"
|
|
with_items: "{{ sync_file_results|d([]) }}"
|
|
when: item.no_srcs|bool
|
|
|
|
- name: sync_kube_master_certs | Unset sync_file_results after kube admin certs
|
|
set_fact:
|
|
sync_file_results: []
|
|
|
|
- include: ../../../vault/tasks/shared/sync_file.yml
|
|
vars:
|
|
sync_file: "{{ item }}"
|
|
sync_file_dir: "{{ kube_cert_dir }}"
|
|
sync_file_group: "{{ kube_cert_group }}"
|
|
sync_file_hosts: "{{ groups['kube-master'] }}"
|
|
sync_file_is_cert: true
|
|
sync_file_owner: kube
|
|
with_items: ["apiserver.pem", "kube-scheduler.pem", "kube-controller-manager.pem"]
|
|
|
|
- name: sync_kube_master_certs | Set facts for kube master components sync_file results
|
|
set_fact:
|
|
kube_master_components_certs_needed: "{{ kube_master_components_certs_needed|d([]) + [item.path] }}"
|
|
with_items: "{{ sync_file_results|d([]) }}"
|
|
when: item.no_srcs|bool
|
|
|
|
- name: sync_kube_master_certs | Unset sync_file_results after kube master components cert
|
|
set_fact:
|
|
sync_file_results: []
|
|
|
|
- include: ../../../vault/tasks/shared/sync_file.yml
|
|
vars:
|
|
sync_file: ca.pem
|
|
sync_file_dir: "{{ kube_cert_dir }}"
|
|
sync_file_group: "{{ kube_cert_group }}"
|
|
sync_file_hosts: "{{ groups['kube-master'] }}"
|
|
sync_file_owner: kube
|
|
|
|
- name: sync_kube_master_certs | Unset sync_file_results after ca.pem
|
|
set_fact:
|
|
sync_file_results: []
|