diff --git a/deploy/ansible/hosts b/deploy/ansible/hosts index 4a2565b96a..73948ad1b3 100644 --- a/deploy/ansible/hosts +++ b/deploy/ansible/hosts @@ -1,7 +1,11 @@ -#Inventory file, example configuration is presented below +[centos7] +35.195.89.33 -[CentOS] -35.195.103.159 +[debian8] +104.155.33.227 -[Ubuntu] -104.199.58.74 +[ubuntu16] +35.195.93.48 + +[all:vars] +ansible_ssh_user=iroha diff --git a/deploy/ansible/provisioning.yml b/deploy/ansible/provisioning.yml index a6a965b5ef..39eaed34b8 100644 --- a/deploy/ansible/provisioning.yml +++ b/deploy/ansible/provisioning.yml @@ -1,25 +1,34 @@ +#Inventory file, example configuration is presented below + --- - hosts: all vars: user: iroha #your user on the remote machine tasks: + - name: Test if docker is installed + command: docker --version + register: docker_exists + failed_when: false + - name: Download docker installation script get_url: url: https://get.docker.com dest: /tmp/script.sh mode: 0755 validate_certs: false + when: docker_exists.rc|int > 0 - name: Install docker using downloaded script shell: /tmp/script.sh args: chdir: /tmp + when: docker_exists.rc|int > 0 - name: Add usermod to run docker from {{ user }} user command: usermod -aG docker {{user}} become: yes - - - name: Start docker service + + - name: Make sure docker is running service: name=docker state=started become: yes