Skip to content

Commit

Permalink
First Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pozgo committed Sep 19, 2016
1 parent 958935b commit 7bec293
Show file tree
Hide file tree
Showing 10 changed files with 167 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
language: python
python: "2.7"

# Use the new container infrastructure
sudo: required

# dist: EL

# Install ansible
addons:
apt:
packages:
- python-pip

install:
# Install ansible
- pip install ansible

# Check ansible version
- ansible --version

# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg

script:
# Basic role syntax check
- ansible-galaxy install -f million12.docker-experimental
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
49 changes: 47 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,47 @@
# ansible-role-docker-experimental
Ansible Role: Install Docker (experimental)
Ansible Role: Install Docker (experimental)
=========
[![Travis](https://img.shields.io/travis/million12/ansible-role-docker-experimental.svg)](https://travis-ci.org/million12/ansible-role-docker-experimental)
[![GitHub Open Issues](https://img.shields.io/github/issues/million12/ansible-role-docker-experimental.svg)](https://github.com/million12/ansible-role-docker-experimental/issues)
[![GitHub Stars](https://img.shields.io/github/stars/million12/ansible-role-docker-experimental.svg)](https://github.com/million12/ansible-role-docker-experimental)
[![GitHub Forks](https://img.shields.io/github/forks/million12/ansible-role-docker-experimental.svg)](https://github.com/million12/ansible-role-docker-experimental)
[![GitHub release](https://img.shields.io/github/release/million12/ansible-role-docker-experimental.svg)](https://github.com/million12/ansible-role-docker-experimental)
[![license](https://img.shields.io/github/license/million12/ansible-role-docker-experimental.svg)](https://github.com/million12/ansible-role-docker-experimental/blob/master/LICENSE)

---

This Role is installing Docker latest experimental version

Requirements
------------

Tested on CentOS 7 but should work on RHEL equivalents.

Role Variables
--------------

N/A

Dependencies
------------

N/A

Example Playbook
----------------

- hosts: servers
roles:
- { role: million12.docker-experimental, tags: ['install'] }

License
-------

MIT

Author Information
------------------

Author: Przemyslaw Ozgo (<przemek@m12.io>)

---
**Sponsored by [Prototype Brewery](http://prototypebrewery.io/)** - the new prototyping tool for building highly-interactive prototypes of your website or web app. Built on top of [Neos CMS](https://www.neos.io/) and [Zurb Foundation](http://foundation.zurb.com/) framework.
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# defaults file for million12.docker
6 changes: 6 additions & 0 deletions files/docker.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/experimental/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
16 changes: 16 additions & 0 deletions files/docker.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target docker.socket
Requires=docker.socket

[Service]
Type=notify
ExecStart=/usr/bin/docker daemon -H unix:///var/run/docker.sock
MountFlags=slave
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity

[Install]
WantedBy=multi-user.target
12 changes: 12 additions & 0 deletions files/docker.socket
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Docker Socket for the API
PartOf=docker.service

[Socket]
ListenStream=/var/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker

[Install]
WantedBy=sockets.target
23 changes: 23 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
galaxy_info:
author: Przemyslaw Ozgo
description: Install Docker - experimental release.
company: m12.io

license: MIT
min_ansible_version: 2.0

platforms:
- name: EL
versions:
- 7

categories:
- docker
- containers
- package

dependencies: []
# List your role dependencies here, one per line.
# Be sure to remove the '[]' above if you add dependencies
# to this list.
23 changes: 23 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
# tasks file for million12.docker
- name: Add Docker Repository
copy: src=docker.repo dest=/etc/yum.repos.d/docker.repo

- name: Install latest stable version
yum: name=docker-engine state=present

- copy: src=docker.service dest=/usr/lib/systemd/system/docker.service

- name: Install docker-python for ansible interaction
yum: name=docker-python state=present

- name: Add docker.socket file
copy: src=docker.socket dest=/usr/lib/systemd/system/docker.socket
- name: Enable docker.socket
raw: systemctl enable docker && systemctl start docker

- name: Making sure docker daemon is running.
service:
name: docker
enabled: yes
state: started
1 change: 1 addition & 0 deletions tests/inventory
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
localhost
5 changes: 5 additions & 0 deletions tests/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- { role: million12.docker-experimental, tags: ['install'] }

0 comments on commit 7bec293

Please sign in to comment.