Taras Khlivnyak | ea9af83 | 2021-04-13 13:51:00 +0300 | [diff] [blame] | 1 | {% set HOSTNAME_CFG01='cfg01.bm-e7-cicd-pike-ovs-maas.local' %} |
| 2 | {% set LAB_CONFIG_NAME='bm-e7-cicd-pike-ovs-maas' %} |
| 3 | {% set DOMAIN_NAME='bm-e7-cicd-pike-ovs-maas.local' %} |
| 4 | |
| 5 | {% import 'shared-salt.yaml' as SHARED with context %} |
| 6 | {% import 'shared-test-tools.yaml' as SHARED_TEST_TOOLS with context %} |
| 7 | {% import 'shared-workarounds.yaml' as SHARED_WORKAROUNDS with context %} |
Taras Khlivnyak | 95088cb | 2021-04-13 14:53:51 +0300 | [diff] [blame] | 8 | {% import 'shared-maas.yaml' as SHARED_MAAS with context %} |
Taras Khlivnyak | ea9af83 | 2021-04-13 13:51:00 +0300 | [diff] [blame] | 9 | |
| 10 | - description: Wait for salt-master is ready after configdrive user-data |
| 11 | cmd: | |
| 12 | timeout 120 salt-call test.ping |
| 13 | node_name: {{ HOSTNAME_CFG01 }} |
| 14 | retry: {count: 2, delay: 5} |
| 15 | skip_fail: false |
| 16 | |
| 17 | {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }} |
Hanna Arhipova | da9d770 | 2021-04-13 15:14:13 +0300 | [diff] [blame] | 18 | {{ SHARED_MAAS.REBOOT_HW_NODES('engineer', 'K7wy5Y39g6Ii', |
| 19 | [ |
| 20 | "176.74.217.64", |
| 21 | "185.8.59.228", |
| 22 | "5.43.225.89", |
| 23 | "5.43.227.11", |
| 24 | "5.43.227.19", |
| 25 | "5.43.225.74", |
| 26 | "5.43.225.16", |
| 27 | "5.43.225.172" |
| 28 | ]) }} |
Taras Khlivnyak | ea9af83 | 2021-04-13 13:51:00 +0300 | [diff] [blame] | 29 | |
Taras Khlivnyak | 95088cb | 2021-04-13 14:53:51 +0300 | [diff] [blame] | 30 | |
Taras Khlivnyak | ea9af83 | 2021-04-13 13:51:00 +0300 | [diff] [blame] | 31 | {{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}} |
| 32 | |
| 33 | {{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}} |
| 34 | |
| 35 | - description: Generate a public key for machines in MAAS |
| 36 | cmd: | |
| 37 | ssh-keygen -y -f ~root/.ssh/id_rsa > ~root/.ssh/id_rsa.pub |
| 38 | maas mirantis sshkeys create key="$(cat ~root/.ssh/id_rsa.pub)" |
| 39 | node_name: {{ HOSTNAME_CFG01 }} |
| 40 | retry: {count: 1, delay: 5} |
| 41 | skip_fail: false |
| 42 | |
| 43 | - description: Run comissioning of BM nodes |
| 44 | cmd: | |
| 45 | salt-call maas.process_machines |
| 46 | node_name: {{ HOSTNAME_CFG01 }} |
| 47 | retry: {count: 1, delay: 5} |
| 48 | skip_fail: false |
| 49 | |
| 50 | - description: Wait for machines ready |
| 51 | cmd: | |
| 52 | salt-call maas.machines_status && timeout 120 salt-call state.sls maas.machines.wait_for_ready |
| 53 | node_name: {{ HOSTNAME_CFG01 }} |
| 54 | retry: {count: 7, delay: 5} |
| 55 | skip_fail: false |
| 56 | |
| 57 | - description: Enforce the interfaces configuration defined in the model for servers |
| 58 | cmd: | |
| 59 | salt-call state.sls maas.machines.assign_ip; |
| 60 | node_name: {{ HOSTNAME_CFG01 }} |
| 61 | retry: {count: 1, delay: 5} |
| 62 | skip_fail: false |
| 63 | |
| 64 | - description: Assign drive partitions to machines |
| 65 | cmd: salt-call state.sls maas.machines.storage |
| 66 | node_name: {{ HOSTNAME_CFG01 }} |
| 67 | retry: {count: 1, delay: 5} |
| 68 | skip_fail: false |
| 69 | |
| 70 | - description: Remove all the salt-minions and re-register the cfg01 minion |
| 71 | cmd: | |
| 72 | salt-key -y -D; |
| 73 | salt-call test.ping |
| 74 | sleep 5 |
| 75 | # Check that the cfg01 is registered |
| 76 | salt-key | grep cfg01 |
| 77 | node_name: {{ HOSTNAME_CFG01 }} |
| 78 | retry: {count: 1, delay: 5} |
| 79 | skip_fail: false |
| 80 | |
| 81 | - description: provision the automatically commissioned physical nodes through MAAS |
| 82 | cmd: | |
| 83 | salt-call maas.deploy_machines; |
| 84 | node_name: {{ HOSTNAME_CFG01 }} |
| 85 | retry: {count: 3, delay: 5} |
| 86 | skip_fail: false |
| 87 | |
| 88 | - description: Wait for machines deployed |
| 89 | cmd: | |
| 90 | salt-call maas.machines_status && timeout 300 salt-call state.sls maas.machines.wait_for_deployed |
| 91 | node_name: {{ HOSTNAME_CFG01 }} |
| 92 | retry: {count: 6, delay: 5} |
| 93 | skip_fail: false |
| 94 | |
| 95 | {{SHARED_TEST_TOOLS.MACRO_INSTALL_RECLASS_TOOLS()}} |
| 96 | {{ SHARED_WORKAROUNDS.MACRO_CEPH_SET_PGNUM() }} |
| 97 | {{ SHARED_WORKAROUNDS.CLEAR_CEPH_OSD_DRIVES() }} |