blob: 48480938a8f92ac42465a772947a81ea61c626ab [file] [log] [blame]
Matteo Scandolo60b640f2017-08-08 13:05:22 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Andy Bavier2505f592016-11-11 15:58:55 -050017# Doesn't seem to be a MAAS module for Ansible yet
18- name: Get MAAS credentials
19 become: yes
20 command: maas-region-admin apikey --username=cord
21 register: maas_key
22 tags:
23 - skip_ansible_lint
24
25- name: Login to MAAS
26 command: maas login cord http://localhost/MAAS/api/1.0 {{ maas_key.stdout }}
27 tags:
28 - skip_ansible_lint
29
30- name: Wait for node to become ready
31 shell: maas cord nodes list|jq -r '.[] | select(.status == 0).system_id'
32 register: nodeid
33 until: nodeid.stdout
34 retries: 40
35 delay: 15
36 tags:
37 - skip_ansible_lint
38
39# We need to be able to reboot the VM on the physical server running CiaB
40- name: Add remote power state
41 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 }}"
42 tags:
43 - skip_ansible_lint
44
45- name: Wait for node to be fully provisioned
46 become: yes
47 shell: /usr/local/bin/get-node-prov-state |jq '.[] | select(.id == "{{ nodeid.stdout }}").status'
48 register: prov_state
49 until: prov_state.stdout == "2"
Andy Baviere7bbcb52016-12-01 11:38:52 -050050 retries: 120
Andy Bavier2505f592016-11-11 15:58:55 -050051 delay: 30
52 tags:
53 - skip_ansible_lint