From 871dc81da3c897c0c1d990ae3a1bc3b89563e289 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Wed, 25 Oct 2017 21:30:46 -0400 Subject: [PATCH] Avoid task duplication by using default(omit). --- awx/playbooks/project_update.yml | 36 +++----------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/awx/playbooks/project_update.yml b/awx/playbooks/project_update.yml index 6e1ff0b947..5dd0302b6d 100644 --- a/awx/playbooks/project_update.yml +++ b/awx/playbooks/project_update.yml @@ -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