From 41780d7afa91800fa2a6fce7295234c24654666f Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Wed, 18 Apr 2018 14:37:39 +0100 Subject: [PATCH] Avoid mixing pip and distribution packages. The hosts may end up in a rather messed up state when mixing distribution and pip packages. The python lxc bindings are already provided in the distro repositories so we can simply use these in order to keep the host as clean as possible. Change-Id: Ia370f393b961b453ad60e5539f5027d19bf4281f Implements: blueprint openstack-distribution-packages --- defaults/main.yml | 6 +----- tasks/lxc_install.yml | 14 -------------- vars/redhat-7-host.yml | 1 + vars/suse-42-host.yml | 1 + vars/ubuntu-16.04-host.yml | 1 + 5 files changed, 4 insertions(+), 19 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 47815f80..b9bcc1e1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -16,10 +16,9 @@ # Validate certificates when downloading LXC templates lxc_hosts_validate_certs: yes -# Set the package install state for distribution and pip packages +# Set the package install state for distribution packages # Options are 'present' and 'latest' lxc_hosts_package_state: "latest" -lxc_hosts_pip_package_state: "latest" # Mappings from Ansible reported architecture to distro release architecture lxc_architecture_mapping: @@ -111,9 +110,6 @@ lxc_net6_nat: false lxc_kernel_options: - { key: 'fs.inotify.max_user_instances', value: 1024 } -lxc_pip_packages: - - lxc-python2 - lxc_cache_sshd_configuration: - { regexp: "^PermitRootLogin", line: "PermitRootLogin prohibit-password" } - { regexp: "^TCPKeepAlive", line: "TCPKeepAlive yes" } diff --git a/tasks/lxc_install.yml b/tasks/lxc_install.yml index 8871a724..ae816fc4 100644 --- a/tasks/lxc_install.yml +++ b/tasks/lxc_install.yml @@ -18,17 +18,3 @@ - install-apt - install-yum - install-zypper - -- name: Install pip packages - pip: - name: "{{ lxc_pip_packages }}" - state: "{{ lxc_hosts_pip_package_state }}" - extra_args: >- - {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }} - {{ pip_install_options | default('') }} - register: install_packages - until: install_packages|success - retries: 5 - delay: 2 - tags: - - lxc-pip-packages diff --git a/vars/redhat-7-host.yml b/vars/redhat-7-host.yml index b4b10a34..bb6c74c4 100644 --- a/vars/redhat-7-host.yml +++ b/vars/redhat-7-host.yml @@ -30,6 +30,7 @@ lxc_hosts_distro_packages: - lxc-devel - lxc-libs - lxc-templates + - python2-lxc - unzip - xz diff --git a/vars/suse-42-host.yml b/vars/suse-42-host.yml index 40f50bb9..39d5049e 100644 --- a/vars/suse-42-host.yml +++ b/vars/suse-42-host.yml @@ -35,6 +35,7 @@ lxc_hosts_distro_packages: - libseccomp2 - lxc - liblxc-devel + - python-lxc-python2 - xz lxc_xz_bin: xz diff --git a/vars/ubuntu-16.04-host.yml b/vars/ubuntu-16.04-host.yml index 58534b17..ed38ab40 100644 --- a/vars/ubuntu-16.04-host.yml +++ b/vars/ubuntu-16.04-host.yml @@ -38,6 +38,7 @@ lxc_hosts_distro_packages: - lxc-dev - lxc-templates - python-dev + - python-lxc - python3-lxc - systemd-container - pxz