From efd03ccda7f64a507d2a84c259439956ac2737b4 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Mon, 23 Apr 2018 11:47:46 +0100 Subject: [PATCH] Revert "Install SELinux packages asynchronously" This reverts commit 5085d45d7b055da55b8eedba6d682cfedd6e6a57. Installing packages in the background doesn't seem so stable since sometimes we observe problems like the following one: ==> centos7: TASK [lxc_hosts : Ensure SELinux distro packages have finished installing] ***** ==> centos7: FAILED - RETRYING: Ensure SELinux distro packages have finished installing (30 retries left). ==> centos7: FAILED - RETRYING: Ensure SELinux distro packages have finished installing (29 retries left). ==> centos7: FAILED - RETRYING: Ensure SELinux distro packages have finished installing (28 retries left). ==> centos7: FAILED - RETRYING: Ensure SELinux distro packages have finished installing (27 retries left). ==> centos7: FAILED - RETRYING: Ensure SELinux distro packages have finished installing (26 retries left). ==> centos7: FAILED - RETRYING: Ensure SELinux distro packages have finished installing (25 retries left). ... ==> centos7: fatal: [localhost]: FAILED! => {"ansible_job_id": "350629830198.20986", "attempts": 30, "changed": false, "finished": 0, "started": 1} ==> centos7: to retry, use: --limit @/vagrant/tests/test.retry As such, lets revert the change and install them in the normal way. Change-Id: I6e6a890f2fa98e9874597b69e4caf2dfd78182f4 --- tasks/lxc_install_yum.yml | 10 ---------- tasks/lxc_selinux.yml | 10 ---------- vars/redhat-7-host.yml | 14 ++++---------- 3 files changed, 4 insertions(+), 30 deletions(-) diff --git a/tasks/lxc_install_yum.yml b/tasks/lxc_install_yum.yml index 701cd7b5..f214614d 100644 --- a/tasks/lxc_install_yum.yml +++ b/tasks/lxc_install_yum.yml @@ -86,16 +86,6 @@ tags: - lxc-packages -- name: Install distro SELinux packages asynchronously - package: - pkg: "{{ lxc_hosts_distro_selinux_packages }}" - state: "{{ lxc_hosts_package_state }}" - register: install_selinux_packages - async: 600 - poll: 0 - tags: - - lxc-packages - - name: Remove sub system lock if found file: path: "/var/lock/subsys/lxc" diff --git a/tasks/lxc_selinux.yml b/tasks/lxc_selinux.yml index 9d4a5ac3..08955f3c 100644 --- a/tasks/lxc_selinux.yml +++ b/tasks/lxc_selinux.yml @@ -13,16 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Ensure SELinux distro packages have finished installing - async_status: - jid: "{{ install_selinux_packages.ansible_job_id }}" - register: _install_selinux_packages - until: _install_selinux_packages.finished - retries: 30 - when: - - install_selinux_packages is defined - - not install_selinux_packages | skipped - - name: Create directory for compiling SELinux policy file: path: "/tmp/lxc-attach-selinux/" diff --git a/vars/redhat-7-host.yml b/vars/redhat-7-host.yml index bb6c74c4..01dfc1b0 100644 --- a/vars/redhat-7-host.yml +++ b/vars/redhat-7-host.yml @@ -26,24 +26,18 @@ lxc_hosts_distro_packages: - dnsmasq - git - libseccomp + - libselinux + - libselinux-devel - lxc - lxc-devel - lxc-libs - lxc-templates + - policycoreutils-python - python2-lxc + - selinux-policy-devel - unzip - xz -# NOTE(mhayden): This packages are required for building the SELinux policy -# for LXC on CentOS 7. They're separate from the main package list because -# they take a signficant of time to install and they can be installed while -# other tasks run. -lxc_hosts_distro_selinux_packages: - - libselinux - - libselinux-devel - - policycoreutils-python - - selinux-policy-devel - lxc_xz_bin: xz lxc_cached_network_interfaces: