2 # deploy a Docker server with 1 Zookeeper, 3 Solr, 1 HAProxy
6 - name: Install prereqs from apt
15 - name: Install prereqs from pip
21 - name: Install apt key for Docker
23 apt_key: id=58118E89F3A912897C070ADBF76221572C52609D keyserver=hkp://p80.pool.sks-keyservers.net:80
25 - name: Install apt repository for Docker
27 apt_repository: repo="deb https://apt.dockerproject.org/repo debian-jessie main"
29 - name: Create docker group
33 - name: Add users to docker group
35 user: name={{ item }} groups=docker
36 with_items: "{{ docker_users }}"
38 - name: Install Docker Engine
40 apt: name=docker-engine
42 - name: Start up Docker
44 service: name=docker enabled=yes state=started
46 - name: Launch ZooKeeper
48 docker_container: name=zk1 image=jplock/zookeeper
50 - name: Get contents of /solr path in ZooKeeper
52 command: docker exec -t zk1 bin/zkCli.sh get /solr
55 - name: Create /solr path in ZooKeeper
57 command: docker exec -t zk1 bin/zkCli.sh create /solr []
58 when: zk1_solr.stdout.find('Node does not exist') != -1
60 # Separate paths for setting up Solr nodes
80 published_ports: 8983:8983
82 command: bash -c '/opt/solr/bin/solr start -f -z $ZK1_PORT_2181_TCP_ADDR:$ZK1_PORT_2181_TCP_PORT/solr'
90 published_ports: 8984:8983
92 command: bash -c '/opt/solr/bin/solr start -f -z $ZK1_PORT_2181_TCP_ADDR:$ZK1_PORT_2181_TCP_PORT/solr'
95 # wait for ZooKeeper to see all the solr nodes before proceeding
96 # look at Ansible until module
98 - name: Check lui collection
100 command: docker exec -t zk1 bin/zkCli.sh ls /solr/collections
101 register: lui_collection
103 - name: Create lui collection
105 command: docker exec -t solr1 bin/solr create -c lui -d /opt/solr/lui-solr -shards 2
106 when: (lui_collection.stdout_lines|last).find('lui') == -1