| {% from 'virtual-mcp-ocata-dvr/salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %} |
| {% from 'virtual-mcp-ocata-dvr/salt.yaml' import IPV4_NET_TENANT_PREFIX with context %} |
| |
| ################### Install OpenStack control ########################## |
| |
| # // Install horizon dashboard |
| # salt.enforceState(saltMaster, 'I@horizon:server', 'horizon', true) |
| # salt.enforceState(saltMaster, 'I@nginx:server', 'nginx', true) |
| |
| - description: Install Horizon |
| do: enforceState |
| target: I@horizon:server |
| state: horizon |
| |
| - description: Update certs on nginx servers |
| do: enforceState |
| target: I@nginx:server |
| state: salt.minion.cert |
| |
| - description: Install nginx |
| do: enforceState |
| target: I@nginx:server |
| state: nginx |
| |
| # // setup keystone service |
| # //runSaltProcessStep(saltMaster, 'I@keystone:server', 'state.sls', ['keystone.server'], 1) |
| # salt.enforceState(saltMaster, 'I@keystone:server and *01*', 'keystone.server', true) |
| # salt.enforceState(saltMaster, 'I@keystone:server', 'keystone.server', true) |
| # // populate keystone services/tenants/roles/users |
| |
| - description: Install Keystone on 01 |
| do: enforceState |
| target: I@keystone:server and *01* |
| state: keystone.server |
| retry: {count: 3, delay: 5} |
| |
| - description: Install Keystone |
| do: enforceState |
| target: I@keystone:server |
| state: keystone.server |
| retry: {count: 3, delay: 5} |
| |
| # // keystone:client must be called locally |
| # //salt.runSaltProcessStep(saltMaster, 'I@keystone:client', 'cmd.run', ['salt-call state.sls keystone.client'], null, true) |
| # salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'service.restart', ['apache2']) |
| # salt.enforceState(saltMaster, 'I@keystone:client', 'keystone.client', true) |
| # salt.enforceState(saltMaster, 'I@keystone:client', 'keystone.client', true) |
| # salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; keystone service-list'], null, true) |
| |
| # - description: Install Keystone client |
| # do: runState |
| # target: I@keystone:client |
| # state: cmd.run |
| # args: ['salt-call state.sls keystone.client'] |
| |
| - description: Restart apache on Keystone servers |
| do: runState |
| target: I@keystone:server |
| state: service.restart |
| args: ['apache2'] |
| |
| - description: Install Keystone Client |
| do: enforceState |
| target: I@keystone:client |
| state: keystone.client |
| |
| - description: Install Keystone Client |
| do: enforceState |
| target: I@keystone:client |
| state: keystone.client |
| |
| - description: Show Keystone config |
| do: runState |
| target: I@keystone:server |
| state: cmd.run |
| args: ['. /root/keystonerc; keystone service-list'] |
| |
| |
| # // Install glance and ensure glusterfs clusters |
| # //runSaltProcessStep(saltMaster, 'I@glance:server', 'state.sls', ['glance.server'], 1) |
| # salt.enforceState(saltMaster, 'I@glance:server and *01*', 'glance.server', true) |
| # salt.enforceState(saltMaster, 'I@glance:server', 'glance.server', true) |
| # salt.enforceState(saltMaster, 'I@glance:server', 'glusterfs.client', true) |
| |
| |
| - description: Install glance on 01 |
| do: enforceState |
| target: I@glance:server and *01* |
| state: glance.server |
| |
| - description: Install glance |
| do: enforceState |
| target: I@glance:server |
| state: glance.server |
| |
| - description: Install gluster client on glance servers |
| do: enforceState |
| target: I@glance:server |
| state: glusterfs.client |
| |
| # // Update fernet tokens before doing request on keystone server |
| # salt.enforceState(saltMaster, 'I@keystone:server', 'keystone.server', true) |
| |
| - description: Update fernet tokens |
| do: enforceState |
| target: I@keystone:server |
| state: keystone.server |
| |
| # // Check glance service |
| # salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; glance image-list'], null, true) |
| |
| - description: Show glance images via keystone node |
| do: runState |
| target: I@keystone:server |
| state: cmd.run |
| args: ['. /root/keystonerc; glance image-list'] |
| |
| # // Install and check nova service |
| # //runSaltProcessStep(saltMaster, 'I@nova:controller', 'state.sls', ['nova'], 1) |
| # salt.enforceState(saltMaster, 'I@nova:controller and *01*', 'nova.controller', true) |
| # salt.enforceState(saltMaster, 'I@nova:controller', 'nova.controller', true) |
| # salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; nova service-list'], null, true) |
| |
| - description: Install nova on controllers on 01 |
| do: enforceState |
| target: I@nova:controller and *01* |
| state: nova.controller |
| |
| - description: Install Keystone |
| do: enforceState |
| target: I@nova:controller |
| state: nova.controller |
| |
| - description: Show nova services via keystone node |
| do: runState |
| target: I@keystone:server |
| state: cmd.run |
| args: ['. /root/keystonerc; nova service-list'] |
| |
| |
| |
| # // Install and check cinder service |
| # //runSaltProcessStep(saltMaster, 'I@cinder:controller', 'state.sls', ['cinder'], 1) |
| # salt.enforceState(saltMaster, 'I@cinder:controller and *01*', 'cinder', true) |
| # salt.enforceState(saltMaster, 'I@cinder:controller', 'cinder', true) |
| # salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; cinder list'], null, true) |
| |
| |
| - description: Install cinder on controllers on 01 |
| do: enforceState |
| target: I@cinder:controller and *01* |
| state: cinder |
| |
| - description: Install cinder on controllers |
| do: enforceState |
| target: I@cinder:controller |
| state: cinder |
| |
| - description: Show cinder list via keystone node |
| do: runState |
| target: I@keystone:server |
| state: cmd.run |
| args: ['. /root/keystonerc; nova list'] |
| |
| |
| # // Install neutron service |
| # //runSaltProcessStep(saltMaster, 'I@neutron:server', 'state.sls', ['neutron'], 1) |
| |
| # salt.enforceState(saltMaster, 'I@neutron:server and *01*', 'neutron.server', true) |
| # salt.enforceState(saltMaster, 'I@neutron:server', 'neutron.server', true) |
| # salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; neutron agent-list'], null, true) |
| |
| - description: Install neutron on controllers on 01 |
| do: enforceState |
| target: I@neutron:server and *01* |
| state: neutron.server |
| |
| - description: Install neutron on controllers |
| do: enforceState |
| target: I@neutron:server |
| state: neutron.server |
| |
| - description: Show neutron agent list via keystone node |
| do: runState |
| target: I@keystone:server |
| state: cmd.run |
| args: ['. /root/keystonerc; neutron agent-list'] |
| |
| # // Install heat service |
| # //runSaltProcessStep(saltMaster, 'I@heat:server', 'state.sls', ['heat'], 1) |
| # salt.enforceState(saltMaster, 'I@heat:server and *01*', 'heat', true) |
| # salt.enforceState(saltMaster, 'I@heat:server', 'heat', true) |
| # salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; heat resource-type-list'], null, true) |
| |
| - description: Install heat on controllers on 01 |
| do: enforceState |
| target: I@heat:server and *01* |
| state: heat |
| |
| - description: Install heat on controllers |
| do: enforceState |
| target: I@heat:server |
| state: heat |
| |
| - description: Show heat resource type list via keystone node |
| do: runState |
| target: I@keystone:server |
| state: cmd.run |
| args: ['. /root/keystonerc; heat resource-type-list'] |
| |
| # // Restart nova api |
| # salt.runSaltProcessStep(saltMaster, 'I@nova:controller', 'service.restart', ['nova-api']) |
| |
| - description: Restart nova-api |
| do: runState |
| target: I@nova:controller |
| state: service.restart |
| args: ['nova-api'] |
| |
| ################### Install OpenStack network ########################## |
| |
| # // Apply gateway |
| # salt.runSaltProcessStep(saltMaster, 'I@neutron:gateway', 'state.apply', [], null, true) |
| |
| - description: Apply gateway |
| do: runState |
| target: I@neutron:gateway |
| state: state.apply |
| |
| # // Pring information |
| # salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; neutron net-list'], null, true) |
| # salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; nova net-list'], null, true) |
| |
| - description: Show neutron networks via keystone node |
| do: runState |
| target: I@keystone:server |
| state: cmd.run |
| args: ['. /root/keystonerc; neutron net-list'] |
| |
| - description: Show nova networks via keystone node |
| do: runState |
| target: I@keystone:server |
| state: cmd.run |
| args: ['. /root/keystonerc; nova net-list'] |
| |
| |
| ################### Install OpenStack compute ########################## |
| |
| # //orchestrate.installOpenstackMkCompute(saltMaster, physical) |
| # // Configure compute nodes |
| # retry(2) { |
| # salt.runSaltProcessStep(saltMaster, 'I@nova:compute', 'state.apply', [], null, true) |
| # } |
| |
| - description: Install Nova compute |
| do: runState |
| target: I@nova:compute |
| state: state.apply |
| retry: {count: 2, delay: 5} |
| |
| |
| # Upload cirros image |
| |
| - description: Upload cirros image on ctl01 |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 2, delay: 30} |
| skip_fail: false |
| |
| - description: Register image in glance |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /root/keystonercv3; glance image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-0.3.4-i386-disk.img' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Create net04_external |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /root/keystonercv3; neutron net-create net04_ext --shared --router:external True --provider:physical_network physnet1 --provider:network_type flat' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Create subnet_external |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /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' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Create net04 |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /root/keystonercv3; neutron net-create net04' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Create subnet_net04 |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /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' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Create router |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /root/keystonercv3; neutron router-create net04_router01' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Set geteway |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Add interface |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Allow all tcp |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Allow all icmp |
| cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0' |
| node_name: {{ HOSTNAME_CFG01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| # Configure cinder-volume salt-call |
| - description: Set disks 01 |
| cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
| node_name: {{ HOSTNAME_CTL01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Set disks 02 |
| cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
| node_name: {{ HOSTNAME_CTL02 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Set disks 03 |
| cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
| node_name: {{ HOSTNAME_CTL03 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Create partitions 01 |
| cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
| node_name: {{ HOSTNAME_CTL01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Create partitions 02 |
| cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
| node_name: {{ HOSTNAME_CTL01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |
| |
| - description: Create partitions 03 |
| cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
| node_name: {{ HOSTNAME_CTL01 }} |
| retry: {count: 1, delay: 30} |
| skip_fail: false |