forked from MarcNo/openshift-home-lab
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprep-os-for-bastion.yml
75 lines (61 loc) · 2.05 KB
/
prep-os-for-bastion.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
- hosts: jump
# sudo: True
become: yes
tasks:
- name: "Get variables"
include_vars:
file: vault.yml # contains vault_rhn_username and vault_rhn_password
- name: "Get secrets"
include_vars:
file: variables.yml # contains openshift_subscription_pool
- name: Force unregister before register
redhat_subscription:
state: absent
ignore_errors: true
- name: register node with subscription-manager
redhat_subscription: state=present username={{ vault_rhn_username }} password={{ vault_rhn_password }} autosubscribe=false
register: task_result
until: task_result is succeeded
retries: 10
delay: 5
- name: "attach node to subscription pool"
command: subscription-manager attach --pool {{ item }}
register: task_result
until: task_result.rc == 0
retries: 10
delay: 1
ignore_errors: no
with_items: '{{openshift_subscription_pool}}'
- name: "Disable all the enabled RHSM repositories"
shell: subscription-manager repos --disable="*"
- name: "Add repositories for OpenShift 3.11"
shell: subscription-manager repos --enable="rhel-7-server-rpms" --enable="rhel-7-server-extras-rpms" --enable="rhel-7-server-ose-3.11-rpms" --enable="rhel-7-fast-datapath-rpms" --enable="rhel-7-server-ansible-2.6-rpms"
- name: "Update the system"
yum:
name: '*'
state: latest
- name: "Install required packages"
yum: name={{ item }} state=present
with_items:
- wget
- git
- net-tools
- bind-utils
- iptables-services
- bridge-utils
- bash-completion
- kexec-tools
- sos
- psacct
- yum-utils
- openshift-ansible
- docker
- name: "Ansible and scripts to drive the openshift installation"
yum: name={{ item }} state=present
with_items:
- openshift-ansible
- ansible
# - name: "Nice to have extra packages"
# yum: name={{ item }} state=present
# with_items:
# - emacs-nox