Fix mysql-server install/upgrade on Ubuntu 16.04. (#39241)

* Fix mysql-server install/upgrade on Ubuntu 16.04.
* Prevent service restart in docker_secret test.
This commit is contained in:
Matt Clay 2018-04-24 12:02:26 -07:00 committed by GitHub
parent 0ca38ff595
commit 996f9c2467
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 5 deletions

View file

@ -29,8 +29,29 @@
- name: Add Docker repo - name: Add Docker repo
shell: add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" shell: add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- name: Install Docker CE - block:
apt: - name: Prevent service restart
name: docker-ce copy:
state: present content: exit 101
update_cache: yes dest: /usr/sbin/policy-rc.d
backup: yes
mode: 0755
register: policy_rc_d
- name: Install Docker CE
apt:
name: docker-ce
state: present
update_cache: yes
always:
- name: Restore /usr/sbin/policy-rc.d (if needed)
command: mv {{ policy_rc_d.backup_file }} /usr/sbin/policy-rc.d
when:
- "'backup_file' in policy_rc_d"
- name: Remove /usr/sbin/policy-rc.d (if needed)
file:
path: /usr/sbin/policy-rc.d
state: absent
when:
- "'backup_file' not in policy_rc_d"

View file

@ -2,6 +2,9 @@
set -eu set -eu
# Required for newer mysql-server packages to install/upgrade on Ubuntu 16.04.
rm -f /usr/sbin/policy-rc.d
# Support images with only python3 installed. # Support images with only python3 installed.
if [ ! -f /usr/bin/python ] && [ -f /usr/bin/python3 ]; then if [ ! -f /usr/bin/python ] && [ -f /usr/bin/python3 ]; then
ln -s /usr/bin/python3 /usr/bin/python ln -s /usr/bin/python3 /usr/bin/python