-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsatellite_manifest.yml
68 lines (62 loc) · 2.42 KB
/
satellite_manifest.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
---
- name: Upload Satellite manifest
hosts: satellite
become: true
gather_facts: true
tasks:
- name: Fail if required parameters are not set
assert:
that:
- satellite_manifest_uuid is defined
- satellite_manifest_uuid is not none
- satellite_rhsm_username is defined
- satellite_rhsm_username is not none
- satellite_rhsm_password is defined
- satellite_rhsm_password is not none
fail_msg: "Required variables for manifest download are not set."
quiet: true
when: satellite_manifest_download | bool
- name: Copy local manifest to Satellite server
copy:
src: "{{ satellite_manifest_file_local }}"
dest: "{{ satellite_manifest_file_remote }}"
mode: '0600'
when: not satellite_manifest_download | bool
- name: Check manifest file on Satellite server
stat:
path: "{{ satellite_manifest_file_remote }}"
register: manifest_file
when: satellite_manifest_download | bool
- name: Download manifest from Red Hat Customer Portal
redhat.satellite.redhat_manifest:
uuid: "{{ satellite_manifest_uuid }}"
username: "{{ satellite_rhsm_username }}"
password: "{{ satellite_rhsm_password }}"
path: "{{ satellite_manifest_file_remote }}"
state: present
when:
- satellite_manifest_download | bool
- not manifest_file.stat.exists
- name: Change manifest file permissions
file:
path: "{{ satellite_manifest_file_remote }}"
mode: '0600'
- name: Upload manifest to Satellite
redhat.satellite.subscription_manifest:
server_url: "{{ satellite_server_url }}"
username: "{{ satellite_username }}"
password: "{{ satellite_password }}"
validate_certs: "{{ satellite_validate_certs }}"
organization: "{{ satellite_organization }}"
manifest_path: "{{ satellite_manifest_file_remote }}"
state: present
when: not satellite_manifest_refresh | bool
- name: Refresh Satellite manifest
redhat.satellite.subscription_manifest:
server_url: "{{ satellite_server_url }}"
username: "{{ satellite_username }}"
password: "{{ satellite_password }}"
validate_certs: "{{ satellite_validate_certs }}"
organization: "{{ satellite_organization }}"
state: refreshed
when: satellite_manifest_refresh | bool