| # |
| # Licensed to the Apache Software Foundation (ASF) under one or more |
| # contributor license agreements. See the NOTICE file distributed with |
| # this work for additional information regarding copyright ownership. |
| # The ASF licenses this file to You 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. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| # |
| --- |
| # This task will install the standard actions and packages available in openwhisk-catalog repos. |
| |
| - set_fact: |
| catalog_location={{ item.value.location }} |
| catalog_repo_url={{ item.value.url }} |
| api_host={{ whisk_api_host_name | default(groups['edge'] | first) }} |
| version="HEAD" |
| repo_update="yes" |
| |
| - set_fact: |
| version={{ item.value.version }} |
| when: item.value.version is defined |
| |
| - set_fact: |
| repo_update={{ item.value.repo_update }} |
| when: item.value.repo_update is defined |
| |
| - set_fact: |
| skip_catalog_install="{{ item.value.skip | default(false) }}" |
| |
| - set_fact: |
| environment_catalog: |
| OPENWHISK_HOME: "{{ openwhisk_home }}" |
| |
| - set_fact: |
| environment_catalog: "{{ environment_catalog | combine( { the_item.key: the_item.value } ) }}" |
| when: item.value.environment is defined |
| with_dict: "{{ item.value.environment }}" |
| loop_control: |
| loop_var: the_item |
| |
| - name: "ensure catalog_location directory exists" |
| file: |
| path: "{{ catalog_location }}" |
| state: directory |
| |
| - name: download the catalog repository to the catalog location if necessary |
| git: |
| repo: "{{ catalog_repo_url }}" |
| dest: "{{ catalog_location }}" |
| update: "{{ repo_update }}" |
| version: "{{ version }}" |
| |
| - name: install the catalog from the catalog location |
| shell: ./installCatalogUsingWskdeploy.sh {{ catalog_auth_key }} {{ api_host }} {{ cli.path }} chdir="{{ catalog_location }}/packages" |
| environment: "{{ environment_catalog }}" |
| when: skip_catalog_install == false |