Skip to content

Commit

Permalink
Base role files
Browse files Browse the repository at this point in the history
  • Loading branch information
chirkin committed Aug 30, 2016
1 parent 89831fe commit 5725daa
Show file tree
Hide file tree
Showing 9 changed files with 130 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
language: python
python: "2.7"

# Use the new container infrastructure
sudo: false

# 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-playbook tests/test.yml -i tests/inventory --syntax-check

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
# ansible-role-docker
ansible-role-docker
=========

This role installs and configures the docker.

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

Ubuntu 16.04 Xenial Xerus

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


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


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

- hosts: servers
roles:
- { role: chirkin.ansible-role-docker }

License
-------

BSD

Author Information
------------------
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
8 changes: 8 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: daemon-reload
command: 'systemctl daemon-reload'

- name: restart docker
service:
name: docker
state: restarted
19 changes: 19 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
galaxy_info:
author: a4irkin
description: Ansible docker role

license: license (GPLv2, CC-BY, etc)

min_ansible_version: 1.2

- name: Ubuntu
versions:
- xenial

galaxy_tags:
- docker
- linux
- xenial
- installer

dependencies: []
33 changes: 33 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
- name: add docker repo apt key
apt_key:
keyserver=p80.pool.sks-keyservers.net
id=58118E89F3A912897C070ADBF76221572C52609D
state=present

- name: add docker repository
apt_repository:
repo="deb https://apt.dockerproject.org/repo ubuntu-xenial main"
update_cache=yes

- name: install docker
apt: name=docker-engine

- name: create /etc/systemd/system/docker.service.d directory
file:
dest=/etc/systemd/system/docker.service.d
recurse=yes
state=directory

- name: uploads docker configuration file
template:
src: 'docker/docker.conf.j2'
dest: '/etc/systemd/system/docker.service.d/docker.conf'
notify:
- 'daemon-reload'
- 'restart docker'

- name: install docker-py
pip: name=docker-py

- meta: flush_handlers
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:
- ansible-role-docker
2 changes: 2 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# vars file for .

0 comments on commit 5725daa

Please sign in to comment.