summaryrefslogtreecommitdiffstats
path: root/prototypes/bifrost/playbooks/opnfv-virtual.yaml
blob: 3cba98b6b47b6f569917c9a3cf8dbbf926f2f96c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2016 RedHat and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
- hosts: localhost
  connection: local
  name: "Setting pre-test conditions"
  become: yes
  ignore_errors: yes
  tasks:
  - name: Remove pre-existing leases file
    file: path=/var/lib/misc/dnsmasq.leases state=absent
- hosts: localhost
  connection: local
  name: "Executes install, enrollment, and testing in one playbook"
  become: no
  gather_facts: yes
  pre_tasks:
    - name: "Override the ipv4_gateway setting"
      set_fact:
         ipv4_gateway: "192.168.122.1"
  roles:
    - { role: bifrost-prep-for-install, when: skip_install is not defined }
  environment:
    http_proxy: "{{ lookup('env','http_proxy') }}"
    https_proxy: "{{ lookup('env','https_proxy') }}"
- hosts: localhost
  connection: local
  name: "Executes install, enrollment, and testing in one playbook"
  become: yes
  gather_facts: yes
  roles:
    - role: bifrost-keystone-install
    - role: bifrost-ironic-install
      cleaning: false
      testing: true
    # NOTE(TheJulia): While the next step creates a ramdisk, some elements
    # do not support ramdisk-image-create as they invoke steps to cleanup
    # the ramdisk which causes ramdisk-image-create to believe it failed.
    - 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('') }}"
      dib_notmpfs: true
      when: create_ipa_image | bool == true
    - role: bifrost-create-dib-image
      dib_imagetype: "qcow2"
      dib_imagename: "{{deploy_image}}"
      dib_os_element: "{{ lookup('env','DIB_OS_ELEMENT') }}"
      dib_os_release: "{{ lookup('env', 'DIB_OS_RELEASE') }}"
      extra_dib_elements: "{{ lookup('env', 'EXTRA_DIB_ELEMENTS') | default('') }}"
      dib_elements: "vm enable-serial-console simple-init devuser growroot {{ extra_dib_elements }}"
      dib_packages: "{{ lookup('env', 'DIB_OS_PACKAGES') }}"
      dib_notmpfs: true
      when: create_image_via_dib | bool == true and transform_boot_image | bool == false
    - role: bifrost-keystone-client-config
      user: "{{ ansible_env.SUDO_USER }}"
      clouds:
        bifrost:
          config_username: "{{ ironic.keystone.default_username }}"
          config_password: "{{ ironic.keystone.default_password }}"
          config_project_name: "baremetal"
          config_region_name: "{{ keystone.bootstrap.region_name }}"
          config_auth_url: "{{ keystone.bootstrap.public_url }}"
  environment:
    http_proxy: "{{ lookup('env','http_proxy') }}"
    https_proxy: "{{ lookup('env','https_proxy') }}"
- hosts: baremetal
  name: "Enroll node with Ironic"
  become: no
  connection: local
  roles:
    - role: ironic-enroll-dynamic
    - { role: ironic-inspect-node, when: inspect_nodes | default('false') | bool == true }
- hosts: baremetal
  name: "Create configuration drive files and deploy machines"
  vars:
    multinode_testing: "{{ inventory_dhcp | bool == true }}"
  become: no
  connection: local
  roles:
    - role: bifrost-configdrives-dynamic
    - role: bifrost-deploy-nodes-dynamic
- hosts: baremetal
  name: "Deploy machines."
  become: no
  connection: local
  serial: 1
  roles:
    - role: bifrost-prepare-for-test-dynamic