diff options
author | Matt Clay <matt@mystile.com> | 2018-04-24 12:02:26 -0700 |
---|---|---|
committer | Matt Clay <matt@mystile.com> | 2018-04-24 13:53:05 -0700 |
commit | 05d6b2086f7969b8a6b44432fea1f2dabef0e855 (patch) | |
tree | 2c483d6d23cb361817dbd591a6d0c6163c6d1520 | |
parent | 74f14ac23d25e0c6be2468ceae5e87b62a22e0b1 (diff) | |
download | ansible-05d6b2086f7969b8a6b44432fea1f2dabef0e855.tar.gz |
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.
(cherry picked from commit 996f9c24676561d76efe5160a8ce2b6d6137c26b)
-rw-r--r-- | test/integration/targets/docker_secret/tasks/Ubuntu.yml | 31 | ||||
-rw-r--r-- | test/runner/setup/docker.sh | 3 |
2 files changed, 29 insertions, 5 deletions
diff --git a/test/integration/targets/docker_secret/tasks/Ubuntu.yml b/test/integration/targets/docker_secret/tasks/Ubuntu.yml index 8646409de1..cb03052109 100644 --- a/test/integration/targets/docker_secret/tasks/Ubuntu.yml +++ b/test/integration/targets/docker_secret/tasks/Ubuntu.yml @@ -29,8 +29,29 @@ - name: Add Docker repo shell: add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" -- name: Install Docker CE - apt: - name: docker-ce - state: present - update_cache: yes +- block: + - name: Prevent service restart + copy: + content: exit 101 + 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" diff --git a/test/runner/setup/docker.sh b/test/runner/setup/docker.sh index 10272e62d6..2d8b515e76 100644 --- a/test/runner/setup/docker.sh +++ b/test/runner/setup/docker.sh @@ -2,6 +2,9 @@ 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. if [ ! -f /usr/bin/python ] && [ -f /usr/bin/python3 ]; then ln -s /usr/bin/python3 /usr/bin/python |