Skip to content

Commit

Permalink
Avoid mixing pip and distribution packages.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Markos Chandras committed Apr 18, 2018
1 parent 9ad190a commit 41780d7
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 19 deletions.
6 changes: 1 addition & 5 deletions defaults/main.yml
Expand Up @@ -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:
Expand Down Expand Up @@ -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" }
Expand Down
14 changes: 0 additions & 14 deletions tasks/lxc_install.yml
Expand Up @@ -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
1 change: 1 addition & 0 deletions vars/redhat-7-host.yml
Expand Up @@ -30,6 +30,7 @@ lxc_hosts_distro_packages:
- lxc-devel
- lxc-libs
- lxc-templates
- python2-lxc
- unzip
- xz

Expand Down
1 change: 1 addition & 0 deletions vars/suse-42-host.yml
Expand Up @@ -35,6 +35,7 @@ lxc_hosts_distro_packages:
- libseccomp2
- lxc
- liblxc-devel
- python-lxc-python2
- xz

lxc_xz_bin: xz
Expand Down
1 change: 1 addition & 0 deletions vars/ubuntu-16.04-host.yml
Expand Up @@ -38,6 +38,7 @@ lxc_hosts_distro_packages:
- lxc-dev
- lxc-templates
- python-dev
- python-lxc
- python3-lxc
- systemd-container
- pxz
Expand Down

0 comments on commit 41780d7

Please sign in to comment.