Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 1 | {% from 'virtual-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | {% from 'virtual-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL01 with context %} |
| 3 | {% from 'virtual-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL02 with context %} |
| 4 | {% from 'virtual-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL03 with context %} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 5 | {% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %} |
| 6 | {% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %} |
| 7 | |
Tatyana Leontovich | 0eb5ca3 | 2018-07-13 22:05:17 +0300 | [diff] [blame] | 8 | {% set DOMAIN_NAME = os_env('DOMAIN_NAME', 'virtual-pike-ovs-dpdk') %} |
| 9 | {% import 'shared-backup-restore.yaml' as BACKUP with context %} |
| 10 | {% import 'shared-salt.yaml' as SHARED with context %} |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 11 | {% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %} |
Tatyana Leontovich | 0eb5ca3 | 2018-07-13 22:05:17 +0300 | [diff] [blame] | 12 | |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 13 | # Install OpenStack control services |
| 14 | |
sgudz | 62df2fc | 2018-10-09 12:26:19 +0300 | [diff] [blame] | 15 | {{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 16 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 17 | {{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 18 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 19 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 20 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 21 | {{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 22 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 23 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 24 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 25 | {{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 26 | |
| 27 | - description: Deploy horizon dashboard |
| 28 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 29 | -C 'I@horizon:server' state.sls horizon |
| 30 | node_name: {{ HOSTNAME_CFG01 }} |
| 31 | retry: {count: 1, delay: 5} |
| 32 | skip_fail: true |
| 33 | |
| 34 | - description: Deploy nginx proxy |
| 35 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 36 | -C 'I@nginx:server' state.sls nginx |
| 37 | node_name: {{ HOSTNAME_CFG01 }} |
| 38 | retry: {count: 1, delay: 5} |
| 39 | skip_fail: true |
| 40 | |
| 41 | |
| 42 | # Install compute node |
| 43 | |
| 44 | - description: Apply formulas for compute node |
| 45 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 46 | node_name: {{ HOSTNAME_CFG01 }} |
| 47 | retry: {count: 1, delay: 5} |
| 48 | skip_fail: true |
| 49 | |
| 50 | - description: Re-apply(as in doc) formulas for compute node |
| 51 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 52 | node_name: {{ HOSTNAME_CFG01 }} |
| 53 | retry: {count: 1, delay: 5} |
Oleksii Butenko | 9f2601c | 2018-02-08 15:13:21 +0200 | [diff] [blame] | 54 | skip_fail: false |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 55 | |
| 56 | - description: Check IP on computes |
| 57 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run |
| 58 | 'ip a' |
| 59 | node_name: {{ HOSTNAME_CFG01 }} |
| 60 | retry: {count: 10, delay: 30} |
| 61 | skip_fail: false |
| 62 | |
| 63 | |
| 64 | # Upload cirros image |
| 65 | |
| 66 | - description: Upload cirros image on ctl01 |
| 67 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 68 | 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img' |
| 69 | node_name: {{ HOSTNAME_CFG01 }} |
| 70 | retry: {count: 2, delay: 30} |
| 71 | skip_fail: false |
| 72 | |
Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 73 | - description: Register image in glance |
| 74 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 75 | '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-0.3.4-i386-disk.img' |
| 76 | node_name: {{ HOSTNAME_CFG01 }} |
| 77 | retry: {count: 1, delay: 30} |
| 78 | skip_fail: false |
| 79 | |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 80 | - description: Create net04_external |
| 81 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 82 | '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat' |
| 83 | node_name: {{ HOSTNAME_CFG01 }} |
| 84 | retry: {count: 1, delay: 30} |
| 85 | skip_fail: false |
| 86 | |
| 87 | - description: Create subnet_external |
| 88 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 89 | '. /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' |
| 90 | node_name: {{ HOSTNAME_CFG01 }} |
| 91 | retry: {count: 1, delay: 30} |
| 92 | skip_fail: false |
| 93 | |
| 94 | - description: Create net04 |
| 95 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 96 | '. /root/keystonercv3; neutron net-create net04 --provider:network_type gre' |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 97 | node_name: {{ HOSTNAME_CFG01 }} |
| 98 | retry: {count: 1, delay: 30} |
| 99 | skip_fail: false |
| 100 | |
| 101 | - description: Create subnet_net04 |
| 102 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 103 | '. /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' |
| 104 | node_name: {{ HOSTNAME_CFG01 }} |
| 105 | retry: {count: 1, delay: 30} |
| 106 | skip_fail: false |
| 107 | |
| 108 | - description: Create router |
| 109 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 110 | '. /root/keystonercv3; neutron router-create net04_router01 --ha False' |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 111 | node_name: {{ HOSTNAME_CFG01 }} |
| 112 | retry: {count: 1, delay: 30} |
| 113 | skip_fail: false |
| 114 | |
| 115 | - description: Set geteway |
| 116 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 117 | '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext' |
| 118 | node_name: {{ HOSTNAME_CFG01 }} |
| 119 | retry: {count: 1, delay: 30} |
| 120 | skip_fail: false |
| 121 | |
| 122 | - description: Add interface |
| 123 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 124 | '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet' |
| 125 | node_name: {{ HOSTNAME_CFG01 }} |
| 126 | retry: {count: 1, delay: 30} |
| 127 | skip_fail: false |
| 128 | |
Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 129 | # Configure cinder-volume salt-call |
| 130 | - description: Set disks 01 |
| 131 | cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
| 132 | node_name: {{ HOSTNAME_CTL01 }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 133 | retry: {count: 1, delay: 30} |
| 134 | skip_fail: false |
| 135 | |
Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 136 | - description: Set disks 02 |
| 137 | cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
| 138 | node_name: {{ HOSTNAME_CTL02 }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 139 | retry: {count: 1, delay: 30} |
| 140 | skip_fail: false |
| 141 | |
Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 142 | - description: Set disks 03 |
| 143 | cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
| 144 | node_name: {{ HOSTNAME_CTL03 }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 145 | retry: {count: 1, delay: 30} |
| 146 | skip_fail: false |
| 147 | |
Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 148 | - description: Create partitions 01 |
| 149 | cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
| 150 | node_name: {{ HOSTNAME_CTL01 }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 151 | retry: {count: 1, delay: 30} |
| 152 | skip_fail: false |
| 153 | |
Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 154 | - description: Create partitions 02 |
| 155 | cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
| 156 | node_name: {{ HOSTNAME_CTL02 }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 157 | retry: {count: 1, delay: 30} |
| 158 | skip_fail: false |
| 159 | |
Tatyana Leontovich | b0b68d9 | 2018-01-11 13:27:08 +0200 | [diff] [blame] | 160 | - description: Create partitions 03 |
| 161 | cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
| 162 | node_name: {{ HOSTNAME_CTL03 }} |
Tatyana Leontovich | 56005da | 2017-12-11 13:16:51 +0200 | [diff] [blame] | 163 | retry: {count: 1, delay: 30} |
| 164 | skip_fail: false |
Tatyana Leontovich | 0eb5ca3 | 2018-07-13 22:05:17 +0300 | [diff] [blame] | 165 | |
| 166 | {{ SHARED.INSTALL_DOCKER_ON_GTW() }} |
| 167 | {{ BACKUP.MACRO_WR_NGINX_MASTER() }} |
| 168 | {{ BACKUP.MACRO_BACKUP_BACKUPNINJA() }} |
sgudz | 62df2fc | 2018-10-09 12:26:19 +0300 | [diff] [blame] | 169 | {{ BACKUP.MACRO_BACKUP_XTRABACKUP() }} |