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 17, 2018
1 parent 74607c0 commit 02f05c8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
10 changes: 7 additions & 3 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

- name: "Fail when '{{ jenkins_casc_config_path }}' does not exist."
fail:
msg: "No file or directory found with path '{{ jenkins_casc_config_path }}'. Ensure that the configuration is on the instance before calling this role."
msg: >-
No file or directory found with path '{{ jenkins_casc_config_path }}'.
Ensure that the configuration is on the instance before calling this role."
when: not jenkins_casc_config_path_result.stat.exists

- name: "configure : configure jcasc plugin and apply configuration."
Expand All @@ -18,11 +20,13 @@
jcasc_path: "{{ jenkins_casc_config_path }}"
register: _jenkins_casc_plugin_configure_result
failed_when:
changed_when: (_jenkins_casc_plugin_configure_result.output | regex_replace('^Result:\\s*(.*)\\n*$', '\\1') | from_json).changed
changed_when: (_jenkins_casc_plugin_configure_result.output
| regex_replace('^Result:\\s*(.*)\\n*$', '\\1') | from_json).changed

- name: "configure : set _jenkins_casc_plugin_configure_result fact."
set_fact:
_jenkins_casc_plugin_configure_result: "{{ (_jenkins_casc_plugin_configure_result.output | regex_replace('^Result:\\s*(.*)\\n*$', '\\1') | from_json) }}"
_jenkins_casc_plugin_configure_result:
"{{ (_jenkins_casc_plugin_configure_result.output | regex_replace('^Result:\\s*(.*)\\n*$', '\\1') | from_json) }}"

- name: "configure : fail when configuration throws exception."
fail:
Expand Down
3 changes: 2 additions & 1 deletion tasks/reload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

- name: "reload : set _jenkins_casc_upload_files_result fact."
set_fact:
_jenkins_casc_upload_files_result: "{{ (_jenkins_casc_upload_files_result.output | regex_replace('^Result:\\s*(.*)\\n*$', '\\1') | from_json) }}"
_jenkins_casc_upload_files_result:
"{{ (_jenkins_casc_upload_files_result.output | regex_replace('^Result:\\s*(.*)\\n*$', '\\1') | from_json) }}"

- name: "reload : fail when configuration throws exception."
fail:
Expand Down
9 changes: 6 additions & 3 deletions tasks/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
- name: "upload : fail on overlapping file names."
fail:
msg:
- "Found duplicate file(s) to deploy! Please ensure that the filenames are unique, otherwise unexpected result may occur!"
- "Found duplicate file(s) to deploy!"
- "Please ensure that the filenames are unique, otherwise unexpected result may occur!"
- "Complete file list: "
- "{{ _jenkins_casc_found_config_files }}"
when: _jenkins_casc_found_config_files | default({}) | map('basename') | list != _jenkins_casc_found_config_files | default({}) | map('basename') | list | unique
when: _jenkins_casc_found_config_files | default({}) | map('basename') | list !=
_jenkins_casc_found_config_files | default({}) | map('basename') | list | unique

- name: "upload : create configuration dir."
file:
Expand Down Expand Up @@ -41,7 +43,8 @@
path: "{{ item }}"
state: absent
# build list of uploaded and found file paths and delete the difference
with_items: "{{ _jenkins_casc_config_existing_files.files | map(attribute='path') | list | difference(_jenkins_casc_upload_files_result.results | map(attribute='dest') | list) }}"
with_items: "{{ _jenkins_casc_config_existing_files.files | map(attribute='path') | list
| difference(_jenkins_casc_upload_files_result.results | map(attribute='dest') | list) }}"
register: _jenkins_casc_unmanaged_result

when:
Expand Down

0 comments on commit 02f05c8

Please sign in to comment.