Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

Commit

Permalink
## [1.0.0]
Browse files Browse the repository at this point in the history
### Changed
- initial commit
  • Loading branch information
elnebuloso authored and elnebuloso committed Dec 3, 2017
1 parent feb47d7 commit d858eb2
Show file tree
Hide file tree
Showing 11 changed files with 147 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
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/
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [1.0.0]
### Changed
- initial commit
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License
The MIT License (MIT)

Copyright (c) 2017 Jeff Tunessen
Copyright (c) 2016 Jeff Tunessen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,36 @@
# ansible-role-docker-compose
# Ansible Role - Docker Compose

[![Build Status](https://travis-ci.org/elnebuloso/ansible-role-docker-compose.svg?branch=master)](https://travis-ci.org/elnebuloso/ansible-role-docker-compose)

## Requirements

This role requires Ansible 2.0 or higher, and platform requirements are listed in the metadata file.

## Supported Distributions

- ubuntu14
- ubuntu16

## Role Variables

- [`defaults/main.yml`](https://github.com/elnebuloso/ansible-role-docker-compose/blob/master/defaults/main.yml)

## Example Playbook

```
- hosts: localhost
roles:
- role: elnebuloso.docker-compose
```

## Dependencies

None.

## License

MIT

## Author Information

This role was created in 2016 by [elnebuloso](https://github.com/elnebuloso/)
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.0
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
docker_compose_version: "1.17.1"
16 changes: 16 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
galaxy_info:
author: elnebuloso
description: docker compose
license: license (MIT)

min_ansible_version: 2.0

platforms:
- name: Ubuntu
versions:
- trusty
- xenial

galaxy_tags: []

dependencies: []
44 changes: 44 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
- name: "check for installed docker-compose binary"
stat: path=/usr/local/bin/docker-compose
register: docker_compose_check_bin
changed_when: false

- name: "check for installation"
set_fact: docker_compose_installed_version="no version installed"
changed_when: false

- name: "check if docker-compose {{docker_compose_version}} is installed"
command: docker-compose --version
register: docker_compose_check_installed
when: docker_compose_check_bin.stat.exists == true
changed_when: false

- name: "check docker-compose version"
set_fact: docker_compose_installed_version="{{docker_compose_check_installed.stdout}}"
when: docker_compose_check_installed.stdout is defined
changed_when: false

- name: "check docker-compose version"
debug:
msg: "{{docker_compose_installed_version}}"

- name: "check kernel (system) for correct docker-compose installation"
shell: echo $(uname -s)
register: docker_compose_uname_kernel_system
changed_when: false
when: 'docker_compose_version not in docker_compose_installed_version'

- name: "check kernel (machine) for correct docker-compose installation"
shell: echo $(uname -m)
register: docker_compose_uname_kernel_machine
changed_when: false
when: 'docker_compose_version not in docker_compose_installed_version'

- name: "install docker-compose"
get_url:
url: "https://github.com/docker/compose/releases/download/{{docker_compose_version}}/docker-compose-{{docker_compose_uname_kernel_system.stdout}}-{{docker_compose_uname_kernel_machine.stdout}}"
dest: /usr/local/bin/docker-compose
mode: 0755
force: yes
when: 'docker_compose_version not in docker_compose_installed_version'
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: ansible-role-docker-compose

0 comments on commit d858eb2

Please sign in to comment.