Oleksii Butenko | 4b494f8 | 2019-05-29 17:39:15 +0300 | [diff] [blame] | 1 | {% set HOSTNAME_CFG01='cfg01.bm-cicd-pike-ovs-maas.local' %} |
| 2 | {% set LAB_CONFIG_NAME='bm-cicd-pike-ovs-maas' %} |
| 3 | {% set DOMAIN_NAME='bm-cicd-pike-ovs-maas.local' %} |
Oleksii Butenko | ef54015 | 2019-03-22 15:52:54 +0200 | [diff] [blame] | 4 | |
| 5 | {% import 'shared-salt.yaml' as SHARED with context %} |
Dmitriy Kruglov | baea357 | 2019-09-27 10:30:40 +0200 | [diff] [blame] | 6 | {% import 'shared-test-tools.yaml' as SHARED_TEST_TOOLS with context %} |
Oleksii Butenko | ef54015 | 2019-03-22 15:52:54 +0200 | [diff] [blame] | 7 | |
| 8 | - description: Wait for salt-master is ready after configdrive user-data |
| 9 | cmd: | |
| 10 | timeout 120 salt-call test.ping |
| 11 | node_name: {{ HOSTNAME_CFG01 }} |
| 12 | retry: {count: 2, delay: 5} |
| 13 | skip_fail: false |
| 14 | |
| 15 | {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }} |
| 16 | |
| 17 | {{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}} |
| 18 | |
| 19 | {{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}} |
| 20 | |
| 21 | - description: Generate a public key for machines in MAAS |
| 22 | cmd: | |
| 23 | ssh-keygen -y -f ~root/.ssh/id_rsa > ~root/.ssh/id_rsa.pub |
| 24 | maas mirantis sshkeys create key="$(cat ~root/.ssh/id_rsa.pub)" |
| 25 | node_name: {{ HOSTNAME_CFG01 }} |
| 26 | retry: {count: 1, delay: 5} |
| 27 | skip_fail: false |
| 28 | |
| 29 | - description: Run comissioning of BM nodes |
| 30 | cmd: | |
| 31 | salt-call maas.process_machines |
| 32 | node_name: {{ HOSTNAME_CFG01 }} |
| 33 | retry: {count: 1, delay: 5} |
| 34 | skip_fail: false |
| 35 | |
| 36 | - description: Wait for machines ready |
| 37 | cmd: | |
| 38 | salt-call maas.machines_status && timeout 120 salt-call state.sls maas.machines.wait_for_ready |
| 39 | node_name: {{ HOSTNAME_CFG01 }} |
| 40 | retry: {count: 7, delay: 5} |
| 41 | skip_fail: false |
| 42 | |
| 43 | - description: Enforce the interfaces configuration defined in the model for servers |
| 44 | cmd: | |
| 45 | salt-call state.sls maas.machines.assign_ip; |
| 46 | node_name: {{ HOSTNAME_CFG01 }} |
| 47 | retry: {count: 1, delay: 5} |
| 48 | skip_fail: false |
| 49 | |
| 50 | - description: Assign drive partitions to machines |
| 51 | cmd: salt-call state.sls maas.machines.storage |
| 52 | node_name: {{ HOSTNAME_CFG01 }} |
| 53 | retry: {count: 1, delay: 5} |
| 54 | skip_fail: false |
| 55 | |
| 56 | - description: Remove all the salt-minions and re-register the cfg01 minion |
| 57 | cmd: | |
| 58 | salt-key -y -D; |
| 59 | salt-call test.ping |
| 60 | sleep 5 |
| 61 | # Check that the cfg01 is registered |
| 62 | salt-key | grep cfg01 |
| 63 | node_name: {{ HOSTNAME_CFG01 }} |
| 64 | retry: {count: 1, delay: 5} |
| 65 | skip_fail: false |
| 66 | |
| 67 | - description: provision the automatically commissioned physical nodes through MAAS |
| 68 | cmd: | |
| 69 | salt-call maas.deploy_machines; |
| 70 | node_name: {{ HOSTNAME_CFG01 }} |
| 71 | retry: {count: 3, delay: 5} |
| 72 | skip_fail: false |
| 73 | |
| 74 | - description: Wait for machines deployed |
| 75 | cmd: | |
| 76 | salt-call maas.machines_status && timeout 300 salt-call state.sls maas.machines.wait_for_deployed |
| 77 | node_name: {{ HOSTNAME_CFG01 }} |
| 78 | retry: {count: 6, delay: 5} |
| 79 | skip_fail: false |
Dmitriy Kruglov | baea357 | 2019-09-27 10:30:40 +0200 | [diff] [blame] | 80 | |
| 81 | {{SHARED_TEST_TOOLS.MACRO_INSTALL_RECLASS_TOOLS()}} |