tripleo-ansible/tripleo_ansible/roles/tripleo_update_trusted_cas/tasks/main.yml

42 lines
1.3 KiB
YAML

---
# Copyright 2020 Red Hat, Inc.
# All Rights Reserved.
#
# 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.
#
# tripleo_update_trusted_cas will add a set of certifcates in PEM format
# to the trusted CA store. These are provided in a ca map, which has
# the format:
#
# tripleo_update_trusted_cas_ca_map:
# first-ca-name:
# content: |
# The content of the CA cert goes here
# second-ca-name:
# content: |
# The content of the CA cert goes here
# etc.
- name: Add ca files
become: true
copy:
dest: "/etc/pki/ca-trust/source/anchors/{{ item.key }}.pem"
content: "{{ item.value.content }}"
mode: "0644"
owner: "root"
loop: "{{ tripleo_update_trusted_cas_ca_map | dict2items }}"
- name: Update trust
become: true
command: /usr/bin/update-ca-trust extract