Skip to content

Commit

Permalink
Fix Galaxy lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Richter committed Dec 3, 2018
1 parent f74dd41 commit b246063
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 5 additions & 2 deletions tasks/in_place_upgrade.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# get the latest version of all the existing jar files
- name: "in_place_upgrade : detect version to upgrade from."
set_fact:
aem_cms_in_place_upgrade_existing_version: "{{ aem_cms_in_place_upgrade_existing_quickstarts | map('regex_replace', '^.*cq-quickstart-(.+)-standalone-quickstart.jar$', '\\1') | list | sort | reverse | list | first }}"
aem_cms_in_place_upgrade_existing_version:
"{{ aem_cms_in_place_upgrade_existing_quickstarts
| map('regex_replace', '^.*cq-quickstart-(.+)-standalone-quickstart.jar$', '\\1')
| list | sort | reverse | list | first }}"

# safe gate which only allows upgrades when allowed
- name: "in_place_upgrade : fail when upgrade is not allowed."
Expand All @@ -22,7 +25,7 @@
when: aem_cms_version is version_compare(aem_cms_in_place_upgrade_existing_version, '<')

# check if upgrading is allowed based on existing and new version
- name: "in_place_upgrade : fail when upgrade path from '{{ aem_cms_in_place_upgrade_existing_version }}' to '{{ aem_cms_version }}' is not allowed."
- name: "in_place_upgrade : fail when upgrade path to '{{ aem_cms_version }}' is not allowed."
fail:
msg: "Upgrade from {{ aem_cms_in_place_upgrade_existing_version }} to {{ aem_cms_version }} is not allowed."
when: aem_cms_in_place_upgrade_paths[aem_cms_in_place_upgrade_existing_version] is not defined or
Expand Down
10 changes: 6 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,16 @@

- name: "Set fact with existing quickstart paths."
set_fact:
aem_cms_in_place_upgrade_existing_quickstarts: "{{ aem_cms_existing_quickstarts.files | map(attribute='path') | list }}"
aem_cms_in_place_upgrade_existing_quickstarts:
"{{ aem_cms_existing_quickstarts.files | map(attribute='path') | list }}"

- name: Include tasks for in-place-upgrade when necessary.
include_tasks: in_place_upgrade.yml
# only perform in place upgrade when no jar containing aem_cms_version is present
when:
- aem_cms_in_place_upgrade_existing_quickstarts | map('basename') | list | select('search', aem_cms_version) | list | length == 0
- aem_cms_in_place_upgrade_existing_quickstarts | length > 0
- aem_cms_in_place_upgrade_existing_quickstarts | map('basename') | list
| select('search', aem_cms_version) | list | length == 0
- aem_cms_in_place_upgrade_existing_quickstarts | length > 0

- name: Unpack AEM.
shell: >-
Expand Down Expand Up @@ -86,4 +88,4 @@

- name: Setup i386 support for XMPFilesProcessor.
include_tasks: xmp_i386.yml
when: ansible_architecture == 'x86_64'
when: ansible_architecture == 'x86_64'

0 comments on commit b246063

Please sign in to comment.