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