airshipctl/roles/airship-libvirt-gate/tasks/build-infra.yaml
Yasin, Siraj (SY495P) c25d223c7b Add copyright for missing files
* added license templates for go, bash & yaml in tools dir
* added a script that will add license information for all
    missing files. Type:  go, yaml, yml, sh
* skip adding license for all files within testdata
* Syntax:
   > ./tools/add_license.sh

* Skip license for manifests folder
* Added one extra line after licene for yaml files
* Added License after Hashbang for bash.
* Add an extra line after hashbang and before license
* Updated the go template to use multiline comments

New Files:
  1. tools/add_license.sh
  2. tools/license_go.txt
  3. tools/license_yaml.txt
  4. tools/license_bash.txt

Change-Id: Ia4da5b261e7cd518d446896b72c810421877472a
Realtes-To:#147
2020-04-09 08:35:59 -05:00

129 lines
4.2 KiB
YAML

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: verify that gate flavor is defined
assert:
that:
- gate_flavor is defined
- name: set flavor variables.
set_fact:
chosen_flavor: "{{ airship_gate_flavors[gate_flavor] }}"
- name: install libvirt
include_role:
name: libvirt-install
tasks_from: "{{ item }}"
with_items:
- main
- configure
- name: create pool
include_role:
name: libvirt-pool
vars:
libvirt_pool: "{{ item }}"
with_items: "{{ airship_gate_libvirt_pools }}"
- name: create networks
include_role:
name: libvirt-network
with_items: "{{ airship_gate_libvirt_networks }}"
vars:
libvirt_network: "{{ item }}"
network_action: create
- name: Create ephemeral volume
include_role:
name: libvirt-volume
vars:
libvirt_volume:
name: "{{ airship_gate_names.ephemeral_volume }}"
size: "{{ chosen_flavor.ephemeral_disk_size }}"
pool: "{{ airship_gate_names.pool }}"
volume_action: create
- name: Create target volumes
include_role:
name: libvirt-volume
vars:
libvirt_volume:
name: "{{ airship_gate_names.target_volume_prefix }}-{{ vm_index }}"
size: "{{ chosen_flavor.target_disk_size }}"
pool: "{{ airship_gate_names.pool }}"
format: "{{ chosen_flavor.disk_format }}"
volume_action: create
loop_control:
loop_var: vm_index
with_sequence: "start=1 end={{ chosen_flavor.target_vms_count }}"
- name: Create target domains
include_role:
name: libvirt-domain
vars:
libvirt_domain:
state: shutdown
name: "{{ airship_gate_names.target_vm_prefix }}-{{ vm_index }}"
memory_mb: "{{ chosen_flavor.target_vm_memory_mb }}"
vcpus: "{{ chosen_flavor.target_vm_vcpus }}"
volumes:
- name: "{{ airship_gate_names.target_volume_prefix }}-{{ vm_index }}"
device: "disk"
format: "{{ chosen_flavor.disk_format }}"
pool: "{{ airship_gate_names.pool }}"
interfaces:
- network: "{{ airship_gate_names.nat_network }}"
- network: "{{ airship_gate_names.provision_network }}"
loop_control:
loop_var: vm_index
with_sequence: "start=1 end={{ chosen_flavor.target_vms_count }}"
- name: Create ephemeral domain
include_role:
name: libvirt-domain
vars:
libvirt_domain:
enable_vnc: true
console_log_enabled: true
state: shutdown
name: "{{ airship_gate_names.ephemeral_vm }}"
memory_mb: "{{ chosen_flavor.ephemeral_vm_memory_mb }}"
vcpus: "{{ chosen_flavor.ephemeral_vm_vcpus }}"
volumes:
- name: "{{ airship_gate_names.ephemeral_volume }}"
device: "disk"
format: "{{ chosen_flavor.disk_format }}"
pool: "{{ airship_gate_names.pool }}"
interfaces:
- network: "{{ airship_gate_names.nat_network }}"
- network: "{{ airship_gate_names.provision_network }}"
- name: install apache2 reverse proxy
include_role:
name: reverse-proxy
vars:
reverse_proxy_action: "install"
reverse_proxy_hostname: "{{ airship_gate_redfish.hostname }}"
reverse_proxy_username: "{{ airship_gate_redfish.username }}"
reverse_proxy_password: "{{ airship_gate_redfish.password }}"
reverse_proxy_frontend_ip: "{{ airship_gate_redfish.bind_address }}"
reverse_proxy_frontend_port: "{{ airship_gate_redfish.secure_port }}"
reverse_proxy_backend_ip: "{{ airship_gate_redfish.bind_address }}"
reverse_proxy_backend_port: "{{ airship_gate_redfish.port }}"
- name: install and start redfish emulator
include_role:
name: redfish-emulator
vars:
redfish_action: "install"
redfish_emulator_bind_ip: "{{ airship_gate_redfish.bind_address }}"
redfish_emulator_bind_port: "{{ airship_gate_redfish.port }}"