openstack-ansible-tests/test-prepare-containers.yml
Kevin Carter f136720898 Remove pinned vars and set become:true
This patch removes the following pinned vars for test execution:

lxc_container_release:
This variable is set based on the host platform and should not
be fixed to this value in the playbook.

lxc_container_backing_store:
This value is dynamically set based on the host configuration
and 'dir' is the fallback value so it does not need to be set.

global_environment_variables:
This value is an *optional* variable. It was only ever set in
order to test that the functionality to apply the contents of
this variable work.

This patch also sets 'become: true' for the playbook to ensure
that the execution of the container creation/deletion is executed
as the root user.

Change-Id: Id6f35e1b9fef5096c06dffb1900c2d144bc5ece4
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-09-12 18:19:27 +01:00

32 lines
1.1 KiB
YAML

---
# Copyright 2015, Rackspace US, Inc.
#
# 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.
- include: destroy_containers.yml
when: destroy_first | default(True) | bool
- name: Playbook for creating containers
hosts: all_containers
become: true
gather_facts: false
roles:
- role: "lxc_container_create"
post_tasks:
- name: Wait for ssh to be available
local_action:
module: wait_for
port: "{{ ansible_ssh_port | default('22') }}"
host: "{{ ansible_ssh_host | default(inventory_hostname) }}"
search_regex: OpenSSH
delay: 1