forked from redhat-performance/jetpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shift_stack.yml
84 lines (72 loc) · 3.52 KB
/
shift_stack.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
---
- hosts: localhost
tasks:
- name: set ocp vars
include_vars:
dir: vars
files_matching: shift_stack_vars.yaml
- name: gather facts from undercloud
setup:
delegate_to: "{{ undercloud_hostname }}"
delegate_facts: False
vars:
ansible_python_interpreter: "{{ python_interpreter }}"
ansible_user: "stack"
- name: set dns server fact
set_fact:
dns_server: "{{ ansible_dns.nameservers[0] }}"
- name: get public network
shell: |
ip r | grep default | cut -d ' ' -f5
register: public_network
delegate_to: "{{ undercloud_hostname }}"
vars:
ansible_python_interpreter: "{{ python_interpreter }}"
ansible_user: "stack"
- name: add masquerade rule
shell: |
sudo iptables -t nat -A POSTROUTING -o {{ public_network.stdout }} -j MASQUERADE
changed_when: false
delegate_to: "{{ undercloud_hostname }}"
vars:
ansible_python_interpreter: "{{ python_interpreter }}"
ansible_user: "stack"
- name: gather local facts
setup:
delegate_to: localhost
delegate_facts: False
- name: prepare ir_external_oc_subnet.yaml
template:
src: ir_external_oc_subnet.yaml.j2
dest: "{{ ansible_user_dir }}/ir_external_oc_subnet.yaml"
- name: set fact external_oc_subnet
set_fact:
external_oc_subnet: "{{ ansible_user_dir }}/ir_external_oc_subnet.yaml"
- name: set ocp_tasks facts
set_fact:
tasks_ocp: "{{ ocp_tasks | join(',') }}"
when: ( ocp_tasks is defined and ocp_tasks|length>0 )
- name: Run infrared cloud-config to create external network
shell: |
source .venv/bin/activate
infrared cloud-config --deployment-files {{ nic_configs }} --public-subnet {{ external_oc_subnet }} --network-protocol ipv4 --public-net-name {{ public_net_name }} --tasks {{ tasks_ocp }} > {{ log_directory }}/cloud_config.log 2>&1
args:
chdir: "{{ infrared_dir }}"
- name: clone openshift infrared plugin
shell: |
GIT_SSL_NO_VERIFY=true git clone https://code.engineering.redhat.com/gerrit/openshift-ir-plugin
source ../.venv/bin/activate && ir plugin add openshift-ir-plugin
args:
chdir: "{{ infrared_dir }}/plugins"
- name: openshift prepare
shell: |
source .venv/bin/activate
infrared openshift -o openshift-prepare.yml --prepare yes --install no --post no --openstack-version {{ osp_release }} --openstack-build {{ osp_puddle }} --openshift-puddle {{ ocp_puddle }} --openshift-release {{ ocp_release }} --openshift-separated-project yes --overcloud-cloud overcloud --openstack-ssl no --dns {{ dns_server }} > {{ log_directory }}/ocp_prepare.log 2>&1
args:
chdir: "{{ infrared_dir }}"
- name: openshift install
shell: |
source .venv/bin/activate
infrared openshift -o openshift-install.yml --prepare no --install yes --post no --openstack-public-network {{ public_net_name }} --openstack-version {{ osp_release }} --openstack-build {{ osp_puddle }} --openshift-puddle {{ ocp_puddle }} --openshift-release {{ ocp_release }} --openshift-master {{ master_nodes }} --openshift-node {{ worker_nodes }} --openshift-separated-project yes --overcloud-cloud overcloud --openshift-network-type {{ ocp_network_type }} --openshift-etcd-ramdisk false --openstack-ssl no --dns {{ dns_server }} > {{ log_directory }}/ocp_install.log 2>&1
args:
chdir: "{{ infrared_dir }}"