99d3b3e966
Newer apt supports phased updates. These updates mean a subset of servers will pull newly available packages. There are potentially good reasons for this like A/B testing and spreading out load for package updates. The problem is that it can create confusing situations when packages are not consistent when we expect them to be. Avoid this confusion by always installing the latest available packages. Change-Id: I995070823bc2456547ba9d2023d3de7e5d9b6810
56 lines
1.7 KiB
YAML
56 lines
1.7 KiB
YAML
- name: Remove Rackspace APT repo
|
|
file:
|
|
path: /etc/apt/sources.list.d/ospc.list
|
|
state: absent
|
|
register: rax_apt_repo_removed
|
|
|
|
- name: Remove Rackspace signing key
|
|
when: rax_apt_repo_removed.changed
|
|
command: apt-key del 4096R/CB1EF1DB
|
|
|
|
- name: Configure apt retries
|
|
copy:
|
|
mode: 0444
|
|
src: 80retry
|
|
dest: /etc/apt/apt.conf.d/80retry
|
|
|
|
- name: Disable apt translations
|
|
copy:
|
|
mode: 0444
|
|
src: 90no-translations
|
|
dest: /etc/apt/apt.conf.d/90no-translations
|
|
|
|
- name: Always install latest packages
|
|
copy:
|
|
mode: 0444
|
|
src: 95phased-updates
|
|
dest: /etc/apt/apt.conf.d/95phased-updates
|
|
|
|
- name: Replace sources.list file
|
|
copy:
|
|
src: 'sources.list.{{ ansible_facts.lsb.codename }}.{{ ansible_facts.architecture }}'
|
|
dest: /etc/apt/sources.list
|
|
notify: Update apt cache
|
|
|
|
- name: Configure Ubuntu ESM
|
|
block:
|
|
# Note technically this requires ubuntu-advantage-tools to be installed
|
|
# but the above notify to update apt caches won't have run by the time
|
|
# we get here. That should be ok because the Xenial nodes have all been
|
|
# around long enough to have ua installed.
|
|
- name: Get UA status
|
|
command: "ua status"
|
|
register: uastatus
|
|
- name: Attach UA
|
|
command: "ua attach --no-auto-enable {{ ubuntu_advantage_token }}"
|
|
when: "'This machine is not attached to a UA subscription.' in uastatus.stdout"
|
|
no_log: true
|
|
- name: Enable ESM
|
|
command: "ua enable esm-infra"
|
|
when: "'esm-infra yes enabled' not in uastatus.stdout"
|
|
when:
|
|
- ubuntu_advantage_token is defined
|
|
- enable_ubuntu_esm is defined and enable_ubuntu_esm
|
|
- ansible_distribution == 'Ubuntu'
|
|
- ansible_distribution_release == 'xenial'
|