-
Notifications
You must be signed in to change notification settings - Fork 25
/
deploy.yml
80 lines (69 loc) · 2.17 KB
/
deploy.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
---
- hosts: localhost
roles:
- { role: azure_infra, tags: infra }
# The Azure VMs are provisioned asynchronously. It can take some time
# until they are reachable via SSH, even after Azure reports that the
# provisioning state is "Succeeded".
- hosts: nodes
gather_facts: no
tasks:
- name: Wait for nodes to become reachable via SSH
wait_for_connection:
sleep: 30
timeout: 1200
connect_timeout: 10
- hosts: nodes
roles:
- { role: ocp_pre, tags: ocp-pre }
- name: call openshift prerequisites play
import_playbook: /usr/share/ansible/openshift-ansible/playbooks/prerequisites.yml
tags:
- ocp-pre
- ocp-deploy
- name: call openshift deploy_cluster play
import_playbook: /usr/share/ansible/openshift-ansible/playbooks/deploy_cluster.yml
tags: ocp-deploy
- name: install Grafana
import_playbook: /usr/share/ansible/openshift-ansible/playbooks/openshift-grafana/config.yml
tags:
- logging-metrics
- ocp-deploy
- hosts: nodes
roles:
- { role: ocp_post, tags: ocp-post }
- hosts: localhost
tasks:
- name: Copy kube config to installation host
fetch:
src: /home/{{ admin_user }}/.kube/config
dest: ~/.kube/
flat: yes
delegate_to: "{{ groups.masters[0] }}"
tags: ocp-post
# The bastion is not part of the Ansible inventory file.
- name: Add bastion host
add_host:
name: bastion
groups: bastions
ansible_user: "{{ admin_user }}"
ansible_become: True
tags: ocp-post
- name: Copy kube config to bastion host
copy:
src: ~/.kube/config
dest: /home/{{ admin_user }}/.kube/
delegate_to: bastion
tags: ocp-post
- name: Configure internal master LB
import_playbook: activate-internal-lb.yml
when: master_lb_private_ip is defined
- hosts: localhost
vars:
admin: "{{ openshift_master_htpasswd_users.keys() | to_nice_yaml }}"
tasks:
# This only works after the activate-internal-lb.yml playbook has
# been run, if an internal Azure load balancer is being used.
- name: add cluster-admin
shell: oc adm policy add-cluster-role-to-user cluster-admin {{ admin }}
tags: ocp-post