blob: 8b3822d695849a4a153d2bebd773b3750bd68ed8 [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 %}
Taras Khlivnyak95088cb2021-04-13 14:53:51 +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
Taras Khlivnyak95088cb2021-04-13 14:53:51 +030030
Taras Khlivnyakea9af832021-04-13 13:51:00 +030031{{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() }}