| # Licensed to the Apache Software Foundation (ASF) under one or more contributor |
| # license agreements; and to You under the Apache License, Version 2.0. |
| --- |
| # This task will initialize the immortal DBs in the database account. |
| # This step is usually done only once per deployment. |
| |
| - include_tasks: db/recreateDb.yml |
| vars: |
| dbName: "{{ db.whisk.auth }}" |
| forceRecreation: False |
| |
| - include_tasks: db/recreateDoc.yml |
| vars: |
| dbName: "{{ db.whisk.auth }}" |
| doc: "{{ lookup('file', '{{ item }}') }}" |
| with_items: |
| - "{{ openwhisk_home }}/ansible/files/auth_index.json" |
| - "{{ openwhisk_home }}/ansible/files/filter_design_document.json" |
| - "{{ openwhisk_home }}/ansible/files/namespace_throttlings_design_document_for_subjects_db.json" |
| |
| - name: create necessary "auth" keys |
| include_tasks: db/recreateDoc.yml |
| vars: |
| key: "{{ lookup('file', 'files/auth.{{ item }}') }}" |
| dbName: "{{ db.whisk.auth }}" |
| doc: > |
| { |
| "_id": "{{ item }}", |
| "subject": "{{ item }}", |
| "namespaces": [{ |
| "name": "{{ item }}", |
| "uuid": "{{ key.split(":")[0] }}", |
| "key": "{{ key.split(":")[1] }}" |
| }] |
| } |
| with_items: "{{ db.authkeys }}" |