blob: a9617f19efaf0f709aadb06159c6f5c5dd8a7aa5 [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() }}
Taras Khlivnyak95088cb2021-04-13 14:53:51 +030018
Taras Khlivnyakea9af832021-04-13 13:51:00 +030019{{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
20
21{{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}}
22
23- description: Generate a public key for machines in MAAS
24 cmd: |
25 ssh-keygen -y -f ~root/.ssh/id_rsa > ~root/.ssh/id_rsa.pub
26 maas mirantis sshkeys create key="$(cat ~root/.ssh/id_rsa.pub)"
27 node_name: {{ HOSTNAME_CFG01 }}
28 retry: {count: 1, delay: 5}
29 skip_fail: false
30
31- description: Run comissioning of BM nodes
32 cmd: |
33 salt-call maas.process_machines
34 node_name: {{ HOSTNAME_CFG01 }}
35 retry: {count: 1, delay: 5}
36 skip_fail: false
37
38- description: Wait for machines ready
39 cmd: |
40 salt-call maas.machines_status && timeout 120 salt-call state.sls maas.machines.wait_for_ready
41 node_name: {{ HOSTNAME_CFG01 }}
42 retry: {count: 7, delay: 5}
43 skip_fail: false
44
45- description: Enforce the interfaces configuration defined in the model for servers
46 cmd: |
47 salt-call state.sls maas.machines.assign_ip;
48 node_name: {{ HOSTNAME_CFG01 }}
49 retry: {count: 1, delay: 5}
50 skip_fail: false
51
52- description: Assign drive partitions to machines
53 cmd: salt-call state.sls maas.machines.storage
54 node_name: {{ HOSTNAME_CFG01 }}
55 retry: {count: 1, delay: 5}
56 skip_fail: false
57
58- description: Remove all the salt-minions and re-register the cfg01 minion
59 cmd: |
60 salt-key -y -D;
61 salt-call test.ping
62 sleep 5
63 # Check that the cfg01 is registered
64 salt-key | grep cfg01
65 node_name: {{ HOSTNAME_CFG01 }}
66 retry: {count: 1, delay: 5}
67 skip_fail: false
68
69- description: provision the automatically commissioned physical nodes through MAAS
70 cmd: |
71 salt-call maas.deploy_machines;
72 node_name: {{ HOSTNAME_CFG01 }}
73 retry: {count: 3, delay: 5}
74 skip_fail: false
75
76- description: Wait for machines deployed
77 cmd: |
78 salt-call maas.machines_status && timeout 300 salt-call state.sls maas.machines.wait_for_deployed
79 node_name: {{ HOSTNAME_CFG01 }}
80 retry: {count: 6, delay: 5}
81 skip_fail: false
82
83{{SHARED_TEST_TOOLS.MACRO_INSTALL_RECLASS_TOOLS()}}
84{{ SHARED_WORKAROUNDS.MACRO_CEPH_SET_PGNUM() }}
Hanna Arhipova05b74072021-04-23 14:43:13 +030085{{ SHARED_WORKAROUNDS.CLEAR_CEPH_OSD_DRIVES() }}
86
87- description: Disable known_hosts_autopopulation
88 cmd: |
89 set -ex;
90 . /root/venv-reclass-tools/bin/activate;
91 reclass-tools add-bool-key parameters.openssh.client.known_hosts_autopopulation false /srv/salt/reclass/nodes/_generated/cfg01.{{ LAB_CONFIG_NAME }}.local.yml
Taras Khlivnyakda142f82021-04-23 17:37:35 +030092 cd /srv/salt/reclass
Hanna Arhipova05b74072021-04-23 14:43:13 +030093 git add /srv/salt/reclass/nodes/_generated
94 git commit -m "[from tcp-qa] known_hosts_autopopulation disabled"
Hanna Arhipova84eff352021-04-26 14:31:48 +030095 salt -C 'I@salt:master' saltutil.refresh_pillar
96 salt -C 'I@salt:master' saltutil.sync_all
Hanna Arhipova05b74072021-04-23 14:43:13 +030097 node_name: {{ HOSTNAME_CFG01 }}
98 retry: {count: 1, delay: 5}
99 skip_fail: false