Merge pull request #3715 from ryanpetrello/local-python

properly set ansible_python_interpreter for local task execution

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
softwarefactory-project-zuul[bot]
2019-04-17 12:44:39 +00:00
committed by GitHub
2 changed files with 8 additions and 3 deletions

View File

@@ -47,7 +47,7 @@ class Command(BaseCommand):
created_by=superuser) created_by=superuser)
Host.objects.create(name='localhost', Host.objects.create(name='localhost',
inventory=i, inventory=i,
variables="ansible_connection: local", variables="ansible_connection: local\nansible_python_interpreter: '{{ ansible_playbook_python }}'",
created_by=superuser) created_by=superuser)
jt = JobTemplate.objects.create(name='Demo Job Template', jt = JobTemplate.objects.create(name='Demo Job Template',
playbook='hello_world.yml', playbook='hello_world.yml',

View File

@@ -18,7 +18,6 @@
# awx_license_type: "open" for AWX; else presume Tower # awx_license_type: "open" for AWX; else presume Tower
- hosts: all - hosts: all
connection: local
gather_facts: false gather_facts: false
tasks: tasks:
@@ -27,6 +26,7 @@
path: "{{project_path|quote}}" path: "{{project_path|quote}}"
state: absent state: absent
when: scm_delete_on_update|default('') when: scm_delete_on_update|default('')
delegate_to: localhost
- block: - block:
- name: check repo using git - name: check repo using git
@@ -59,6 +59,7 @@
scm_version: "{{ git_result['after'] }}" scm_version: "{{ git_result['after'] }}"
when: "'after' in git_result" when: "'after' in git_result"
when: scm_type == 'git' when: scm_type == 'git'
delegate_to: localhost
- block: - block:
- name: update project using hg - name: update project using hg
@@ -78,6 +79,7 @@
set_fact: set_fact:
scm_version: "{{scm_version|regex_replace('^([A-Za-z0-9]+).*$', '\\1')}}" scm_version: "{{scm_version|regex_replace('^([A-Za-z0-9]+).*$', '\\1')}}"
when: scm_type == 'hg' when: scm_type == 'hg'
delegate_to: localhost
- block: - block:
- name: update project using svn - name: update project using svn
@@ -99,6 +101,7 @@
set_fact: set_fact:
scm_version: "{{scm_version|regex_replace('^.*Revision: ([0-9]+).*$', '\\1')}}" scm_version: "{{scm_version|regex_replace('^.*Revision: ([0-9]+).*$', '\\1')}}"
when: scm_type == 'svn' when: scm_type == 'svn'
delegate_to: localhost
- block: - block:
- name: Ensure the project directory is present - name: Ensure the project directory is present
@@ -121,6 +124,7 @@
scm_version: "{{results.version}}" scm_version: "{{results.version}}"
when: results is defined when: results is defined
when: scm_type == 'insights' when: scm_type == 'insights'
delegate_to: localhost
- name: Repository Version - name: Repository Version
@@ -132,9 +136,9 @@
dest: "{{ scm_revision_output }}" dest: "{{ scm_revision_output }}"
content: "{{ scm_version }}" content: "{{ scm_version }}"
when: scm_version is defined and scm_revision_output is defined when: scm_version is defined and scm_revision_output is defined
delegate_to: localhost
- hosts: all - hosts: all
connection: local
gather_facts: false gather_facts: false
tasks: tasks:
@@ -158,3 +162,4 @@
when: doesRequirementsExist.stat.exists and galaxy_result is skipped when: doesRequirementsExist.stat.exists and galaxy_result is skipped
when: roles_enabled|bool when: roles_enabled|bool
delegate_to: localhost