-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsatellite_install.yml
76 lines (68 loc) · 2.36 KB
/
satellite_install.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
- name: Install Red Hat Satellite
hosts: satellite
become: true
gather_facts: true
tasks:
- name: Fail if invalid Satellite URL defined
fail:
msg: "Satellite URL must start with http:// or https://."
when:
- not satellite_server_url | default(true) or
(not satellite_server_url.startswith("http://") and
not satellite_server_url.startswith("https://"))
- name: Install helpful packages
dnf:
name:
- firewalld
- insights-client
- rhc
- satellite-installer
- sos
state: present
- name: Enable firewalld service
service:
name: firewalld
enabled: true
- name: Start firewalld service
service:
name: firewalld
state: started
- name: Configure Satellite firewall
ansible.posix.firewalld:
service: RH-Satellite-6
zone: "{{ satellite_firewall_zone }}"
state: enabled
immediate: true
permanent: true
- name: Check Satellite status
redhat.satellite.status_info:
server_url: "{{ satellite_server_url }}"
username: "{{ satellite_username }}"
password: "{{ satellite_password }}"
validate_certs: false
register: satellite_info
failed_when:
- "'msg' in satellite_info"
- "'Unauthorized' in satellite_info.msg"
- name: Install Satellite
include_role:
name: redhat.satellite_operations.installer
register: satellite_install
when: >
('msg' in satellite_info and "Connection refused" in satellite_info.msg) or
('status' in satellite_info and 'result' in satellite_info.status and satellite_info.status.result != "ok")
- name: Verify Satellite status
redhat.satellite.status_info:
server_url: "{{ satellite_server_url }}"
username: "{{ satellite_username }}"
password: "{{ satellite_password }}"
validate_certs: "{{ satellite_validate_certs }}"
register: satellite_info
- name: Connect Satellite to Red Hat Insights
command: satellite-installer --register-with-insights
changed_when: true
when:
- satellite_register_insights | bool
- satellite_install is not skipped
- ('status' in satellite_info and 'result' in satellite_info.status and satellite_info.status.result == 'ok')