Skip to content

Commit 8554998

Browse files
jackhodgkissAlex-Welsh
authored andcommitted
feat: support using copy-ca-to-hosts as hook
1 parent 3585838 commit 8554998

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

etc/kayobe/ansible/copy-ca-to-hosts.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
---
22
- name: Install certificate authorities and update trust
33
hosts: overcloud:seed:seed-hypervisor
4+
# Avoid using facts because this may be used as a pre overcloud host
5+
# configure hook, and we don't want to populate the fact cache (if one is in
6+
# use) with the bootstrap user's context.
7+
gather_facts: false
8+
tags:
9+
- install-ca
10+
vars:
11+
ansible_user: "{{ bootstrap_user }}"
12+
# We can't assume that a virtualenv exists at this point, so use the system
13+
# python interpreter.
14+
ansible_python_interpreter: /usr/bin/python3
15+
# Work around no known_hosts entry on first boot.
16+
ansible_ssh_common_args: -o StrictHostKeyChecking=no
17+
# Don't assume facts are present.
18+
os_family: "{{ ansible_facts.os_family | default('Debian' if os_distribution == 'ubuntu' else 'RedHat') }}"
419
become: true
520
tasks:
621
- name: Install certificate authorities on RedHat based distributions
7-
when: ansible_facts.os_family == 'RedHat'
22+
when: os_family == 'RedHat'
823
block:
924
- name: Copy certificate authorities on RedHat family systems (Rocky, RHEL, CentOS)
1025
ansible.builtin.copy:
@@ -18,7 +33,7 @@
1833
ansible.builtin.command: "update-ca-trust"
1934

2035
- name: Install certificate authorities on Debian based distributions
21-
when: ansible_facts.os_family == 'Debian'
36+
when: os_family == 'Debian'
2237
block:
2338
- name: Copy certificate authorities on Debian family systems (Ubuntu, Debian)
2439
ansible.builtin.copy:

0 commit comments

Comments
 (0)