forked from t-prinz/redhat_satellite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsatellite_prep.yml
127 lines (108 loc) · 4.01 KB
/
satellite_prep.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
---
- name: Ensure Satellite systems are registered with access to required repositories, the firewall is set up, and the base software is installed
hosts: "{{ hostlist | default('all') }}"
become: True
vars:
satellite_version: "6.12"
tasks:
- name: Block for Satellite 6.8/6.9/6.10/6.11 and RHEL 7 (6.11 not tested)
block:
- name: Ensure system is registered with RHSM and that the proper repos are enabled for RHEL 7
include_role:
name: rhportal_reg
vars:
rhportal_reg_rhsm_supplemental_repo_list:
- "rhel-7-server-satellite-{{ satellite_version }}-rpms"
- "rhel-7-server-satellite-maintenance-6-rpms"
- "rhel-server-rhscl-7-rpms"
- "rhel-7-server-ansible-2.9-rpms"
- "rhel-7-server-extras-rpms"
- name: Define incoming firewall ports to open
set_fact:
satellite_incoming_firewall_ports:
- "53/udp"
- "53/tcp"
- "67/udp"
- "69/udp"
- "80/tcp"
- "443/tcp"
- "5000/tcp"
- "5647/tcp"
- "8000/tcp"
- "8140/tcp"
- "9090/tcp"
when: ansible_facts.distribution is defined and ansible_facts.distribution == "RedHat" and ansible_facts.distribution_major_version is defined and ansible_facts.distribution_major_version == "7"
- name: Block for Satellite 6.11 and RHEL 8
block:
- name: Ensure system is registered with RHSM and that the proper repos are enabled for RHEL 8
include_role:
name: rhportal_reg
vars:
rhportal_reg_rhsm_supplemental_repo_list:
- "satellite-{{ satellite_version }}-for-rhel-8-x86_64-rpms"
- "satellite-maintenance-{{ satellite_version }}-for-rhel-8-x86_64-rpms"
- name: Enable the Satellite module
command:
cmd: "dnf module enable -y satellite:el8"
- name: Define incoming firewall ports to open
set_fact:
satellite_incoming_firewall_ports:
- "53/udp"
- "53/tcp"
- "67/udp"
- "69/udp"
- "80/tcp"
- "443/tcp"
- "5647/tcp"
- "8000/tcp"
- "8140/tcp"
- "9090/tcp"
when: ansible_facts.distribution is defined and ansible_facts.distribution == "RedHat" and ansible_facts.distribution_major_version is defined and ansible_facts.distribution_major_version == "8"
- name: Ensure firewalld is installed
ansible.builtin.yum:
name: firewalld
state: installed
- name: Ensure firewalld is enabled and started
service:
name: firewalld
enabled: True
state: started
- name: Ensure firewall ports are open
ansible.posix.firewalld:
immediate: True
permanent: True
port: "{{ item }}"
state: enabled
with_items: "{{ satellite_incoming_firewall_ports }}"
- name: Ensure RHEL release version is not set
command: "subscription-manager release --unset"
args:
warn: No
- name: Ensure kernel is up-to-date; if so a reboot will occur
ansible.builtin.yum:
name: kernel
state: latest
register: kernel_status
- name: Reboot server if needed
ansible.builtin.reboot:
when: kernel_status.changed
- name: Ensure all packages are updated
ansible.builtin.yum:
name: '*'
state: latest
- name: Ensure Satellite and other required software is installed (RHEL system roles and screen not strictly required)
ansible.builtin.yum:
name: "{{ satellite_sw_list }}"
state: latest
vars:
satellite_sw_list:
- satellite
- chrony
- sos
- rhel-system-roles
# - screen
- name: Ensure chronyd is enabled and started
service:
name: chronyd
enabled: True
state: started