-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsatellite_config.yml
129 lines (111 loc) · 5.68 KB
/
satellite_config.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
128
129
---
- name: Ensure Satellite systems are configured
hosts: "{{ hostlist | default('all') }}"
tasks:
- name: Get the Satellite server FQDN
ansible.builtin.command: 'hostname -f'
register: hostname_out
- name: Print the Satellite server FQDN
ansible.builtin.debug:
msg: "Satellite FQDN: {{ hostname_out.stdout }}"
verbosity: 1
- name: Ensure the Satellite server FQDN is defined
ansible.builtin.set_fact:
satellite_server_fqdn: "{{ hostname_out.stdout }}"
- name: Configure various components on the Satellite server
block:
- name: Print Satellite installation parameters
ansible.builtin.debug:
msg: "{{ satellite_username }}, {{ satellite_password }}, {{ satellite_organization }}, {{ satellite_location }} {{ satellite_manifest_path }}"
verbosity: 1
- name: Ensure the Satellite server URL is defined
ansible.builtin.set_fact:
satellite_server_url: "https://{{ satellite_server_fqdn }}"
- name: Print Satellite server connection information
ansible.builtin.debug:
msg: "Configuring Satellite server at {{ satellite_server_url }}"
- name: Ensure manifest is installed
ansible.builtin.include_role:
name: redhat.satellite.manifest
- name: Ensure products are selected
ansible.builtin.include_role:
name: redhat.satellite.repositories
- name: Synchronize repositories (leave out repository specification to sync all repositories)
redhat.satellite.repository_sync:
username: "{{ satellite_username }}"
password: "{{ satellite_password}}"
server_url: "{{ satellite_server_url }}"
product: "{{ item.name }}"
organization: "{{ satellite_organization }}"
validate_certs: no
with_items: "{{ satellite_products }}"
# async: 7200
# poll: 60
- name: Ensure Lifecycles are created
ansible.builtin.include_role:
name: redhat.satellite.lifecycle_environments
- name: Ensure Content Views are created
ansible.builtin.include_role:
name: redhat.satellite.content_views
- name: Loop to add all of the filters associated with each Content View
ansible.builtin.include_tasks:
file: tasks/content_view_filters.yml
loop: "{{ satellite_content_views_to_publish }}"
loop_control:
loop_var: content_view_item
- name: Ensure Host Collections are created
redhat.satellite.host_collection:
description: "{{ item.description | default(omit) }}"
name: "{{ item.name }}"
organization: "{{ satellite_organization }}"
password: "{{ satellite_password}}"
server_url: "{{ satellite_server_url }}"
state: "{{ item.state | default(omit) }}"
updated_name: "{{ item.updated_name | default(omit) }}"
username: "{{ satellite_username }}"
validate_certs: no
with_items: "{{ satellite_host_collections }}"
- name: Ensure Activation Keys are created
ansible.builtin.include_role:
name: redhat.satellite.activation_keys
- name: Ensure Host Groups are created
redhat.satellite.hostgroup:
activation_keys: "{{ item.activation_keys | default(omit) }}"
ansible_roles: "{{ item.ansible_roles | default(omit) }}"
architecture: "{{ item.architecture | default(omit) }}"
compute_profile: "{{ item.compute_profile | default(omit) }}"
compute_resource: "{{ item.compute_resource | default(omit) }}"
config_groups: "{{ item.config_groups | default(omit) }}"
content_source: "{{ satellite_server_fqdn }}"
content_view: "{{ item.content_view | default(omit) }}"
description: "{{ item.description | default(omit) }}"
domain: "{{ item.domain | default(omit) }}"
environment: "{{ item.environment | default(omit) }}"
kickstart_repository: "{{ item.kickstart_repository | default(omit) }}"
lifecycle_environment: "{{ item.lifecycle_environment | default(omit) }}"
locations: "{{ satellite_location }}"
medium: "{{ item.medium | default(omit) }}"
name: "{{ item.name | default(omit) }}"
openscap_proxy: "{{ satellite_server_fqdn }}"
operatingsystem: "{{ item.operatingsystem | default(omit) }}"
organization: "{{ satellite_organization }}"
organizations: "{{ item.organizations | default(omit) }}"
parameters: "{{ item.parameters | default(omit) }}"
parent: "{{ item.parent | default(omit) }}"
password: "{{ satellite_password}}"
ptable: "{{ item.ptable | default(omit) }}"
puppet_ca_proxy: "{{ item.puppet_ca_proxy | default(omit) }}"
puppet_proxy: "{{ item.puppet_proxy | default(omit) }}"
puppetclasses: "{{ item.puppetclasses | default(omit) }}"
pxe_loader: "{{ item.pxe_loader | default(omit) }}"
realm: "{{ item.realm | default(omit) }}"
root_pass: "{{ item.root_pass | default(omit) }}"
server_url: "{{ satellite_server_url }}"
state: "{{ item.state | default(omit) }}"
subnet: "{{ item.subnet | default(omit) }}"
subnet6: "{{ item.subnet6 | default(omit) }}"
updated_name: "{{ item.updated_name | default(omit) }}"
username: "{{ satellite_username }}"
validate_certs: no
with_items: "{{ satellite_hostgroups }}"
delegate_to: localhost