113 lines
2.5 KiB
YAML
113 lines
2.5 KiB
YAML
- name: SATELLITE | Check for Satellite 5
|
|
uri:
|
|
url: "{{ rhsm_satellite_url }}/rhn/Login.do"
|
|
validate_certs: false
|
|
status_code:
|
|
- 200
|
|
- 404
|
|
register: _sat5_check
|
|
retries: 3
|
|
delay: 5
|
|
until: "'status' in _sat5_check"
|
|
run_once: true
|
|
ignore_errors: true
|
|
tags:
|
|
- rhsm_satellite
|
|
|
|
- name: SATELLITE | Check for Satellite 6
|
|
uri:
|
|
url: "{{ rhsm_satellite_url }}/pulp/api/v2/status/"
|
|
validate_certs: false
|
|
status_code:
|
|
- 200
|
|
register: _sat6_check_v6
|
|
retries: 3
|
|
delay: 5
|
|
until: "'status' in _sat6_check_v6"
|
|
run_once: true
|
|
ignore_errors: true
|
|
tags:
|
|
- rhsm_satellite
|
|
|
|
- name: Set correct v6 check result
|
|
set_fact:
|
|
_sat6_check: "{{ _sat6_check_v6 }}"
|
|
when:
|
|
- _sat6_check_v6 is success
|
|
|
|
- name: Block Satellite 6.10
|
|
when:
|
|
- _sat6_check_v6 is failed
|
|
block:
|
|
- name: SATELLITE | Check for Satellite 6.10
|
|
uri:
|
|
url: "{{ rhsm_satellite_url }}/pulp/api/v3/status/"
|
|
validate_certs: false
|
|
status_code:
|
|
- 200
|
|
- 404
|
|
register: _sat6_check_v610
|
|
run_once: true
|
|
retries: 3
|
|
delay: 5
|
|
until: "'status' in _sat6_check_v610"
|
|
tags:
|
|
- rhsm_satellite
|
|
|
|
- name: Set correct v6.10 check result
|
|
set_fact:
|
|
_sat6_check: "{{ _sat6_check_v610 }}"
|
|
|
|
- name: SATELLITE | Gather service facts
|
|
service_facts:
|
|
|
|
- name: SATELLITE | Start and enable rhsmcertsd
|
|
service:
|
|
name: rhsmcertd
|
|
state: started
|
|
enabled: true
|
|
when:
|
|
- "'rhsmcertd' in (ansible_facts.services.keys() | replace('.service', ''))"
|
|
|
|
- name: SATELLITE | Set Satellite version 5
|
|
set_fact:
|
|
rhsm_satellite_version: 5
|
|
when:
|
|
- (_sat5_check.status | default(400)) == 200
|
|
tags:
|
|
- rhsm_satellite
|
|
|
|
- name: SATELLITE | Set Satellite version 6
|
|
set_fact:
|
|
rhsm_satellite_version: 6
|
|
when:
|
|
- (_sat6_check.status | default(400)) == 200
|
|
tags:
|
|
- rhsm_satellite
|
|
|
|
- name: Fail if Satellite version was not found
|
|
fail:
|
|
msg: "Satellite version was not found, you should file a bug"
|
|
when:
|
|
- rhsm_satellite_version is undefined
|
|
|
|
- name: SATELLITE | Gather package facts
|
|
package_facts:
|
|
|
|
- name: SATELLITE | Run Satellite {{ rhsm_satellite_version }} tasks
|
|
include_tasks: "satellite-{{ rhsm_satellite_version }}.yml"
|
|
when:
|
|
- rhsm_state == 'present'
|
|
tags:
|
|
- rhsm_satellite
|
|
|
|
- import_tasks: portal.yml
|
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1717093
|
|
- name: SATELLITE 6 | Install katello-host-tools
|
|
package:
|
|
name: katello-host-tools
|
|
state: present
|
|
when:
|
|
- (rhsm_satellite_version | int) == 6
|