-
Notifications
You must be signed in to change notification settings - Fork 5
/
ocp-preinstall.yml
111 lines (98 loc) · 2.65 KB
/
ocp-preinstall.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
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
# file: ocp-rpm-preinstall.yml
# Authors: Mike Flannery (mflanner@redhat.com) & John Call (jcall@redhat.com)
# Invocation: ansible-playbook ocp-rpm-preinstall.yml
#
# Updated: April 5th, 2018 for OCP/CNS 3.9
# https://access.redhat.com/documentation/en-us/openshift_container_platform/3.9/html-single/installation_and_configuration/#install-config-install-advanced-install
---
- hosts: all
become: true
vars:
repos:
repo_list:
- rhel-7-server-rpms
- rhel-7-server-extras-rpms
- rhel-7-server-ansible-2.4-rpms
- rhel-7-server-ose-3.9-rpms
- rhel-7-fast-datapath-rpms
- rh-gluster-3-client-for-rhel-7-server-rpms
# vars_prompt:
# - name: "rhsm_username"
# prompt: "Enter RHN/RHSM Username"
# private: no
#
# - name: "rhsm_password"
# prompt: "Enter RHN/RHSM Password"
# private: yes
#
# - name: "poolid"
# prompt: "Enter Red Hat Pool ID"
# private: no
tasks:
- block:
- name: Register with Red Hat
redhat_subscription:
state: present
username: "{{ rhsm_username }}"
password: "{{ rhsm_password }}"
autosubscribe: false
async: 300
poll: 10
- name: Attach Pool
command: subscription-manager attach --pool={{ poolid }}
async: 300
poll: 10
tags: [rhsm]
# end block
- block:
- set_fact:
repos: "{{ repo_list | join(' --enable=') }}"
- debug:
var: repos
- name: Enable repos for RHEL7
command: subscription-manager repos --disable="*" --enable={{ repos }}
tags: [repos]
#end block
- name: Install required RPMs
yum:
name: "{{ item }}"
state: latest
with_items:
- wget
- git
- net-tools
- bind-utils
- iptables-services
- bridge-utils
- bash-completion
- kexec-tools
- sos
- psacct
- atomic-openshift-utils
- docker-1.13.1
tags: [rpms]
- block:
# - name: "Extend /dev/sda1"
# command: growpart /dev/sda 1
# - name: "Grow /dev/sda1"
# command: xfs_growfs /
- name: "Setup docker-storage-setup"
copy:
content: |
STORAGE_DRIVER=devicemapper
DEVS=/dev/sda
VG=docker_vg
CONTAINER_THINPOOL=docker_pool
dest: /etc/sysconfig/docker-storage-setup
- name: "Run docker-storage-setup"
command: docker-storage-setup
- name: "Start and enable docker"
systemd:
unit: docker.service
state: restarted
enabled: yes
tags: [ test ]
# end block
# - name: Reboot to apply any updates, and clear cloud-init state
# command: systemctl reboot
# tags: reboot