ansible-role-redhat-subscri.../tasks/satellite-6.yml
Emilien Macchi dba48a0531 sat6: pull & deploy katello certs
For a node to communicate correctly with Katello, it needs the right SSL
certificates in place, and facts configured in RHSM.

It is provided by katello-ca-consumer-latest.noarch.rpm with
katello-rhsm-consumer script.

This patch installs the rpm and runs the script.

Change-Id: I180eb65a01832da76d5c433d9b13f8e410e24d04
Closes-Bug: #1805249
2018-11-27 13:44:38 -05:00

44 lines
1.6 KiB
YAML

- name: SATELLITE 6 | Set Satellite server CA as a fact
set_fact:
rhsm_katello_ca: "{{ lookup('url', rhsm_satellite_url ~ '/pub/katello-server-ca.crt', validate_certs=False, split_lines=False) }}"
- block:
- name: Ensure appropriate version of subscription-manager is installed
assert:
fail_msg: The installed version of subscription-manager is too old.
that:
- packages['subscription-manager'][0]['version'] is version_compare('1.10', '>=')
rescue:
- name: Attempt to update subscription-manager
yum:
name: subscription-manager
state: latest
- name: Ensure appropriate version of subscription-manager is installed
assert:
fail_msg: The installed version of subscription-manager is too old.
that:
- packages['subscription-manager'][0]['version'] is version_compare('1.10', '>=')
- name: Configure yum plugins
ini_file:
path: /etc/yum/pluginconf.d/{{ item.file }}
section: "{{ item.section | default('main') }}"
option: "{{ item.option }}"
value: "{{ item.value }}"
loop: "{{ rhsm_yum_plugins }}"
- name: SATELLITE 6 | Install katello-ca-consumer
yum:
name: "{{ rhsm_satellite_url }}/pub/katello-ca-consumer-latest.noarch.rpm"
state: present
validate_certs: no
disable_gpg_check: yes
register: katello_rpm
# This script is provided by katello-ca-consumer and takes care of deploying
# the katello certificates and prepare the config in RHSM.
- name: SATELLITE 6 | Execute katello-rhsm-consumer
shell: katello-rhsm-consumer
when: katello_rpm.changed