blob: 20788fbadfbfdacd551e1e9bced28e893beb89c7 [file] [log] [blame]
Andy Bavier2505f592016-11-11 15:58:55 -05001# Doesn't seem to be a MAAS module for Ansible yet
2- name: Get MAAS credentials
3 become: yes
4 command: maas-region-admin apikey --username=cord
5 register: maas_key
6 tags:
7 - skip_ansible_lint
8
9- name: Login to MAAS
10 command: maas login cord http://localhost/MAAS/api/1.0 {{ maas_key.stdout }}
11 tags:
12 - skip_ansible_lint
13
14- name: Wait for node to become ready
15 shell: maas cord nodes list|jq -r '.[] | select(.status == 0).system_id'
16 register: nodeid
17 until: nodeid.stdout
18 retries: 40
19 delay: 15
20 tags:
21 - skip_ansible_lint
22
23# We need to be able to reboot the VM on the physical server running CiaB
24- name: Add remote power state
25 command: maas cord node update {{ nodeid.stdout }} power_type="virsh" power_parameters_power_address="qemu+ssh://{{ maas_user }}@10.100.198.1/system" power_parameters_power_id="{{ vagrant_name }}"
26 tags:
27 - skip_ansible_lint
28
29- name: Wait for node to be fully provisioned
30 become: yes
31 shell: /usr/local/bin/get-node-prov-state |jq '.[] | select(.id == "{{ nodeid.stdout }}").status'
32 register: prov_state
33 until: prov_state.stdout == "2"
Andy Baviere7bbcb52016-12-01 11:38:52 -050034 retries: 120
Andy Bavier2505f592016-11-11 15:58:55 -050035 delay: 30
36 tags:
37 - skip_ansible_lint