Merge "AIO: Provide facility to exclude apt distributions"

This commit is contained in:
Jenkins 2017-03-09 14:32:12 +00:00 committed by Gerrit Code Review
commit d7ec0ffc95
3 changed files with 25 additions and 9 deletions

View File

@ -196,6 +196,11 @@ bootstrap_host_data_disk_min_size: 50
#bootstrap_host_ubuntu_repo: http://archive.ubuntu.com/ubuntu/ #bootstrap_host_ubuntu_repo: http://archive.ubuntu.com/ubuntu/
#bootstrap_host_ubuntu_security_repo: http://archive.ubuntu.com/ubuntu/ #bootstrap_host_ubuntu_security_repo: http://archive.ubuntu.com/ubuntu/
# Set the distribution suffixes that will be included in the apt repository configuration
bootstrap_host_apt_distribution_suffix_list:
- updates
- backports
# Set the components that will be included in the apt repository configuration # Set the components that will be included in the apt repository configuration
bootstrap_host_apt_components: bootstrap_host_apt_components:
- main - main

View File

@ -37,18 +37,24 @@
when: when:
- bootstrap_host_ubuntu_security_repo is not defined - bootstrap_host_ubuntu_security_repo is not defined
changed_when: false changed_when: false
failed_when: false
tags: tags:
- find-apt-security-repo - find-apt-security-repo
- name: Set apt repo facts based on discovered information - name: Set apt repo facts based on discovered information
set_fact: set_fact:
bootstrap_host_ubuntu_repo: "{{ ubuntu_repo.stdout_lines[0] }}" bootstrap_host_ubuntu_repo: "{{ ubuntu_repo.stdout_lines[0] }}"
bootstrap_host_ubuntu_security_repo: "{{ ubuntu_security_repo.stdout_lines[0] }}"
when: when:
- bootstrap_host_ubuntu_repo is not defined - bootstrap_host_ubuntu_repo is not defined
- bootstrap_host_ubuntu_security_repo is not defined
- ubuntu_repo is defined - ubuntu_repo is defined
- name: Set apt security repo facts based on discovered information
set_fact:
bootstrap_host_ubuntu_security_repo: "{{ ubuntu_security_repo.stdout_lines[0] }}"
when:
- bootstrap_host_ubuntu_security_repo is not defined
- ubuntu_security_repo is defined - ubuntu_security_repo is defined
- ubuntu_security_repo.stdout_lines | length > 0
- name: Configure apt's sources.list (Ubuntu only) - name: Configure apt's sources.list (Ubuntu only)
template: template:
@ -58,7 +64,6 @@
when: when:
- ansible_distribution == 'Ubuntu' - ansible_distribution == 'Ubuntu'
- bootstrap_host_ubuntu_repo is defined - bootstrap_host_ubuntu_repo is defined
- bootstrap_host_ubuntu_security_repo is defined
register: apt_sources_configure register: apt_sources_configure
- name: Update apt-cache - name: Update apt-cache

View File

@ -1,10 +1,16 @@
# {{ ansible_managed }} # {{ ansible_managed }}
# Base repositories # Base repository
deb {{ bootstrap_host_ubuntu_repo }} {{ ansible_distribution_release }} {{ bootstrap_host_apt_components | join(" ") }} deb {{ bootstrap_host_ubuntu_repo }} {{ ansible_distribution_release }} {{ bootstrap_host_apt_components | join(" ") }}
# Updates repositories
deb {{ bootstrap_host_ubuntu_repo }} {{ ansible_distribution_release }}-updates {{ bootstrap_host_apt_components | join(" ") }} {% if bootstrap_host_apt_distribution_suffix_list | length > 0 %}
# Backports repositories # Additional distribution repositories
deb {{ bootstrap_host_ubuntu_repo }} {{ ansible_distribution_release }}-backports {{ bootstrap_host_apt_components | join(" ") }} {% for suffix in bootstrap_host_apt_distribution_suffix_list %}
# Security repositories deb {{ bootstrap_host_ubuntu_repo }} {{ ansible_distribution_release }}-{{ suffix }} {{ bootstrap_host_apt_components | join(" ") }}
{% endfor %}
{% endif %}
{% if bootstrap_host_ubuntu_security_repo is defined %}
# Security repository
deb {{ bootstrap_host_ubuntu_security_repo }} {{ ansible_distribution_release }}-security {{ bootstrap_host_apt_components | join(" ") }} deb {{ bootstrap_host_ubuntu_security_repo }} {{ ansible_distribution_release }}-security {{ bootstrap_host_apt_components | join(" ") }}
{% endif %}