use include_tasks to make hg dependency optional

This commit is contained in:
AlanCoding
2020-05-01 10:37:37 -04:00
parent d1671d72dc
commit fcca0cee37
2 changed files with 18 additions and 16 deletions

View File

@@ -48,22 +48,8 @@
- update_git
- block:
- name: update project using hg
hg:
dest: "{{project_path|quote}}"
repo: "{{scm_url|quote}}"
revision: "{{scm_branch|quote}}"
force: "{{scm_clean}}"
register: hg_result
- name: Set the hg repository version
set_fact:
scm_version: "{{ hg_result['after'] }}"
when: "'after' in hg_result"
- name: parse hg version string properly
set_fact:
scm_version: "{{scm_version|regex_replace('^([A-Za-z0-9]+).*$', '\\1')}}"
- name: include hg tasks
include_tasks: project_update_hg_tasks.yml
tags:
- update_hg

View File

@@ -0,0 +1,16 @@
- name: update project using hg
hg:
dest: "{{project_path|quote}}"
repo: "{{scm_url|quote}}"
revision: "{{scm_branch|quote}}"
force: "{{scm_clean}}"
register: hg_result
- name: Set the hg repository version
set_fact:
scm_version: "{{ hg_result['after'] }}"
when: "'after' in hg_result"
- name: parse hg version string properly
set_fact:
scm_version: "{{scm_version|regex_replace('^([A-Za-z0-9]+).*$', '\\1')}}"