- tasks:
- - name: Get networks for Solr
- shell: "docker inspect --format={% raw %}'{{json .NetworkSettings.Networks}}'{% endraw %} solr1"
- register: solr1_networks
-
- - name: Attach Solr to luinet network
- command: docker network connect luinet solr1
- when: (solr1_networks.stdout|from_json).luinet is not defined
-
- - name: Detach Solr from bridge network
- command: docker network disconnect bridge solr1
- when: (solr1_networks.stdout|from_json).bridge is defined
-
- # - name: Create Solr container
- # docker_container:
- # name: solr1
- # tty: yes
- # published_ports: 8983:8983
- # #volumes: /vagrant/conf/solr/solr-home:/opt/solr/server/solr
- # command: bash -c '/opt/solr/bin/solr start -f -z zk1:2181'
+ - name: Create lui collection
+ become: yes
+ command: docker exec -t solr1 bin/solr create -c lui -d /opt/solr/lui-solr -shards 2 -replicationFactor 2
+ when: (lui_collection.stdout_lines|last).find('lui') == -1