Vladimir Khlyunev | 25f1e74 | 2018-11-07 16:52:10 +0400 | [diff] [blame] | 1 | {% from 'cookied-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | {% from 'cookied-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CTL01 with context %} |
| 3 | {% from 'cookied-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CTL02 with context %} |
| 4 | {% from 'cookied-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CTL03 with context %} |
| 5 | {% from 'cookied-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_GTW01 with context %} |
Sergii Golovatiuk | 50f9189 | 2017-08-04 18:11:06 +0200 | [diff] [blame] | 6 | {% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %} |
| 7 | {% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %} |
Dmitry Tyzhnenko | 8f6a63e | 2017-09-05 15:37:23 +0300 | [diff] [blame] | 8 | {% set LAB_CONFIG_NAME = os_env('LAB_CONFIG_NAME') %} |
Tatyana Leontovich | d08f881 | 2017-11-09 12:52:21 +0200 | [diff] [blame] | 9 | {% set OVERRIDE_POLICY = os_env('OVERRIDE_POLICY', '') %} |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 10 | |
ibumarskov | 942417e | 2018-08-23 22:05:59 +0400 | [diff] [blame] | 11 | {% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %} |
Pavel Glazov | 78e6c59 | 2018-10-24 12:20:12 +0400 | [diff] [blame^] | 12 | {% import 'shared-salt.yaml' as SHARED with context %} |
ibumarskov | 942417e | 2018-08-23 22:05:59 +0400 | [diff] [blame] | 13 | |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 14 | # Install OpenStack control services |
| 15 | |
Tatyana Leontovich | d08f881 | 2017-11-09 12:52:21 +0200 | [diff] [blame] | 16 | {%- if OVERRIDE_POLICY != '' %} |
Dmitry Tyzhnenko | 8f6a63e | 2017-09-05 15:37:23 +0300 | [diff] [blame] | 17 | - description: Upload policy override |
| 18 | upload: |
| 19 | local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/ |
| 20 | local_filename: overrides-policy.yml |
| 21 | remote_path: /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/ |
| 22 | node_name: {{ HOSTNAME_CFG01 }} |
| 23 | |
| 24 | - description: Create custom cluster control class |
| 25 | cmd: echo -e "classes:\n- cluster.{{ LAB_CONFIG_NAME }}.openstack.control_orig\n$(cat /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml)" > /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml |
| 26 | node_name: {{ HOSTNAME_CFG01 }} |
| 27 | |
| 28 | - description: Rename control classes |
| 29 | cmd: mv /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control_orig.yml && |
| 30 | ln -s /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml && |
| 31 | salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all && |
| 32 | salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar |
| 33 | node_name: {{ HOSTNAME_CFG01 }} |
Dmitry Tyzhnenko | 33eea15 | 2017-11-02 23:25:09 +0200 | [diff] [blame] | 34 | {%- endif %} |
Dmitry Tyzhnenko | 8f6a63e | 2017-09-05 15:37:23 +0300 | [diff] [blame] | 35 | |
ibumarskov | 7bdc7ed | 2018-08-24 12:06:38 +0400 | [diff] [blame] | 36 | # Deploy nginx before openstack services (PROD-22740) |
| 37 | - description: Deploy nginx proxy |
| 38 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 39 | -C 'I@nginx:server' state.sls nginx |
| 40 | node_name: {{ HOSTNAME_CFG01 }} |
| 41 | retry: {count: 1, delay: 5} |
| 42 | skip_fail: true |
| 43 | |
sgudz | 62df2fc | 2018-10-09 12:26:19 +0300 | [diff] [blame] | 44 | {{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }} |
ibumarskov | e23c10e | 2018-08-20 15:47:58 +0400 | [diff] [blame] | 45 | |
ibumarskov | 7e88667 | 2018-08-23 13:52:13 +0400 | [diff] [blame] | 46 | {{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }} |
Dennis Dmitriev | 4ab889c | 2017-04-27 14:11:04 +0300 | [diff] [blame] | 47 | |
ibumarskov | 7e88667 | 2018-08-23 13:52:13 +0400 | [diff] [blame] | 48 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }} |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 49 | |
ibumarskov | 7e88667 | 2018-08-23 13:52:13 +0400 | [diff] [blame] | 50 | {{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }} |
Tatyana Leontovich | fa7ae4d | 2017-04-25 13:46:14 +0300 | [diff] [blame] | 51 | |
ibumarskov | 7e88667 | 2018-08-23 13:52:13 +0400 | [diff] [blame] | 52 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }} |
Tatyana Leontovich | fa7ae4d | 2017-04-25 13:46:14 +0300 | [diff] [blame] | 53 | |
ibumarskov | 7e88667 | 2018-08-23 13:52:13 +0400 | [diff] [blame] | 54 | {{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }} |
Dennis Dmitriev | 4ab889c | 2017-04-27 14:11:04 +0300 | [diff] [blame] | 55 | |
ibumarskov | 7e88667 | 2018-08-23 13:52:13 +0400 | [diff] [blame] | 56 | # install designate backend |
Tatyana Leontovich | c33be1f | 2017-07-19 17:38:30 +0300 | [diff] [blame] | 57 | - description: Install powerdns |
| 58 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Tatyana Leontovich | 8d815a8 | 2017-10-05 16:01:26 +0300 | [diff] [blame] | 59 | -C 'I@powerdns:server' state.sls powerdns.server |
Tatyana Leontovich | c33be1f | 2017-07-19 17:38:30 +0300 | [diff] [blame] | 60 | node_name: {{ HOSTNAME_CFG01 }} |
| 61 | retry: {count: 1, delay: 5} |
| 62 | skip_fail: false |
| 63 | |
ibumarskov | 7e88667 | 2018-08-23 13:52:13 +0400 | [diff] [blame] | 64 | {{ SHARED_OPENSTACK.MACRO_INSTALL_DESIGNATE() }} |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 65 | |
ibumarskov | 7e88667 | 2018-08-23 13:52:13 +0400 | [diff] [blame] | 66 | {{ SHARED_OPENSTACK.MACRO_INSTALL_HORIZON() }} |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 67 | |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 68 | # Install compute node |
| 69 | |
| 70 | - description: Apply formulas for compute node |
| 71 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 72 | node_name: {{ HOSTNAME_CFG01 }} |
| 73 | retry: {count: 1, delay: 5} |
| 74 | skip_fail: true |
| 75 | |
| 76 | - description: Re-apply(as in doc) formulas for compute node |
| 77 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 78 | node_name: {{ HOSTNAME_CFG01 }} |
| 79 | retry: {count: 1, delay: 5} |
Oleksii Butenko | 9f2601c | 2018-02-08 15:13:21 +0200 | [diff] [blame] | 80 | skip_fail: false |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 81 | |
| 82 | - description: Check IP on computes |
| 83 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run |
| 84 | 'ip a' |
| 85 | node_name: {{ HOSTNAME_CFG01 }} |
| 86 | retry: {count: 10, delay: 30} |
| 87 | skip_fail: false |
Oleksandr Ivashchenko | a95a72b | 2017-06-06 15:55:59 +0300 | [diff] [blame] | 88 | |
| 89 | |
| 90 | # Upload cirros image |
| 91 | |
| 92 | - description: Upload cirros image on ctl01 |
| 93 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
ibumarskov | 2cea0d4 | 2018-07-24 08:40:50 +0400 | [diff] [blame] | 94 | 'wget http://images.mirantis.com.s3.amazonaws.com/cirros-x64-20170828.qcow2' |
Oleksandr Ivashchenko | a95a72b | 2017-06-06 15:55:59 +0300 | [diff] [blame] | 95 | node_name: {{ HOSTNAME_CFG01 }} |
| 96 | retry: {count: 2, delay: 30} |
| 97 | skip_fail: false |
| 98 | |
| 99 | - description: Register image in glance |
| 100 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
ibumarskov | 2cea0d4 | 2018-07-24 08:40:50 +0400 | [diff] [blame] | 101 | '. /root/keystonercv3; glance --timeout 120 image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-x64-20170828.qcow2' |
Oleksandr Ivashchenko | a95a72b | 2017-06-06 15:55:59 +0300 | [diff] [blame] | 102 | node_name: {{ HOSTNAME_CFG01 }} |
| 103 | retry: {count: 1, delay: 30} |
| 104 | skip_fail: false |
| 105 | |
| 106 | - description: Create net04_external |
| 107 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
Tatyana Leontovich | 674abf8 | 2017-07-20 15:44:15 +0300 | [diff] [blame] | 108 | '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat' |
Oleksandr Ivashchenko | a95a72b | 2017-06-06 15:55:59 +0300 | [diff] [blame] | 109 | node_name: {{ HOSTNAME_CFG01 }} |
| 110 | retry: {count: 1, delay: 30} |
| 111 | skip_fail: false |
| 112 | |
| 113 | - description: Create subnet_external |
| 114 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 115 | '. /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' |
| 116 | node_name: {{ HOSTNAME_CFG01 }} |
| 117 | retry: {count: 1, delay: 30} |
| 118 | skip_fail: false |
| 119 | |
| 120 | - description: Create net04 |
| 121 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 122 | '. /root/keystonercv3; neutron net-create net04' |
| 123 | node_name: {{ HOSTNAME_CFG01 }} |
| 124 | retry: {count: 1, delay: 30} |
| 125 | skip_fail: false |
| 126 | |
| 127 | - description: Create subnet_net04 |
| 128 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 129 | '. /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' |
| 130 | node_name: {{ HOSTNAME_CFG01 }} |
| 131 | retry: {count: 1, delay: 30} |
| 132 | skip_fail: false |
| 133 | |
| 134 | - description: Create router |
| 135 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 136 | '. /root/keystonercv3; neutron router-create net04_router01' |
| 137 | node_name: {{ HOSTNAME_CFG01 }} |
| 138 | retry: {count: 1, delay: 30} |
| 139 | skip_fail: false |
| 140 | |
ibumarskov | c075df8 | 2018-07-30 13:23:07 +0400 | [diff] [blame] | 141 | - description: Set gateway |
Oleksandr Ivashchenko | a95a72b | 2017-06-06 15:55:59 +0300 | [diff] [blame] | 142 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 143 | '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext' |
| 144 | node_name: {{ HOSTNAME_CFG01 }} |
| 145 | retry: {count: 1, delay: 30} |
| 146 | skip_fail: false |
| 147 | |
| 148 | - description: Add interface |
| 149 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 150 | '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet' |
| 151 | node_name: {{ HOSTNAME_CFG01 }} |
| 152 | retry: {count: 1, delay: 30} |
| 153 | skip_fail: false |
| 154 | |
| 155 | - description: Allow all tcp |
| 156 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 157 | '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0' |
| 158 | node_name: {{ HOSTNAME_CFG01 }} |
| 159 | retry: {count: 1, delay: 30} |
| 160 | skip_fail: false |
| 161 | |
| 162 | - description: Allow all icmp |
| 163 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 164 | '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0' |
| 165 | node_name: {{ HOSTNAME_CFG01 }} |
| 166 | retry: {count: 1, delay: 30} |
| 167 | skip_fail: false |
| 168 | |
Tatyana Leontovich | fa31b39 | 2017-07-24 18:37:41 +0300 | [diff] [blame] | 169 | - description: sync time |
| 170 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run |
| 171 | 'service ntp stop; ntpd -gq; service ntp start' |
| 172 | node_name: {{ HOSTNAME_CFG01 }} |
| 173 | retry: {count: 1, delay: 30} |
| 174 | skip_fail: false |
| 175 | |
Pavel Glazov | 78e6c59 | 2018-10-24 12:20:12 +0400 | [diff] [blame^] | 176 | {{ SHARED.INSTALL_DOCKER_ON_GTW() }} |
Tatyana Leontovich | d6bcbc9 | 2018-03-23 15:02:28 +0200 | [diff] [blame] | 177 | |
Tatyana Leontovich | 7c97e80 | 2017-07-19 17:08:39 +0300 | [diff] [blame] | 178 | - description: create rc file on cfg |
| 179 | cmd: scp ctl01:/root/keystonercv3 /root |
| 180 | node_name: {{ HOSTNAME_CFG01 }} |
| 181 | retry: {count: 1, delay: 30} |
| 182 | skip_fail: false |
| 183 | |
| 184 | - description: Copy rc file |
| 185 | cmd: scp /root/keystonercv3 gtw01:/root |
| 186 | node_name: {{ HOSTNAME_CFG01 }} |
| 187 | retry: {count: 1, delay: 30} |
| 188 | skip_fail: false |