blob: 77f10d2ec9e8af304b62d871c05448362626d57f [file] [log] [blame]
Tatyana Leontovichbfbc4832018-12-27 12:47:23 +02001{% from 'cookied-cicd-bm-queens-contrail-maas/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-cicd-bm-queens-contrail-maas/underlay.yaml' import LAB_CONFIG_NAME with context %}
3{% from 'cookied-cicd-bm-queens-contrail-maas/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: Generate a public key for machines in MAAS
23 cmd: |
24 ssh-keygen -y -f ~root/.ssh/id_rsa > ~root/.ssh/id_rsa.pub
25 maas mirantis sshkeys create key="$(cat ~root/.ssh/id_rsa.pub)"
26 node_name: {{ HOSTNAME_CFG01 }}
27 retry: {count: 1, delay: 5}
28 skip_fail: false
29
30- description: Run comissioning of BM nodes
31 cmd: |
32 salt-call maas.process_machines
33 node_name: {{ HOSTNAME_CFG01 }}
34 retry: {count: 1, delay: 5}
35 skip_fail: false
36
37- description: Wait for machines ready
38 cmd: |
39 salt-call maas.machines_status && timeout 120 salt-call state.sls maas.machines.wait_for_ready
40 node_name: {{ HOSTNAME_CFG01 }}
41 retry: {count: 7, delay: 5}
42 skip_fail: false
43
44- description: Enforce the interfaces configuration defined in the model for servers
45 cmd: |
46 salt-call state.sls maas.machines.assign_ip;
47 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 1, delay: 5}
49 skip_fail: false
50
51- description: Remove all the salt-minions and re-register the cfg01 minion
52 cmd: |
53 salt-key -y -D;
54 salt-call test.ping
55 sleep 5
56 # Check that the cfg01 is registered
57 salt-key | grep cfg01
58 node_name: {{ HOSTNAME_CFG01 }}
59 retry: {count: 1, delay: 5}
60 skip_fail: false
61
62- description: provision the automatically commissioned physical nodes through MAAS
63 cmd: |
64 salt-call maas.deploy_machines;
65 node_name: {{ HOSTNAME_CFG01 }}
66 retry: {count: 3, delay: 5}
67 skip_fail: false
68
69- description: Wait for machines deployed
70 cmd: |
71 salt-call maas.machines_status && timeout 300 salt-call state.sls maas.machines.wait_for_deployed
72 node_name: {{ HOSTNAME_CFG01 }}
73 retry: {count: 6, delay: 5}
74 skip_fail: false