openstack-ansible-tests/common-tasks/test-set-nodepool-vars.yml
Marc Gariepy aad497c8e5 Stop removing epel
Change-Id: I35eed489b6182634a29e1650c90ef825a528e873
2017-03-23 08:13:06 -04:00

58 lines
1.9 KiB
YAML

---
# Copyright 2016, 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: Check if this is an OpenStack-CI nodepool instance
stat:
path: /etc/nodepool/provider
register: nodepool
delegate_to: localhost
- name: Determine the existing Ubuntu repo URL
shell: 'awk "/^deb .*ubuntu\/? {{ ansible_distribution_release }} main/ {print \$2; exit}" /etc/apt/sources.list'
register: ubuntu_repo_url
changed_when: false
when:
- ansible_pkg_mgr == 'apt'
delegate_to: localhost
- name: Set apt repo facts based on discovered information
set_fact:
lxc_container_template_main_apt_repo: "{{ ubuntu_repo_url.stdout }}"
lxc_container_template_security_apt_rep: "{{ ubuntu_repo_url.stdout }}"
when:
- ansible_os_family == 'Debian'
- name: Install the RDO release package
yum:
name: "https://repos.fedorapeople.org/repos/openstack/openstack-ocata/rdo-release-ocata.rpm"
state: "present"
when:
- ansible_pkg_mgr == 'yum'
- name: Set the files to copy into the container cache for OpenStack-CI instances
set_fact:
lxc_container_cache_files:
- { src: '/etc/pip.conf', dest: '/etc/pip.conf' }
when:
- nodepool.stat.exists | bool
- name: Set Ubuntu Cloud Archive repo URL based on discovered information
set_fact:
uca_apt_repo_url: "{{ ubuntu_repo_url.stdout | netorigin }}/ubuntu-cloud-archive"
when:
- nodepool.stat.exists | bool
- ansible_pkg_mgr == 'apt'
- nodepool.stat.exists | bool