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

Commit

Permalink
Merge pull request #4 from IBM/cleanups
Browse files Browse the repository at this point in the history
Cleanups for linting
  • Loading branch information
cmgrote committed Dec 15, 2018
2 parents b73c98f + aa32052 commit f6352da
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 68 deletions.
6 changes: 3 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
###
# Copyright 2018 IBM Corp. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down
7 changes: 4 additions & 3 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
###
# Copyright 2018 IBM Corp. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -17,6 +17,7 @@
galaxy_info:

author: Christopher Grote
description: Automates deployment and management of custom asset types for IBM Information Governance Catalog
company: IBM
license: Apache 2.0

Expand Down
22 changes: 12 additions & 10 deletions tasks/assets.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
###
# Copyright 2018 IBM Corp. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -16,13 +16,15 @@
###

- name: upload any instances of OpenIGC assets
shell: >
curl
-X POST "https://{{ ibm_infosvr_openigc_services_host }}:{{ ibm_infosvr_openigc_services_console_port }}/ibm/iis/igc-rest/v1/bundles/assets/"
-u {{ ibm_infosvr_openigc_admin_user }}:{{ ibm_infosvr_openigc_admin_user_pwd }}
{% if ibm_infosvr_openigc_verify_selfsigned_ssl is defined and ibm_infosvr_openigc_verify_selfsigned_ssl %}--cacert cache/__ibm_infosvr_cert_root.crt{% endif %}
--header "Content-Type:application/xml"
-f -d @{{ item }}
command: "curl -X POST \
'https://{{ ibm_infosvr_openigc_services_host }}:\
{{ ibm_infosvr_openigc_services_console_port }}/ibm/iis/igc-rest/v1/bundles/assets/' \
-u {{ ibm_infosvr_openigc_admin_user }}:{{ ibm_infosvr_openigc_admin_user_pwd }} \
{% if ibm_infosvr_openigc_verify_selfsigned_ssl is defined and ibm_infosvr_openigc_verify_selfsigned_ssl %}
--cacert cache/__ibm_infosvr_cert_root.crt \
{% endif %}
--header 'Content-Type:application/xml' \
-f -d @{{ item }}"
args:
warn: False
with_items: "{{ assets_as_xml }}"
Expand Down
14 changes: 7 additions & 7 deletions tasks/assets_from_template.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
###
# Copyright 2018 IBM Corp. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -16,21 +16,21 @@
###

- name: ensure generated directory exists
local_action:
module: file
file:
path: generated/
state: directory
delegate_to: localhost

- name: load variables
include_vars:
file: "{{ outer_item }}"
name: __ibm_infosvr_openigc_assets

- name: generate asset XML from variables
local_action:
module: template
template:
src: assets.xml.j2
dest: generated/{{ outer_item | basename }}.xml
delegate_to: localhost

- name: load asset instances
include_tasks: assets.yml
Expand Down
56 changes: 31 additions & 25 deletions tasks/bundles.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
###
# Copyright 2018 IBM Corp. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -16,50 +16,56 @@
###

- name: ensure generated directory exists
local_action:
module: file
file:
path: generated/
state: directory
delegate_to: localhost

- name: package each bundle into a zip archive
local_action:
module: archive
archive:
format: zip
path: "{{ outer_item }}/*"
dest: "generated/{{ outer_item | basename }}.zip"
remove: no
delegate_to: localhost

- name: check for existing OpenIGC bundles that are registered
shell: >
curl
-X GET "https://{{ ibm_infosvr_openigc_services_host }}:{{ ibm_infosvr_openigc_services_console_port }}/ibm/iis/igc-rest/v1/bundles/"
-u {{ ibm_infosvr_openigc_admin_user }}:{{ ibm_infosvr_openigc_admin_user_pwd }}
{% if ibm_infosvr_openigc_verify_selfsigned_ssl is defined and ibm_infosvr_openigc_verify_selfsigned_ssl %}--cacert cache/__ibm_infosvr_cert_root.crt{% endif %}
-f
command: "curl -X GET \
'https://{{ ibm_infosvr_openigc_services_host }}:\
{{ ibm_infosvr_openigc_services_console_port }}/ibm/iis/igc-rest/v1/bundles/' \
-u {{ ibm_infosvr_openigc_admin_user }}:{{ ibm_infosvr_openigc_admin_user_pwd }} \
{% if ibm_infosvr_openigc_verify_selfsigned_ssl is defined and ibm_infosvr_openigc_verify_selfsigned_ssl %}
--cacert cache/__ibm_infosvr_cert_root.crt \
{% endif %}
-f"
args:
warn: False
delegate_to: localhost
register: ibm_infosvr_openigc_existing_bundles

