Tatyana Leontovich | 8dbc788 | 2018-08-29 13:11:16 +0300 | [diff] [blame^] | 1 | {% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | {% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL01 with context %} |
| 3 | {% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL02 with context %} |
| 4 | {% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL03 with context %} |
| 5 | {% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_GTW01 with context %} |
| 6 | {% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %} |
| 7 | {% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %} |
| 8 | {% set REPOSITORY_SUITE = os_env('REPOSITORY_SUITE', 'testing') %} |
| 9 | # Install OpenStack control services |
| 10 | {% set DOMAIN_NAME = os_env('DOMAIN_NAME', 'virtual-offline-pike-ovs-dpdk') %} |
| 11 | {% import 'shared-backup-restore.yaml' as BACKUP with context %} |
| 12 | {% import 'shared-salt.yaml' as SHARED with context %} |
| 13 | {% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %} |
| 14 | |
| 15 | {% set DOCKER_LOCAL_REPO = os_env('DOCKER_LOCAL_REPO', 'deb [arch=amd64] http://mirror.mcp.mirantis.local.test/ubuntu-xenial/docker ' + REPOSITORY_SUITE + ' stable') %} |
| 16 | |
| 17 | # Upload cirros image |
| 18 | - description: Upload cirros image on ctl01 |
| 19 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 20 | 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img' |
| 21 | node_name: {{ HOSTNAME_CFG01 }} |
| 22 | retry: {count: 2, delay: 30} |
| 23 | skip_fail: false |
| 24 | |
| 25 | - description: Create net04_external |
| 26 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 27 | '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat' |
| 28 | node_name: {{ HOSTNAME_CFG01 }} |
| 29 | retry: {count: 1, delay: 30} |
| 30 | skip_fail: false |
| 31 | |
| 32 | - description: Create subnet_external |
| 33 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 34 | '. /root/keystonercv3; neutron subnet-create net04_ext {{ IPV4_NET_EXTERNAL_PREFIX }}.0/24 --name net04_ext__subnet --disable-dhcp --allocation-pool start={{ IPV4_NET_EXTERNAL_PREFIX }}.150,end={{ IPV4_NET_EXTERNAL_PREFIX }}.180 --gateway {{ IPV4_NET_EXTERNAL_PREFIX }}.1' |
| 35 | node_name: {{ HOSTNAME_CFG01 }} |
| 36 | retry: {count: 1, delay: 30} |
| 37 | skip_fail: false |
| 38 | |
| 39 | - description: Create net04 |
| 40 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 41 | '. /root/keystonercv3; neutron net-create net04' |
| 42 | node_name: {{ HOSTNAME_CFG01 }} |
| 43 | retry: {count: 1, delay: 30} |
| 44 | skip_fail: false |
| 45 | |
| 46 | - description: Create subnet_net04 |
| 47 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 48 | '. /root/keystonercv3; neutron subnet-create net04 {{ IPV4_NET_TENANT_PREFIX }}.0/24 --name net04__subnet --allocation-pool start={{ IPV4_NET_TENANT_PREFIX }}.120,end={{ IPV4_NET_TENANT_PREFIX }}.240' |
| 49 | node_name: {{ HOSTNAME_CFG01 }} |
| 50 | retry: {count: 1, delay: 30} |
| 51 | skip_fail: false |
| 52 | |
| 53 | - description: Create router |
| 54 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 55 | '. /root/keystonercv3; neutron router-create net04_router01' |
| 56 | node_name: {{ HOSTNAME_CFG01 }} |
| 57 | retry: {count: 1, delay: 30} |
| 58 | skip_fail: false |
| 59 | |
| 60 | - description: Set geteway |
| 61 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 62 | '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext' |
| 63 | node_name: {{ HOSTNAME_CFG01 }} |
| 64 | retry: {count: 1, delay: 30} |
| 65 | skip_fail: false |
| 66 | |
| 67 | - description: Add interface |
| 68 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 69 | '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet' |
| 70 | node_name: {{ HOSTNAME_CFG01 }} |
| 71 | retry: {count: 1, delay: 30} |
| 72 | skip_fail: false |
| 73 | |
| 74 | - description: sync time |
| 75 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run |
| 76 | 'service ntp stop; ntpd -gq; service ntp start' |
| 77 | node_name: {{ HOSTNAME_CFG01 }} |
| 78 | retry: {count: 1, delay: 30} |
| 79 | skip_fail: false |
| 80 | |
| 81 | - description: Enable local docker repo |
| 82 | cmd: | |
| 83 | set -e; |
| 84 | echo "{{ DOCKER_LOCAL_REPO }}" > /etc/apt/sources.list.d/mcp_docker.list; |
| 85 | apt-get clean; apt-get update; |
| 86 | node_name: {{ HOSTNAME_GTW01 }} |
| 87 | retry: {count: 1, delay: 30} |
| 88 | skip_fail: false |
| 89 | |
| 90 | - description: Install docker-ce on gtw |
| 91 | cmd: salt-call cmd.run 'apt-get install docker-ce -y' |
| 92 | node_name: {{ HOSTNAME_GTW01 }} |
| 93 | retry: {count: 1, delay: 30} |
| 94 | skip_fail: false |
| 95 | |
| 96 | - description: Enable forward policy on gtw |
| 97 | cmd: | |
| 98 | set -e; |
| 99 | iptables --policy FORWARD ACCEPT; |
| 100 | node_name: {{ HOSTNAME_GTW01 }} |
| 101 | retry: {count: 1, delay: 30} |
| 102 | skip_fail: false |
| 103 | |
| 104 | - description: create rc file on cfg |
| 105 | cmd: scp ctl01:/root/keystonercv3 /root |
| 106 | node_name: {{ HOSTNAME_CFG01 }} |
| 107 | retry: {count: 1, delay: 30} |
| 108 | skip_fail: false |
| 109 | |
| 110 | - description: Copy rc file |
| 111 | cmd: scp /root/keystonercv3 gtw01:/root |
| 112 | node_name: {{ HOSTNAME_CFG01 }} |
| 113 | retry: {count: 1, delay: 30} |
| 114 | skip_fail: false |
| 115 | |
| 116 | {{ BACKUP.MACRO_WR_NGINX_MASTER() }} |
| 117 | {{ BACKUP.MACRO_BACKUP_BACKUPNINJA() }} |
| 118 | {{ BACKUP.MACRO_BACKUP_XTRABACKUP() }} |