-
Notifications
You must be signed in to change notification settings - Fork 16
/
post.yml
77 lines (68 loc) · 2.97 KB
/
post.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
---
- hosts: undercloud
become: yes
become_user: stack
tasks:
- name: set REQUESTS_CA_BUNDLE in .bash_profile
lineinfile:
path: /home/stack/.bash_profile
line: export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-bundle.crt
state: present
when: tls_everywhere == true
- name: get default route
shell: |
ip r | grep default | cut -d ' ' -f5
register: default_route
become: true
when: external_network_vlan_id is defined
- name: masquerade on public interface
shell: |
iptables -t nat -A POSTROUTING -o {{ default_route.stdout }} -j MASQUERADE
become: true
become_user: root
when: external_network_vlan_id is defined
- name: create nvme flavor
shell: |
source /home/stack/overcloudrc
openstack flavor create --ram {{ passthrough_nvme.flavor.ram }} --disk {{ passthrough_nvme.flavor.disk }} --vcpus {{ passthrough_nvme.flavor.vcpus }} --public {{ passthrough_nvme.flavor.name }}
changed_when: false
ignore_errors: true
when: passthrough_nvme is defined
- name: set pci passthough for flavor
shell: |
source /home/stack/overcloudrc
openstack flavor set {{ passthrough_nvme.flavor.name }} --property "pci_passthrough:alias"="nvme:1"
changed_when: false
when: passthrough_nvme is defined
- name: set public_net_name
set_fact:
public_net_name: "{{ public_net_name|default('public') }}"
- name: create external network
shell: |
source /home/stack/overcloudrc
neutron net-create --router:external=True --provider:network_type flat --provider:physical_network datacentre {{ public_net_name }}
changed_when: false
ignore_errors: true
when: external_network_vlan_id is not defined
- name: create external network
shell: |
source /home/stack/overcloudrc
neutron net-create --router:external=True --provider:network_type vlan --provider:physical_network datacentre --provider:segmentation_id {{ external_network_vlan_id }} {{ public_net_name }}
changed_when: false
ignore_errors: true
when: external_network_vlan_id is defined
- name: create external subnet
vars:
gateway_address: "{{ external_gateway.split('/')[0] }}"
shell: |
source /home/stack/overcloudrc
neutron subnet-create --ip_version 4 --gateway {{ gateway_address }} --allocation-pool start={{ overcloud_external_net_alloc_start }},end={{ overcloud_external_net_alloc_end }} --disable-dhcp {{ public_net_name }} {{ external_net_cidr }}
changed_when: false
ignore_errors: true
- name: run post overcloud deploy
vars:
share_type_name: default
allocation_pool_start: "{{ storage_nfs_allocation_pools_start.split('.')[0:3] | join('.') }}.150"
allocation_pool_end: "{{ storage_nfs_allocation_pools_end.split('.')[0:3] | join('.') }}.250"
include_tasks: tasks/manila.yml
when: manila_enabled