forked from redhat-partner-tech/automated-smart-management
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_satellite.yml
70 lines (62 loc) · 1.93 KB
/
setup_satellite.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
---
- hosts: "{{ HOSTS | default('satellite.example.com') }}"
connection: local
gather_facts: no
tasks:
- name: check satellite status
redhat.satellite.status_info:
validate_certs: false
- hosts: "{{ HOSTS | default('satellite.example.com') }}"
become: true
- name: satellite disconnected mode
import_playbook: satellite_disconnected_mode.yml
vars:
disconnected_mode: "false"
when: refresh_satellite_manifest
- hosts: "{{ HOSTS | default('satellite.example.com') }}"
connection: local
gather_facts: no
vars:
refresh_satellite_manifest: no
refresh_timeout: 14400
refresh_retry_interval: 15
tasks:
- name: refresh manifest
redhat.satellite.subscription_manifest:
organization: "Default Organization"
state: refreshed
async: "{{ refresh_timeout }}"
poll: 0
register: refresh_async
when: refresh_satellite_manifest
- hosts: "{{ HOSTS | default('satellite.example.com') }}"
become: true
vars:
refresh_satellite_manifest: no
refresh_timeout: 14400
refresh_retry_interval: 15
tasks:
- name: >
Watch the Satellite production.log until ManifestRefresh result ==> success appears before continuing...
wait_for:
path: /var/log/foreman/production.log
search_regex: "^.*ManifestRefresh.*state\ changed.*\ stopped\ \ result.*\ success"
timeout: 1500
sleep: 20
when: refresh_satellite_manifest
- hosts: "{{ HOSTS | default('satellite.example.com') }}"
connection: local
gather_facts: no
vars:
satellite_infra_workloads:
- theforeman.foreman.repositories
- theforeman.foreman.lifecycle_environments
- content_views
- theforeman.foreman.activation_keys
tasks:
- name: deploy satellite_infra workloads
include_role:
name: "{{ satellite_infra_vars }}"
loop: "{{ satellite_infra_workloads }}"
loop_control:
loop_var: satellite_infra_vars