2 # Copyright 2015, Rackspace US, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
18 - name: Ensure that apt supports HTTPS package sources
20 name: apt-transport-https
23 - apt-install-prerequisites
25 - name: Determine the existing Ubuntu repo configuration
26 command: 'grep -oP "^deb \K(\[?.*\]?.*ubuntu\S*\/?)(?= {{ ansible_distribution_release }} main)" /etc/apt/sources.list'
29 - bootstrap_host_ubuntu_repo is not defined
34 - name: Determine the existing Ubuntu Security repo configuration
35 command: 'grep -oP "^deb \K(\[?.*\]?.*ubuntu\S*\/?)(?= {{ ansible_distribution_release }}-security main)" /etc/apt/sources.list'
36 register: ubuntu_security_repo
38 - bootstrap_host_ubuntu_security_repo is not defined
41 - find-apt-security-repo
43 - name: Set apt repo facts based on discovered information
45 bootstrap_host_ubuntu_repo: "{{ ubuntu_repo.stdout_lines[0] }}"
46 bootstrap_host_ubuntu_security_repo: "{{ ubuntu_security_repo.stdout_lines[0] }}"
48 - bootstrap_host_ubuntu_repo is not defined
49 - bootstrap_host_ubuntu_security_repo is not defined
50 - ubuntu_repo is defined
51 - ubuntu_security_repo is defined
53 - name: Configure apt's sources.list (Ubuntu only)
55 src: apt-sources.list.j2
56 dest: /etc/apt/sources.list
59 - ansible_distribution == 'Ubuntu'
60 - bootstrap_host_ubuntu_repo is defined
61 - bootstrap_host_ubuntu_security_repo is defined
62 register: apt_sources_configure
64 - name: Update apt-cache
68 - apt_sources_configure is defined
69 - apt_sources_configure | changed
74 - ansible_pkg_mgr == 'apt'
78 - name: Install RDO package
80 name: "{{ rdo_package }}"
82 register: install_cloud_rdo_package
83 until: install_cloud_rdo_package | success
87 - name: Install epel package
89 name: "{{ epel_package }}"
91 register: install_epel_package
92 until: install_epel_package | success
97 - ansible_pkg_mgr == 'yum'
99 - name: Remove known problem packages
103 with_items: "{{ packages_remove }}"
107 - name: Install packages
111 with_items: "{{ packages_install }}"