mirror of
https://github.com/ansible/awx.git
synced 2026-01-26 16:11:30 -03:30
Avoid task duplication by using default(omit).
This commit is contained in:
parent
1285e8ffef
commit
871dc81da3
@ -30,22 +30,7 @@
|
||||
repo: "{{scm_url}}"
|
||||
version: "{{scm_branch|quote}}"
|
||||
force: "{{scm_clean}}"
|
||||
accept_hostkey: "{{scm_accept_hostkey}}"
|
||||
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
|
||||
accept_hostkey: "{{scm_accept_hostkey|default(omit)}}"
|
||||
register: scm_result
|
||||
|
||||
- name: Set the git repository version
|
||||
@ -74,29 +59,14 @@
|
||||
when: scm_type == 'hg'
|
||||
|
||||
- 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
|
||||
subversion:
|
||||
dest: "{{project_path|quote}}"
|
||||
repo: "{{scm_url|quote}}"
|
||||
revision: "{{scm_branch|quote}}"
|
||||
force: "{{scm_clean}}"
|
||||
username: "{{scm_username|quote}}"
|
||||
password: "{{scm_password|quote}}"
|
||||
when: scm_username|default('')
|
||||
username: "{{scm_username|default(omit)}}"
|
||||
password: "{{scm_password|default(omit)}}"
|
||||
register: scm_result
|
||||
|
||||
- name: Set the svn repository version
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user