- name: create OpenIGC bundles that are not registered
shell: >
curl
-X POST "https://{{ ibm_infosvr_openigc_services_host }}:{{ ibm_infosvr_openigc_services_console_port }}/ibm/iis/igc-rest/v1/bundles/"
-u {{ ibm_infosvr_openigc_admin_user }}:{{ ibm_infosvr_openigc_admin_user_pwd }}
{% if ibm_infosvr_openigc_verify_selfsigned_ssl is defined and ibm_infosvr_openigc_verify_selfsigned_ssl %}--cacert cache/__ibm_infosvr_cert_root.crt{% endif %}
-f -F file=@generated/{{ outer_item | basename }}.zip
command: "curl -X POST \
'https://{{ ibm_infosvr_openigc_services_host }}:\
{{ ibm_infosvr_openigc_services_console_port }}/ibm/iis/igc-rest/v1/bundles/' \
-u {{ ibm_infosvr_openigc_admin_user }}:{{ ibm_infosvr_openigc_admin_user_pwd }} \
{% if ibm_infosvr_openigc_verify_selfsigned_ssl is defined and ibm_infosvr_openigc_verify_selfsigned_ssl %}
--cacert cache/__ibm_infosvr_cert_root.crt \
{% endif %}
-f -F file=@generated/{{ outer_item | basename }}.zip"
args:
warn: False
delegate_to: localhost
when: not ((outer_item | basename) in (ibm_infosvr_openigc_existing_bundles.stdout | to_json))

- name: update OpenIGC bundles that are already registered
shell: >
curl
-X PUT "https://{{ ibm_infosvr_openigc_services_host }}:{{ ibm_infosvr_openigc_services_console_port }}/ibm/iis/igc-rest/v1/bundles/"
-u {{ ibm_infosvr_openigc_admin_user }}:{{ ibm_infosvr_openigc_admin_user_pwd }}
{% if ibm_infosvr_openigc_verify_selfsigned_ssl is defined and ibm_infosvr_openigc_verify_selfsigned_ssl %}--cacert cache/__ibm_infosvr_cert_root.crt{% endif %}
-f -F file=@generated/{{ outer_item | basename }}.zip
command: "curl -X PUT \
'https://{{ ibm_infosvr_openigc_services_host }}:\
{{ ibm_infosvr_openigc_services_console_port }}/ibm/iis/igc-rest/v1/bundles/' \
-u {{ ibm_infosvr_openigc_admin_user }}:{{ ibm_infosvr_openigc_admin_user_pwd }} \
{% if ibm_infosvr_openigc_verify_selfsigned_ssl is defined and ibm_infosvr_openigc_verify_selfsigned_ssl %}
--cacert cache/__ibm_infosvr_cert_root.crt \
{% endif %}
-f -F file=@generated/{{ outer_item | basename }}.zip"
args:
warn: False
delegate_to: localhost
Expand Down
22 changes: 12 additions & 10 deletions tasks/flows.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
###
# Copyright 2018 IBM Corp. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -16,13 +16,15 @@
###

- name: upload any lineage flows
shell: >
curl
-X POST "https://{{ ibm_infosvr_openigc_services_host }}:{{ ibm_infosvr_openigc_services_console_port }}/ibm/iis/igc-rest/v1/flows/upload/"
-u {{ ibm_infosvr_openigc_admin_user }}:{{ ibm_infosvr_openigc_admin_user_pwd }}
{% if ibm_infosvr_openigc_verify_selfsigned_ssl is defined and ibm_infosvr_openigc_verify_selfsigned_ssl %}--cacert cache/__ibm_infosvr_cert_root.crt{% endif %}
--header "Content-Type:application/xml"
-f -d @{{ item }}
command: "curl -X POST \
'https://{{ ibm_infosvr_openigc_services_host }}:\
{{ ibm_infosvr_openigc_services_console_port }}/ibm/iis/igc-rest/v1/flows/upload/' \
-u {{ ibm_infosvr_openigc_admin_user }}:{{ ibm_infosvr_openigc_admin_user_pwd }} \
{% if ibm_infosvr_openigc_verify_selfsigned_ssl is defined and ibm_infosvr_openigc_verify_selfsigned_ssl %}
--cacert cache/__ibm_infosvr_cert_root.crt \
{% endif %}
--header 'Content-Type:application/xml' \
-f -d @{{ item }}"
args:
warn: False
with_items: "{{ flows_as_xml }}"
Expand Down
14 changes: 7 additions & 7 deletions tasks/flows_from_template.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
###
# Copyright 2018 IBM Corp. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -16,21 +16,21 @@
###

- name: ensure generated directory exists
local_action:
module: file
file:
path: generated/
state: directory
delegate_to: localhost

- name: load variables
include_vars:
file: "{{ outer_item }}"
name: __ibm_infosvr_openigc_flows

- name: generate flow XML from variables
local_action:
module: template
template:
src: flow.xml.j2
dest: generated/{{ outer_item | basename }}.xml
delegate_to: localhost

- name: load lineage flow
include_tasks: flows.yml
Expand Down
6 changes: 3 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
###
# Copyright 2018 IBM Corp. All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down

0 comments on commit f6352da

Please sign in to comment.