-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpre-ocp-install.yaml
75 lines (66 loc) · 2.29 KB
/
pre-ocp-install.yaml
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: localhost
remote_user: root
tasks:
- stat:
path: ~/.ssh/id_rsa.pub
register: rsa_key
- name: Generating RSA key
shell: ssh-keygen -t rsa -N '' -f ~/.ssh/id_rsa
when: rsa_key.stat.islnk is not defined
- name: deplay SSH Key for all host using root \ "{{ ssh_password }}"
shell: sshpass -p {{ ssh_password }} ssh-copy-id -o StrictHostKeyChecking=no root@{{ item }}
with_items: "{{ groups['nodes'] }}"
- hosts: nodes
remote_user: root
tasks:
- name: Update subscription auth server
shell: sed -i "s/hostname = .*/hostname = {{ auth_server}}/g" /etc/rhsm/rhsm.conf
- name: Register as user ("{{ subscription_username }}").
redhat_subscription:
state: present
username: "{{ subscription_username }}"
password: "{{ subscription_password }}"
pool_ids: "{{ pool_id }}"
autosubscribe: true
- name: Enable repositories
shell: subscription-manager repos --enable="rhel-7-server-rpms" --enable="rhel-7-server-extras-rpms" --enable="rhel-7-server-ose-3.7-rpms" --enable="rhel-7-fast-datapath-rpms"
- name: Updating yum to latest
yum:
name: '*'
state: latest
- name: Install OCP reqired packages\rpms
yum:
name: "{{ item }}"
state: latest
with_items:
- atomic-openshift-excluder
- atomic-openshift-docker-excluder
- atomic-openshift-utils
- wget
- git
- net-tools
- bind-utils
- iptables-services
- bridge-utils
- bash-completion
- kexec-tools
- sos
- psacct
- sshpass
- name: Install iSCSI reqired packages\rpms
yum:
name: "{{ item }}"
state: latest
with_items:
- sg3_utils
- iscsi-initiator-utils
- name: Post installations actions
shell: atomic-openshift-excluder unexclude
- name: Install RHEV agent
shell: |
subscription-manager repos --enable rhel-7-server-rh-common-rpms
yum -y install rhevm-guest-agent-common
systemctl start ovirt-guest-agent.service
systemctl enable ovirt-guest-agent.service
subscription-manager repos --disable rhel-7-server-rh-common-rpms