blob: ed5516092048954778eca64b1f3c9e4577857d02 [file] [log] [blame]
Taras Khlivnyakea9af832021-04-13 13:51:00 +03001{% 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 %}
Hanna Arhipovada9d7702021-04-13 15:14:13 +03008{% import 'shared-maas.yaml' as SHARED_MAAS with context %}
Taras Khlivnyakea9af832021-04-13 13:51:00 +03009
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 Arhipovada9d7702021-04-13 15:14:13 +030018{{ 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 Khlivnyakea9af832021-04-13 13:51:00 +030029
30{{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
31
32{{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}}
33
34- description: Generate a public key for machines in MAAS
35 cmd: |
36 ssh-keygen -y -f ~root/.ssh/id_rsa > ~root/.ssh/id_rsa.pub
37 maas mirantis sshkeys create key="$(cat ~root/.ssh/id_rsa.pub)"
38 node_name: {{ HOSTNAME_CFG01 }}
39 retry: {count: 1, delay: 5}
40 skip_fail: false
41
42- description: Run comissioning of BM nodes
43 cmd: |
44 salt-call maas.process_machines
45 node_name: {{ HOSTNAME_CFG01 }}
46 retry: {count: 1, delay: 5}
47 skip_fail: false
48
49- description: Wait for machines ready
50 cmd: |
51 salt-call maas.machines_status && timeout 120 salt-call state.sls maas.machines.wait_for_ready
52 node_name: {{ HOSTNAME_CFG01 }}
53 retry: {count: 7, delay: 5}
54 skip_fail: false
55
56- description: Enforce the interfaces configuration defined in the model for servers
57 cmd: |
58 salt-call state.sls maas.machines.assign_ip;
59 node_name: {{ HOSTNAME_CFG01 }}
60 retry: {count: 1, delay: 5}
61 skip_fail: false
62
63- description: Assign drive partitions to machines
64 cmd: salt-call state.sls maas.machines.storage
65 node_name: {{ HOSTNAME_CFG01 }}
66 retry: {count: 1, delay: 5}
67 skip_fail: false
68
69- description: Remove all the salt-minions and re-register the cfg01 minion
70 cmd: |
71 salt-key -y -D;
72 salt-call test.ping
73 sleep 5
74 # Check that the cfg01 is registered
75 salt-key | grep cfg01
76 node_name: {{ HOSTNAME_CFG01 }}
77 retry: {count: 1, delay: 5}
78 skip_fail: false
79
80- description: provision the automatically commissioned physical nodes through MAAS
81 cmd: |
82 salt-call maas.deploy_machines;
83 node_name: {{ HOSTNAME_CFG01 }}
84 retry: {count: 3, delay: 5}
85 skip_fail: false
86
87- description: Wait for machines deployed
88 cmd: |
89 salt-call maas.machines_status && timeout 300 salt-call state.sls maas.machines.wait_for_deployed
90 node_name: {{ HOSTNAME_CFG01 }}
91 retry: {count: 6, delay: 5}
92 skip_fail: false
93
94{{SHARED_TEST_TOOLS.MACRO_INSTALL_RECLASS_TOOLS()}}
95{{ SHARED_WORKAROUNDS.MACRO_CEPH_SET_PGNUM() }}
96{{ SHARED_WORKAROUNDS.CLEAR_CEPH_OSD_DRIVES() }}