Use the host python interpreter when delegating to localhost

In order to ensure that the localhost delegated task uses the host
python interpreter (to access host-installed libs like
python-selinux), the interpreter is set on the task.

see: https://review.openstack.org/#/c/474565/

Change-Id: I7b20dd195a6562981fc5c72cbf7d91f6b45f4fa2
This commit is contained in:
Marc Gariepy 2017-06-15 09:25:40 -04:00
parent 53f05ec3c7
commit 9c2d22532e
3 changed files with 10 additions and 0 deletions

View File

@ -31,6 +31,8 @@
- item.mon_host is defined
- item.keyring_src is defined
- item.client_name is defined
vars:
ansible_python_interpreter: "/usr/bin/python"
- name: Secure extra keyring file permissions
file:
@ -41,6 +43,8 @@
with_items: "{{ ceph_extra_confs }}"
when:
- item.keyring_src is defined
vars:
ansible_python_interpreter: "/usr/bin/python"
- name: Remove temp extra keyring files
file:

View File

@ -30,6 +30,8 @@
when:
- item.mon_host is defined
- item.client_name is defined
vars:
ansible_python_interpreter: "/usr/bin/python"
- name: Distribute extra key files
copy:
@ -165,5 +167,7 @@
state: "absent"
delegate_to: localhost
with_items: "{{ ceph_extra_confs }}"
vars:
ansible_python_interpreter: "/usr/bin/python"
tags:
- always

View File

@ -22,6 +22,8 @@
when:
- item.mon_host is defined
- item.src is defined
vars:
ansible_python_interpreter: "/usr/bin/python"
- name: Create extra ceph.conf files
copy: