ba548b30555a7521747da15bcbc9c5eaef7f2f89
[releng.git] / prototypes / bifrost / playbooks / test-bifrost-infracloud.yaml
1 # SPDX-license-identifier: Apache-2.0
2 ##############################################################################
3 # Copyright (c) 2016 RedHat and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 ---
10 - hosts: localhost
11   connection: local
12   name: "Setting pre-test conditions"
13   become: yes
14   ignore_errors: yes
15   tasks:
16   - name: Remove pre-existing leases file
17     file: path=/var/lib/misc/dnsmasq.leases state=absent
18 - hosts: localhost
19   connection: local
20   name: "Executes install, enrollment, and testing in one playbook"
21   become: no
22   gather_facts: yes
23   pre_tasks:
24     - name: "Override the ipv4_gateway setting"
25       set_fact:
26          ipv4_gateway: "192.168.122.1"
27   roles:
28     - { role: bifrost-prep-for-install, when: skip_install is not defined }
29   environment:
30     http_proxy: "{{ lookup('env','http_proxy') }}"
31     https_proxy: "{{ lookup('env','https_proxy') }}"
32 - hosts: localhost
33   connection: local
34   name: "Executes install, enrollment, and testing in one playbook"
35   become: yes
36   gather_facts: yes
37   roles:
38     - role: bifrost-ironic-install
39       cleaning: false
40       testing: true
41     # NOTE(TheJulia): While the next step creates a ramdisk, some elements
42     # do not support ramdisk-image-create as they invoke steps to cleanup
43     # the ramdisk which causes ramdisk-image-create to believe it failed.
44     - { role: bifrost-create-dib-image, dib_imagename: "{{ http_boot_folder }}/ipa", build_ramdisk: false, dib_os_element: "{{ ipa_dib_os_element|default('debian') }}", dib_os_release: "jessie", dib_elements: "ironic-agent {{ ipa_extra_dib_elements | default('') }}", when: create_ipa_image | bool == true }
45     - { role: bifrost-create-dib-image, dib_imagetype: "qcow2", dib_imagename: "{{deploy_image}}", dib_os_element: "ubuntu-minimal", dib_os_release: "trusty", dib_elements: "vm serial-console simple-init devuser infra-cloud-bridge puppet growroot {{ extra_dib_elements|default('') }}", dib_packages: "openssh-server,vlan,vim,less,bridge-utils,language-pack-en,iputils-ping,rsyslog,curl", when: create_image_via_dib | bool == true and transform_boot_image | bool == false }
46   environment:
47     http_proxy: "{{ lookup('env','http_proxy') }}"
48     https_proxy: "{{ lookup('env','https_proxy') }}"
49 - hosts: baremetal
50   name: "Enroll node with Ironic"
51   become: no
52   connection: local
53   roles:
54     - role: ironic-enroll-dynamic
55     - { role: ironic-inspect-node, when: inspect_nodes | default('false') | bool == true }
56 - hosts: baremetal
57   vars:
58     multinode_testing: "{{ inventory_dhcp | bool == true }}"
59   name: "Create configuration drive files and deploy machines."
60   become: no
61   connection: local
62   roles:
63     - role: bifrost-configdrives-dynamic
64     - role: bifrost-deploy-nodes-dynamic
65     - role: bifrost-prepare-for-test-dynamic
66       serial: 1