| # Call as |
| # $ ansible-playbook -l test -e source_file="/export/netapp/kupietz/genios-fulltext-mappings.csv.gz" index-kalamar-plugin-externalresources.yml |
| - name: Index Kalamar-Plugin-ExternalResources |
| hosts: test, main |
| serial: 1 |
| tasks: |
| - name: Get UID for KorAP user |
| getent: |
| database: passwd |
| key: korap |
| |
| - name: Stop and remove docker container, if existing |
| community.docker.docker_container: |
| image: "{{ external_image }}" |
| state: "absent" |
| name: "{{ external_container_name }}" |
| |
| - name: Start docker container for indexation |
| community.docker.docker_container: |
| image: "{{ external_image }}" |
| restart_policy: "no" |
| pull: false |
| name: "{{ external_indexer_name }}" |
| user: "{{ ansible_facts.getent_passwd[\"korap\"].1 }}" |
| detach: false |
| mounts: |
| - type: bind |
| source: "{{ external_path }}/db" |
| target: "/db" |
| - type: bind |
| source: "{{ external_path }}/.env" |
| target: "/.env" |
| - type: bind |
| source: "{{ source_file }}" |
| target: "{{ source_file }}" |
| command: "{{ source_file }}" |
| |
| - name: Restart docker container |
| community.docker.docker_container: |
| image: "{{ external_image }}" |
| restart_policy: "unless-stopped" |
| pull: false |
| name: "{{ external_container_name }}" |
| user: "{{ ansible_facts.getent_passwd[\"korap\"].1 }}" |
| detach: true |
| mounts: |
| - type: bind |
| source: "{{ external_path }}/db" |
| target: "/db" |
| - type: bind |
| source: "{{ external_path }}/.env" |
| target: "/.env" |
| ports: |
| - "{{ external_port }}" |