From bc4f6ea47c325fbde1b2b70c0b3b18c4d4b95cf0 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Sun, 18 Feb 2018 15:23:31 +0000 Subject: [PATCH] Replace host_need_pip with standard override mechanism The variable host_need_pip is currently used to be selective about when pip is installed on the target hosts/containers. This is an unnecessary precaution given that if the repo container is not yet up, there is already a mechanism in place to detect this and override the constraint and get-pip script URL. By using this mechanism we get pip installed very early and pip's configuration is still correctly constrained. This patch ensures that this very same mechanism is used across the board instead of using two different mechanisms, thereby simplifying the approach. Change-Id: I22d2f5edf640b71cb80b3fd1de597ea7391db11c Implements: blueprint python-build-install-simplification Signed-off-by: Jesse Pretorius --- playbooks/containers-lxc-create.yml | 11 ++++++----- playbooks/containers-nspawn-create.yml | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/playbooks/containers-lxc-create.yml b/playbooks/containers-lxc-create.yml index ab04220334..8b73adaa0a 100644 --- a/playbooks/containers-lxc-create.yml +++ b/playbooks/containers-lxc-create.yml @@ -53,16 +53,17 @@ tags: - lxc-containers-create -# TODO(evrardjp): Remove host_need_pip in the future -# when the process building the repo is done before this step. -- name: Configure containers default software, but don't run pip yet +- name: Configure containers default software hosts: all_lxc_containers gather_facts: true user: root + pre_tasks: + - include: common-tasks/set-upper-constraints.yml + - include: common-tasks/set-pip-upstream-url.yml roles: - role: "openstack_hosts" - vars: - host_need_pip: False + vars_files: + - defaults/repo_packages/openstack_services.yml environment: "{{ deployment_environment_variables | default({}) }}" tags: - lxc-containers-create diff --git a/playbooks/containers-nspawn-create.yml b/playbooks/containers-nspawn-create.yml index 99b452d0c2..5eff4e59ca 100644 --- a/playbooks/containers-nspawn-create.yml +++ b/playbooks/containers-nspawn-create.yml @@ -41,17 +41,18 @@ tags: - nspawn-containers-create -# TODO(evrardjp): Remove host_need_pip in the future -# when the process building the repo is done before this step. -- name: Configure containers default software, but don't run pip yet +- name: Configure containers default software hosts: all_nspawn_containers gather_facts: true user: root + pre_tasks: + - include: common-tasks/set-upper-constraints.yml + - include: common-tasks/set-pip-upstream-url.yml roles: - role: "openstack_hosts" is_container: true - vars: - host_need_pip: False + vars_files: + - defaults/repo_packages/openstack_services.yml environment: "{{ deployment_environment_variables | default({}) }}" tags: - nspawn-containers-create