xci: Create playbook to destroy, create and provision VM nodes
[releng.git] / prototypes / xci / playbooks / provision-vm-nodes.yml
1 ---
2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2017 Ericsson AB and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10 - hosts: localhost
11   remote_user: root
12   vars_files:
13     - ../var/{{ ansible_os_family }}.yml
14     - ../var/opnfv.yml
15   roles:
16     # using these roles here ensures that we can reuse this playbook in different context
17     - role: remove-folders
18     - { role: clone-repository, project: "opnfv/releng", repo: "{{ OPNFV_RELENG_GIT_URL }}", dest: "{{ OPNFV_RELENG_PATH }}", version: "{{ OPNFV_RELENG_VERSION }}" }
19     - { role: clone-repository, project: "opnfv/bifrost", repo: "{{ OPENSTACK_BIFROST_GIT_URL }}", dest: "{{ OPENSTACK_BIFROST_PATH }}", version: "{{ OPENSTACK_BIFROST_VERSION }}" }
20   tasks:
21     - name: combine opnfv/releng and openstack/bifrost scripts/playbooks
22       copy:
23         src: "{{ OPNFV_RELENG_PATH }}/prototypes/bifrost/"
24         dest: "{{ OPENSTACK_BIFROST_PATH }}"
25     - name: destroy VM nodes created by previous deployment
26       command: "/bin/bash ./scripts/destroy-env.sh"
27       args:
28         chdir: "{{ OPENSTACK_BIFROST_PATH }}"
29     - name: create and provision VM nodes for the flavor {{ XCI_FLAVOR }}
30       command: "/bin/bash ./scripts/bifrost-provision.sh"
31       args:
32         chdir: "{{ OPENSTACK_BIFROST_PATH }}"