From a800a513ed00cad814d39f01d7c110b67002b74e Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Tue, 8 Nov 2016 18:30:28 -0500 Subject: [PATCH] Fix deprecated becomes logic Our previous way of doing becomes with include is no longer supported by ansible. Switch to the supported way of handling becomes. Change-Id: Ia213305fd874251b7abc6ee12c7058a7b459b61b Signed-off-by: Paul Belanger --- tasks/install.yaml | 1 + tasks/install/git.yaml | 2 ++ tasks/install/pip.yaml | 1 + tasks/main.yaml | 1 - tests/test.yaml | 2 +- 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tasks/install.yaml b/tasks/install.yaml index 0818c67..48758bd 100644 --- a/tasks/install.yaml +++ b/tasks/install.yaml @@ -18,6 +18,7 @@ when: shade_build_depends is not defined - name: Ensure build dependencies are installed. + become: yes package: name: "{{ item }}" state: installed diff --git a/tasks/install/git.yaml b/tasks/install/git.yaml index bf32f73..f5e9e70 100644 --- a/tasks/install/git.yaml +++ b/tasks/install/git.yaml @@ -13,12 +13,14 @@ # under the License. --- - name: Git clone shade. + become: yes git: dest: "{{ shade_git_dest }}" repo: "{{ shade_git_uri }}" version: "{{ shade_git_version }}" - name: Pip install shade from local git repo. + become: yes pip: extra_args: "{{ shade_pip_extra_args|default(omit) }}" name: "file://{{ shade_git_dest }}" diff --git a/tasks/install/pip.yaml b/tasks/install/pip.yaml index 61f3fd6..f55d44c 100644 --- a/tasks/install/pip.yaml +++ b/tasks/install/pip.yaml @@ -13,6 +13,7 @@ # under the License. --- - name: Install shade using pip. + become: yes pip: extra_args: "{{ shade_pip_extra_args|default(omit) }}" name: "{{ shade_pip_name }}" diff --git a/tasks/main.yaml b/tasks/main.yaml index ebbfbf9..6736e2d 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -16,4 +16,3 @@ include_vars: "{{ ansible_os_family }}.yaml" - include: install.yaml - become: yes diff --git a/tests/test.yaml b/tests/test.yaml index 36c2ba2..2f403f1 100644 --- a/tests/test.yaml +++ b/tests/test.yaml @@ -13,12 +13,12 @@ # under the License. --- - hosts: test - become: yes vars: rolename: "{{ lookup('pipe', 'pwd') | dirname | basename }}" pre_tasks: # Make sure OS does not have a stale package cache. - name: Update apt cache. + become: yes apt: update_cache: yes when: ansible_os_family == 'Debian'