Skip to content

Commit

Permalink
Merge branch 'feature/ansible-install-docker' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
x3medima17 committed Oct 12, 2017
2 parents aca6070 + 4bc00e2 commit f6588cc
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
13 changes: 13 additions & 0 deletions deploy/ansible/hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#Inventory file, example configuration is presented below

[centos7]
35.195.89.33

[debian8]
104.155.33.227

[ubuntu16]
35.195.93.48

[all:vars]
ansible_ssh_user=iroha
32 changes: 32 additions & 0 deletions deploy/ansible/provisioning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
- 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: Make sure docker is running
service: name=docker state=started
become: yes

0 comments on commit f6588cc

Please sign in to comment.