- nagios-nrpe-server
- nagios-plugins-basic
+The following variables are used to optionally configure a dockerhub mirror CA
+certificate. The role will use `/etc/containers/certs.d` if it detects `podman`
+and `/etc/docker/certs.d` if it does not detect `podman` but detects `docker`::
+
+ # Defined in all.yml in secrets repo
+ container_mirror: docker-mirror.front.sepia.ceph.com:5000
+
+ # Defined in all.yml in secrets repo
+ container_mirror_cert: |
+ -----BEGIN CERTIFICATE-----
+ ...
+ -----END CERTIFICATE-----
+
+ # Defined in roles/common/vars/$distro_$version.yml or determined in roles/common/tasks/main.yml
+ container_mirror_cert_path: "/etc/docker/certs.d/{{ container_mirror }}"
+
Tags
++++
applicable). ``monitoring-scripts`` is also always run with this tag since
NRPE isn't very useful without them.
+container-mirror
+ Put a (probably self-signed) certificate in place for an internal dockerhub mirror.
+
To Do
+++++
--- /dev/null
+---
+# Note that these tasks only put the CA certificate in place.
+# podman/docker installation is still handled in the testnodes repo because
+# we don't want podman/docker installed everywhere but we do want this cert
+# everywhere just in case.
+# For example we might not want docker/podman installed on infrahost01 but
+# we definitely need this cert installed on testnodes and infrahost0{2..5}.
+- name: Include encrypted variables
+ include_vars: "{{ item }}"
+ with_first_found:
+ - "{{ secrets_path }}/all.yml"
+ - empty.yml
+ no_log: true
+ tags:
+ - vars
+
+- name: "Create {{ container_mirror_cert_path }}"
+ file:
+ path: "{{ container_mirror_cert_path }}"
+ state: directory
+
+- name: "Copy {{ container_mirror }} self-signed cert"
+ copy:
+ dest: "{{ container_mirror_cert_path }}/docker-mirror.crt"
+ content: "{{ container_mirror_cert }}"
- vars
# We need these vars for the entitlements tag to work
- entitlements
+ - container-mirror
# configure things specific to yum systems
- import_tasks: yum_systems.yml
(selinux_status is defined and selinux_status.stdout != "Disabled")
tags:
- nagios
+
+# We check for podman first because it was released after docker.
+# If we find podman, we should use its certs path.
+# Just because `docker` exists doesn't mean we're not using podman.
+- name: Check for podman
+ command: podman --version
+ register: check_for_podman
+ ignore_errors: true
+ when:
+ - container_mirror_cert_path is not defined
+ - container_mirror is defined
+ - container_mirror_cert is defined
+ tags:
+ - container-mirror
+
+- set_fact:
+ container_mirror_cert_path: "/etc/containers/certs.d/{{ container_mirror }}"
+ when:
+ - check_for_podman is success
+ - container_mirror is defined
+ - container_mirror_cert is defined
+ tags:
+ - container-mirror
+
+- name: Check for docker
+ command: docker --version
+ register: check_for_docker
+ ignore_errors: true
+ when:
+ - container_mirror_cert_path is not defined
+ - check_for_podman is not success
+ - container_mirror is defined
+ - container_mirror_cert is defined
+ tags:
+ - container-mirror
+
+- set_fact:
+ container_mirror_cert_path: "/etc/docker/certs.d/{{ container_mirror }}"
+ when:
+ - check_for_docker is success
+ - check_for_podman is not success
+ - container_mirror is defined
+ - container_mirror_cert is defined
+ tags:
+ - container-mirror
+
+- import_tasks: container_mirror.yml
+ when:
+ - container_mirror is defined
+ - container_mirror_cert is defined
+ - container_mirror_cert_path is defined
+ tags:
+ - container-mirror
--- /dev/null
+---
+container_mirror_cert_path: "/etc/docker/certs.d/{{ container_mirror }}"
nrpe_selinux_packages:
- python3-libsemanage
- python3-policycoreutils
+
+container_mirror_cert_path: "/etc/containers/certs.d/{{ container_mirror }}"
- rhel-7-server-optional-rpms
- rhel-7-server-extras-rpms
- rhel-ha-for-rhel-7-server-rpms
+
+container_mirror_cert_path: "/etc/docker/certs.d/{{ container_mirror }}"
nrpe_selinux_packages:
- python3-libsemanage
- python3-policycoreutils
+
+container_mirror_cert_path: "/etc/containers/certs.d/{{ container_mirror }}"