-
Notifications
You must be signed in to change notification settings - Fork 0
/
InstallOpenShiftBastion.yml
97 lines (82 loc) · 3.03 KB
/
InstallOpenShiftBastion.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
---
- hosts: all
vars:
# Install
tasks:
- name: Create .openshift directory if it does not exist
file:
path: ~/.openshift
state: directory
mode: '0755'
- name: Create /tmp/ocp4 directory if it does not exist
file:
path: /tmp/ocp4
state: directory
mode: '0755'
#Trouver comment mettre le fichier pull-secret
- name: Donwload file for ocp4
unarchive:
src: http://mirror.openshift.com/pub/openshift-v4/clients/ocp/4.2.14/openshift-client-linux-4.2.14.tar.gz
dest: /tmp/ocp4
remote_src: yes
- name: Donwload file for ocp4
unarchive:
src: http://mirror.openshift.com/pub/openshift-v4/clients/ocp/4.2.14/openshift-install-linux-4.2.14.tar.gz
dest: /tmp/ocp4
remote_src: yes
- name: Move files to /usr/local/bin
copy:
src: /tmp/ocp4/{{ item }}
dest: /usr/local/bin
mode: '0755'
remote_src: yes
with_items:
- oc
- kubectl
- openshift-install
- name: Create .ssh directory if it does not exist
file:
path: ~/.ssh
state: directory
mode: '0755'
- name: Create SSH Key
openssh_keypair:
path: ~/.ssh/id_rsa
- name: Create .openshift directory if it does not exist
file:
path: ~/openshift4
state: directory
mode: '0755'
#Utiliser Template pour faire le fichier install-config.yaml
- name: Download append-bootstrap.ign
get_url:
url: http://webocp4.fuji.bsctdas.local/ocp4file/install-config.yaml
dest: ~/openshift4/install-config.yaml
- name: Create manifests for OpenShift
command: openshift-install create manifests --dir ~/openshift4
#- name: Change masterSchedulable true to false
# command: "sed -i 's/mastersSchedulable: true/mastersSchedulable: false/g' manifests/cluster-scheduler-02-config.yml"
# - name: Ensure SELinux is set to enforcing mode
# lineinfile:
# path: ~/openshift4/manifests/cluster-scheduler-02-config.yml
# regexp: 'mastersSchedulable: true'
# line: "mastersSchedulable: false"
# - name: Create ignition for OpenShift
# command: openshift-install create ignition-configs --dir ~/openshift4
# Trouver pour créer append-bootstrap.ign
- name: Download append-bootstrap.ign
get_url:
url: http://webocp4.fuji.bsctdas.local/ocp4file/append-bootstrap.ign
dest: ~/openshift4/append-bootstrap.ign
# - name: Transfer bootstrap ignifition file from Bastion to Webserver
# synchronize:
# src: ~/openshift4/bootstrap.ign
# dest: rsync://{{ webserver }}/var/www/html/ignition/test/bootstrap.ign
# mode: pull
# delegate_to: "10.50.51.107"
- name: Convert ignition files to base64
command: "base64 -w0 {{item }}.ign > {{ item }}.64"
with_items:
- append-bootstrap
# - master
# - worker