-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure-host.yml
More file actions
153 lines (153 loc) · 4.36 KB
/
configure-host.yml
File metadata and controls
153 lines (153 loc) · 4.36 KB
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
- name: Configure Host
hosts: baremetal
become: true
gather_facts: true
vars:
rhsm_activationkey: rhel-server
rhsm_org_id: ACME
tasks:
- name: run subscription role for RHEL 8
ansible.builtin.include_role:
name: swygue-redhat-subscription
vars:
rhsm_repos:
- rhel-8-for-x86_64-baseos-rpms
- rhel-8-for-x86_64-appstream-rpms
- ansible-2.9-for-rhel-8-x86_64-rpms
when: (( ansible_distribution == "RedHat" and ansible_distribution_major_version == '8'))
tags: rhsm
- name: run subscription role for RHEL 9
ansible.builtin.include_role:
name: swygue-redhat-subscription
vars:
rhsm_repos:
- rhel-9-for-x86_64-baseos-rpms
- rhel-9-for-x86_64-appstream-rpms
when: (( ansible_distribution == "RedHat" and ansible_distribution_major_version == '9'))
tags: rhsm
- name: Install required packages for RHEL 8
ansible.builtin.package:
name:
- git
- vim
- unzip
- wget
- bind-utils
- tar
- podman
- ansible
- jq
- python3-pip
- genisoimage
- nmstate
- dialog
state: latest
tags: install_packages
when: ( ansible_distribution == "RedHat" and ansible_distribution_major_version == '8')
- name: Install required packages for RHEL 9
ansible.builtin.package:
name:
- git
- vim
- unzip
- wget
- bind-utils
- tar
- podman
- ansible-core
- jq
- python3-pip
- genisoimage
- nmstate
- dialog
state: latest
tags: install_packages
when: ( ansible_distribution == "RedHat" and ansible_distribution_major_version == '9')
- name: Install required packages for CENTOS
ansible.builtin.package:
name:
- git
- vim
- unzip
- wget
- bind-utils
- tar
- podman
- ansible
- jq
- python3-pip
- genisoimage
- nmstate
- dialog
state: latest
tags: install_packages
when: (ansible_distribution == "CentOS")
- name: Install required packages for FEDORA
ansible.builtin.package:
name:
- git
- vim
- unzip
- wget
- bind-utils
- tar
- podman
- ansible
- jq
- python3-pip
- genisoimage
- nmstate
- dialog
state: latest
tags: install_packages
when: (ansible_distribution == "Fedora")
- name: Download Openshift Install Script
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/tosin2013/openshift-4-deployment-notes/master/pre-steps/configure-openshift-packages.sh
dest: /tmp/configure-openshift-packages.sh
mode: '0775'
tags: install_oc_cli
- name: Install OpenShift cli packages
ansible.builtin.command: /tmp/configure-openshift-packages.sh -i
tags: install_oc_cli
- name: openshift-virtualization-gitops clone
ansible.builtin.git:
repo: https://github.com/tosin2013/openshift-virtualization-gitops.git
dest: /home/admin/openshift-virtualization-gitops
single_branch: yes
version: main
tags: install_pip_modules
- name: Recursively change ownership of openshift-virtualization-gitops directory
ansible.builtin.file:
path: /home/admin/openshift-virtualization-gitops
state: directory
recurse: yes
owner: admin
group: admin
tags: install_pip_modules
- name: Install pip modules
ansible.builtin.pip:
requirements: "{{playbook_dir}}/scripts/requirements.txt"
tags: install_pip_modules
- name: Enable podman socket service
ansible.builtin.service:
name: podman.socket
enabled: true
tags: enable_podman_socket
- name: Start podman socket service
ansible.builtin.service:
name: podman.socket
state: started
tags: enable_podman_socket
- name: permit traffic in default zone on port 8081
ansible.posix.firewalld:
port: 8081/tcp
permanent: true
state: enabled
tags: configure_firewalld
- name: Download Example GitOps Script
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/tosin2013/openshift-virtualization-gitops/main/scripts/example_script.sh
dest: /root/example_script.sh
mode: '0775'
tags: copy_example_script