James Gibson 3c9afb94cf Add support for setting extended key usage
This will be useful when you need to create a client certificate
for use with TLS live migration in NOva for example.
Also includes some linting fixes.

Change-Id: I1cc9f1938082a1dfe4b9ac55fd776b0ce7915efd
2021-10-21 15:03:30 +01:00

38 lines
1.4 KiB
YAML

---
# Copyright 2021, BBC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Slurp up CA certificates from pki setup host ({{ pki_setup_host }})
delegate_to: "{{ pki_setup_host }}"
slurp:
src: "{{ item.src | default(pki_dir ~ '/roots/' ~ item.name ~ '/certs/' ~ item.name ~ '.crt') }}"
register: _ca_slurp
run_once: true
when:
- (item.condition is defined and item.condition | bool) or (item.condition is not defined)
loop: "{{ pki_install_ca }}"
- name: Copy CA certificates to target host
copy:
content: "{{ item.content | b64decode }}"
dest: "{{ pki_trust_store_location[ansible_facts['pkg_mgr']] }}/{{ item.item.filename | default(item.item.name ~ '.crt') }}"
register: ca_copy
loop: "{{ _ca_slurp.results | default([]) }}"
when: item.skipped is not defined
- name: Update CA store
command: "{{ pki_ca_install_command[ansible_facts['pkg_mgr']] }}"
when:
- ca_copy is changed