blob: 142d319542d674f57a04c417c8ae4727539628e6 [file] [log] [blame]
obutenko4dc240f2019-01-22 18:25:37 +02001{% from 'cookied-cicd-ovs-maas/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-cicd-ovs-maas/underlay.yaml' import LAB_CONFIG_NAME with context %}
3{% from 'cookied-cicd-ovs-maas/underlay.yaml' import DOMAIN_NAME with context %}
4
5{% import 'shared-salt.yaml' as SHARED with context %}
6
7- description: Wait for salt-master is ready after configdrive user-data
8 cmd: |
9 timeout 120 salt-call test.ping
10 node_name: {{ HOSTNAME_CFG01 }}
11 retry: {count: 2, delay: 5}
12 skip_fail: false
13
14{{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
15
16{{SHARED.MACRO_CHECK_SALT_VERSION_SERVICES_ON_CFG()}}
17
18{{SHARED.MACRO_CHECK_SALT_VERSION_ON_NODES()}}
19
20- description: Generate a public key for machines in MAAS
21 cmd: |
22 ssh-keygen -y -f ~root/.ssh/id_rsa > ~root/.ssh/id_rsa.pub
23 maas mirantis sshkeys create key="$(cat ~root/.ssh/id_rsa.pub)"
24 node_name: {{ HOSTNAME_CFG01 }}
25 retry: {count: 1, delay: 5}
26 skip_fail: false
27
28- description: Run comissioning of BM nodes
29 cmd: |
30 salt-call maas.process_machines
31 node_name: {{ HOSTNAME_CFG01 }}
32 retry: {count: 1, delay: 5}
33 skip_fail: false
34
35- description: Wait for machines ready
36 cmd: |
37 salt-call maas.machines_status && timeout 120 salt-call state.sls maas.machines.wait_for_ready
38 node_name: {{ HOSTNAME_CFG01 }}
39 retry: {count: 7, delay: 5}
40 skip_fail: false
41
42- description: Enforce the interfaces configuration defined in the model for servers
43 cmd: |
44 salt-call state.sls maas.machines.assign_ip;
45 node_name: {{ HOSTNAME_CFG01 }}
46 retry: {count: 1, delay: 5}
47 skip_fail: false
48
obutenkod9cc2112019-01-31 23:26:49 +020049- description: Assign drive partitions to machines
50 cmd: salt-call state.sls maas.machines.storage
51 node_name: {{ HOSTNAME_CFG01 }}
52 retry: {count: 1, delay: 5}
53 skip_fail: false
54
obutenko4dc240f2019-01-22 18:25:37 +020055- description: Remove all the salt-minions and re-register the cfg01 minion
56 cmd: |
57 salt-key -y -D;
58 salt-call test.ping
59 sleep 5
60 # Check that the cfg01 is registered
61 salt-key | grep cfg01
62 node_name: {{ HOSTNAME_CFG01 }}
63 retry: {count: 1, delay: 5}
64 skip_fail: false
65
66- description: provision the automatically commissioned physical nodes through MAAS
67 cmd: |
68 salt-call maas.deploy_machines;
69 node_name: {{ HOSTNAME_CFG01 }}
70 retry: {count: 3, delay: 5}
71 skip_fail: false
72
73- description: Wait for machines deployed
74 cmd: |
75 salt-call maas.machines_status && timeout 300 salt-call state.sls maas.machines.wait_for_deployed
76 node_name: {{ HOSTNAME_CFG01 }}
77 retry: {count: 6, delay: 5}
78 skip_fail: false