-
Notifications
You must be signed in to change notification settings - Fork 0
/
initial-setup.yml
69 lines (60 loc) · 1.85 KB
/
initial-setup.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
- name: Initial setup
hosts: satellite
gather_facts: no
vars:
storage_pools:
- name: satellite
disks:
- sdb
volumes:
- name: pgsql
size: 20G
mount_point: /var/lib/pgsql
state: present
- name: pulp
size: 300G
mount_point: /var/lib/pulp
state: present
- name: qpidd
size: 5G
mount_point: /var/lib/qpidd
state: present
firewall:
- service: RH-Satellite-6
state: enabled
runtime: yes
permanent: yes
rhc_repositories:
- {name: "*", state: disabled}
- {name: rhel-8-for-x86_64-baseos-rpms, state: enabled}
- {name: rhel-8-for-x86_64-appstream-rpms, state: enabled}
- {name: satellite-6.14-for-rhel-8-x86_64-rpms, state: enabled}
- {name: satellite-maintenance-6.14-for-rhel-8-x86_64-rpms, state: enabled}
tasks:
- name: Configure Satellite filesystems
ansible.builtin.import_role:
name: redhat.rhel_system_roles.storage
- name: Configure Satellite firewalls
ansible.builtin.import_role:
name: redhat.rhel_system_roles.firewall
- name: Configure repositories
ansible.builtin.import_role:
name: redhat.rhel_system_roles.rhc
- name: Update all packages
ansible.builtin.dnf:
name: '*'
state: latest
- name: Ensure yum-utils is installed
ansible.builtin.dnf:
name: yum-utils
state: present
- name: Check if reboot required
ansible.builtin.command: /usr/bin/needs-restarting -r
register: needs_restart
failed_when: needs_restart.rc > 1
- name: Debug reboot required
ansible.builtin.debug:
var: needs_restart
- name: Reboot if necessary
when: needs_restart.rc == 1
ansible.builtin.reboot: