openstack-ansible/playbooks/lxc-containers-create.yml
Jean-Philippe Evrard 2a8aab45b3 Adapt to openstack_hosts/pip_install changes
The commit [1] introduced a change in the openstack_hosts role,
allowing it to be aware of group_vars/host_vars.

We therefore don't need the group matching in the variable
``openstack_host_specific_kernel_modules``.

On top of that, the commit [2] allowed repo management for all
hosts where openstack_hosts is applied, and commit [3] removed
UCA from pip install, which applies to all the hosts,
whether they are containers or not.
We should therefore add UCA to containers back.

[1]: https://review.openstack.org/#/c/515397
[2]: https://review.openstack.org/#/c/515399
[3]: https://review.openstack.org/#/c/515400/

Change-Id: Ic959a42f7c6fb33b80e646b6689fc2d54f4f9ac8
2017-12-02 14:31:20 +00:00

55 lines
1.9 KiB
YAML

---
# Copyright 2014, 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.
- name: Gather lxc container host facts
hosts: "{{ lxc_host_group | default('lxc_hosts')}}"
gather_facts: "{{ osa_gather_facts | default(True) }}"
- name: Create container(s)
hosts: "{{ container_group|default('all_containers') }}"
gather_facts: false
max_fail_percentage: 20
user: root
roles:
- role: "lxc_container_create"
post_tasks:
- name: Wait for container connectivity
wait_for_connection:
connect_timeout: "{{ lxc_container_wait_params.connect_timeout | default(omit) }}"
delay: "{{ lxc_container_wait_params.delay | default(omit) }}"
sleep: "{{ lxc_container_wait_params.sleep | default(omit) }}"
timeout: "{{ lxc_container_wait_params.timeout | default(omit) }}"
- name: Set local facts for new container(s)
setup:
filter: ansible_local
gather_subset: "!all"
vars:
is_metal: "{{ properties.is_metal|default(false) }}"
environment: "{{ deployment_environment_variables | default({}) }}"
tags:
- lxc-containers-create
- name: Configure containers default software
hosts: "{{ container_group|default('all_containers') }}"
gather_facts: true
user: root
roles:
- role: "openstack_hosts"
vars:
is_metal: "{{ properties.is_metal|default(false) }}"
environment: "{{ deployment_environment_variables | default({}) }}"
tags:
- lxc-containers-create