From 780f3691de1e213b43b3e1a086509d4cbc2fc46e Mon Sep 17 00:00:00 2001 From: Arseny Sher Date: Wed, 8 Oct 2014 14:52:09 +0400 Subject: [PATCH] infinispan role updated --- infinispan-server.yml | 6 +++ .../tasks/main.yml | 1 + test.yml | 44 +------------------ 3 files changed, 9 insertions(+), 42 deletions(-) create mode 100644 infinispan-server.yml rename roles/{infinispan => infinispan-server}/tasks/main.yml (81%) diff --git a/infinispan-server.yml b/infinispan-server.yml new file mode 100644 index 0000000..88bfc9d --- /dev/null +++ b/infinispan-server.yml @@ -0,0 +1,6 @@ +--- + +- hosts: docker-containers + roles: + - infinispan-server + diff --git a/roles/infinispan/tasks/main.yml b/roles/infinispan-server/tasks/main.yml similarity index 81% rename from roles/infinispan/tasks/main.yml rename to roles/infinispan-server/tasks/main.yml index c0ea5bf..e23103d 100644 --- a/roles/infinispan/tasks/main.yml +++ b/roles/infinispan-server/tasks/main.yml @@ -6,4 +6,5 @@ - unarchive: src=/root/infinispan-server-6.0.2.Final-bin.zip dest=/root/ copy=no - shell: rm /root/infinispan-server-6.0.2.Final-bin.zip - copy: src=~/lad/infinispan-conf/clustered.xml dest=/root/infinispan-server-6.0.2.Final/standalone/configuration/clustered.xml +- command: nohup /root/infinispan-server-6.0.2.Final/bin/clustered.sh >/dev/null &> /dev/null & diff --git a/test.yml b/test.yml index 3188567..80f1ebc 100644 --- a/test.yml +++ b/test.yml @@ -1,53 +1,13 @@ --- -- hosts: ansible-master - tasks: - - template: src=./base_system dest=/tmp/Dockerfile - - name: check ssh - debug: var=ansible_ssh_port - - hosts: docker-host-nodes sudo: yes roles: - - build - tasks: - - name: check ssh - debug: var=ansible_ssh_port - - name: install python-apt - apt: name=python-apt state=present - - name: get curl - apt: name=curl state=present - - name: download and install pip - shell: curl https://bootstrap.pypa.io/get-pip.py | sudo python - - name: install docker-py - pip: name=docker-py - - copy: src=/tmp/Dockerfile dest=/tmp/Dockerfile - - name: build base image - docker_image: name="ubuntu/sshjdk" path=/tmp/ tag=14.04 state=present - - - - name: run container - #this should be changed in non-local mode: net=host only - docker: state=running image=ubuntu/sshjdk:14.04 net=bridge ports=2222 count=2 privileged=yes - - name: Get facts about launched docker containers - docker_facts: - # add created containers to [docker-containers] - # this should be changed in non-local mode: we don't need to add containers to hosts - - name: add containers to [docker-containers] - add_host: hostname={{item.key}} ansible_ssh_host=172.17.42.1 ansible_ssh_port={{item.value.docker_ports[0].PublicPort}} ansible_ssh_user=root groups=docker-containers - when: item.value.docker_state.Running == True - with_dict: docker_containers - - name: get ips - debug: var=item.value.docker_networksettings.IPAddress - when: item.value.docker_state.Running == True - with_dict: docker_containers - - # check added hosts entries - # - template: src=docker_containers_tmpl dest=/tmp/docker_containers_result + - run - hosts: docker-containers roles: - - infinispan + - infinispan-server tasks: - name: check ssh debug: var=ansible_ssh_port