mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
Avoid task duplication by using default(omit).
This commit is contained in:
@@ -30,22 +30,7 @@
|
|||||||
repo: "{{scm_url}}"
|
repo: "{{scm_url}}"
|
||||||
version: "{{scm_branch|quote}}"
|
version: "{{scm_branch|quote}}"
|
||||||
force: "{{scm_clean}}"
|
force: "{{scm_clean}}"
|
||||||
accept_hostkey: "{{scm_accept_hostkey}}"
|
accept_hostkey: "{{scm_accept_hostkey|default(omit)}}"
|
||||||
when: scm_accept_hostkey is defined
|
|
||||||
register: scm_result
|
|
||||||
|
|
||||||
- name: Set the git repository version
|
|
||||||
set_fact:
|
|
||||||
scm_version: "{{ scm_result['after'] }}"
|
|
||||||
when: "'after' in scm_result"
|
|
||||||
|
|
||||||
- name: update project using git
|
|
||||||
git:
|
|
||||||
dest: "{{project_path|quote}}"
|
|
||||||
repo: "{{scm_url}}"
|
|
||||||
version: "{{scm_branch|quote}}"
|
|
||||||
force: "{{scm_clean}}"
|
|
||||||
when: scm_accept_hostkey is not defined
|
|
||||||
register: scm_result
|
register: scm_result
|
||||||
|
|
||||||
- name: Set the git repository version
|
- name: Set the git repository version
|
||||||
@@ -74,29 +59,14 @@
|
|||||||
when: scm_type == 'hg'
|
when: scm_type == 'hg'
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: update project using svn
|
|
||||||
subversion:
|
|
||||||
dest: "{{project_path|quote}}"
|
|
||||||
repo: "{{scm_url|quote}}"
|
|
||||||
revision: "{{scm_branch|quote}}"
|
|
||||||
force: "{{scm_clean}}"
|
|
||||||
when: not scm_username|default('')
|
|
||||||
register: scm_result
|
|
||||||
|
|
||||||
- name: Set the svn repository version
|
|
||||||
set_fact:
|
|
||||||
scm_version: "{{ scm_result['after'] }}"
|
|
||||||
when: "'after' in scm_result"
|
|
||||||
|
|
||||||
- name: update project using svn with auth
|
- name: update project using svn with auth
|
||||||
subversion:
|
subversion:
|
||||||
dest: "{{project_path|quote}}"
|
dest: "{{project_path|quote}}"
|
||||||
repo: "{{scm_url|quote}}"
|
repo: "{{scm_url|quote}}"
|
||||||
revision: "{{scm_branch|quote}}"
|
revision: "{{scm_branch|quote}}"
|
||||||
force: "{{scm_clean}}"
|
force: "{{scm_clean}}"
|
||||||
username: "{{scm_username|quote}}"
|
username: "{{scm_username|default(omit)}}"
|
||||||
password: "{{scm_password|quote}}"
|
password: "{{scm_password|default(omit)}}"
|
||||||
when: scm_username|default('')
|
|
||||||
register: scm_result
|
register: scm_result
|
||||||
|
|
||||||
- name: Set the svn repository version
|
- name: Set the svn repository version
|
||||||
|
|||||||
Reference in New Issue
Block a user