Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
Ensures appropriate ownership of bundle files and ignores warning fro…
Browse files Browse the repository at this point in the history
…m curl (URI module is insufficient)
  • Loading branch information
cmgrote committed May 15, 2018
1 parent a054f70 commit c3b16c6
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tasks/bundles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,29 @@
###

- name: transfer bundles
synchronize: src={{ item }} dest={{ ibm_infosvr_openigc_assets_dir }}/bundles mode=push
synchronize:
src: "{{ item }}"
dest: "{{ ibm_infosvr_openigc_assets_dir }}/bundles"
mode: push
owner: no
group: no
with_items: "{{ ibm_infosvr_openigc_bundle_directories }}"

- name: list bundles to be deployed
find: file_type=directory paths={{ ibm_infosvr_openigc_assets_dir }}/bundles recurse=no
changed_when: False
register: list_of_openigc_bundles

- name: ensure bundles are owned by non-root user
file:
path: "{{ item.path }}"
owner: "{{ ibm_infosvr_openigc_dsadm_user }}"
group: "{{ ibm_infosvr_openigc_dsadm_group }}"
recurse: yes
become_user: root
become: yes
with_items: "{{ list_of_openigc_bundles.files }}"

- name: package each bundle into a zip archive
archive: format=zip path={{ item.path }}/* dest={{ item.path }}.zip
when: item.path is defined
Expand Down Expand Up @@ -54,6 +69,7 @@
-F file=@{{ item }}'
args:
chdir: "{{ ibm_infosvr_openigc_assets_dir }}/bundles"
warn: False
when: not ((item|replace(".zip", "")) in existing_openigc_bundles.json)
with_items: "{{ list_of_openigc_bundles_to_deploy.stdout_lines }}"

Expand All @@ -64,5 +80,6 @@
-F file=@{{ item }}'
args:
chdir: "{{ ibm_infosvr_openigc_assets_dir }}/bundles"
warn: False
when: (item|replace(".zip", "")) in existing_openigc_bundles.json
with_items: "{{ list_of_openigc_bundles_to_deploy.stdout_lines }}"

0 comments on commit c3b16c6

Please sign in to comment.