blob: 546fd4051401a3a580cd1aaa89dc367bd5adf059 [file] [log] [blame]
---
# ============LICENSE_START=======================================================
# Copyright (C) 2019 The Nordix Foundation. All rights reserved.
# ================================================================================
# 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.
#
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
- name: Set keypair name
set_fact:
keypair_name: "keypair-{{ stack_name }}"
- name: Delete keypair '{{ keypair_name }}'
os_keypair:
name: "{{ keypair_name }}"
state: absent
ignore_errors: yes
- name: Delete stack '{{ stack_name }}'
os_stack:
name: "{{ stack_name }}"
state: absent
wait: yes
ignore_errors: no
register: stack_delete_output
- name: Log stack delete output to console
debug:
msg: "{{ stack_delete_output }}"
- name: Create keypair '{{ keypair_name }}'
os_keypair:
name: "{{ keypair_name }}"
state: present
public_key_file: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub"
- name: Create stack '{{ stack_name }}'
os_stack:
name: "{{ stack_name }}"
state: present
template: "{{ engine_cache }}/config/heat-template.yaml"
environment:
- "{{ engine_cache }}/config/heat-environment.yaml"
parameters:
keypair: "{{ keypair_name }}"
wait: yes
ignore_errors: no
register: stack_create_output
- name: Log stack create output to console
debug:
msg: "{{ stack_create_output }}"
- name: Get stack list
shell: openstack stack list --property name={{ stack_name }}
register: stack_list_output
- name: Log stack list output to console
debug:
msg: "{{ stack_list_output.stdout_lines }}"
# vim: set ts=2 sw=2 expandtab: