├── .clog.toml ├── .editorconfig ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── LICENSE ├── Makefile ├── README.md ├── Vagrantfile ├── ansible.cfg ├── defaults └── main.yml ├── meta ├── main.yml └── readme.yml ├── tasks ├── install.yml └── main.yml └── tests └── main.yml /.clog.toml: -------------------------------------------------------------------------------- 1 | [clog] 2 | changelog = "CHANGELOG.md" 3 | repository = "https://github.com/weareinteractive/ansible-docker-compose" 4 | from-latest-tag = true 5 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | # Change these settings to your own preference 9 | indent_size = 2 10 | indent_style = space 11 | 12 | # We recommend you to keep these unchanged 13 | charset = utf-8 14 | end_of_line = lf 15 | insert_final_newline = true 16 | trim_trailing_whitespace = true 17 | 18 | [Makefile] 19 | indent_style = tab 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.retry 3 | .DS_Store 4 | .vagrant 5 | .vscode 6 | .idea 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: python 3 | 4 | 5 | before_install: 6 | - sudo apt-get update -qq 7 | - sudo apt-get install -qq python-apt python-pycurl aptitude 8 | 9 | install: 10 | - pip install ansible 11 | - ansible-galaxy install weareinteractive.docker 12 | 13 | script: 14 | - echo localhost > inventory 15 | - ln -s ansible-docker-compose ../weareinteractive.docker_compose 16 | - ansible-playbook --syntax-check -i inventory tests/main.yml 17 | - ansible-playbook -i inventory tests/main.yml --connection=local --become -vvvv 18 | 19 | notifications: 20 | webhooks: https://galaxy.ansible.com/api/v1/notifications/ 21 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | ### 1.5.1 (2019-07-10) 3 | 4 | 5 | 6 | 7 | 8 | ## 1.5.0 (2019-07-10) 9 | 10 | 11 | #### Bug Fixes 12 | 13 | * change pip2 to pip3 ([f38ea977](https://github.com/weareinteractive/ansible-docker-compose/commit/f38ea9772460df9bbf43721da5423ff75df796c4)) 14 | 15 | #### Features 16 | 17 | * add variables to switch pip version Merge branch 'FabGre-FabGre/fix-docker-compose-install' ([eeb09230](https://github.com/weareinteractive/ansible-docker-compose/commit/eeb09230e84bfd82d25c35d656bb37eaf33155aa)) 18 | * add variables to switch pip ([0fd4a7fe](https://github.com/weareinteractive/ansible-docker-compose/commit/0fd4a7fe4bc5eeab6f983ca1333626c0be691364)) 19 | 20 | 21 | 22 | 23 | ### 1.4.1 (2019-07-10) 24 | 25 | 26 | 27 | 28 | 29 | ## 1.4.0 (2018-11-11) 30 | 31 | 32 | #### Features 33 | 34 | * remove easy_install ([aa4dd011](https://github.com/weareinteractive/ansible-docker-compose/commit/aa4dd011be6c12289e85219bbbec7d3b79785503)) 35 | 36 | 37 | 38 | 39 | ## 1.3.0 (2018-10-25) 40 | 41 | 42 | #### Features 43 | 44 | * update galaxy organization name ([69adb6a2](https://github.com/weareinteractive/ansible-docker-compose/commit/69adb6a2beb59cb0dd24a0a5169b559e1a3e1fae)) 45 | 46 | 47 | 48 | 49 | ### 1.2.3 (2018-04-24) 50 | 51 | 52 | #### Features 53 | 54 | * add docker_compose_pip_version variable to set specific pip version ([df2dc391](https://github.com/weareinteractive/ansible-docker-compose/commit/df2dc391b3bd4576998af282895af8f6b84d9df3)) 55 | 56 | 57 | 58 | 59 | ### 1.2.2 (2017-03-09) 60 | 61 | 62 | 63 | 64 | 65 | ### 1.2.1 (2015-12-08) 66 | 67 | 68 | #### Bug Fixes 69 | 70 | * fix check if 'docker_compose_version' is defined ([a913ce12](https://github.com/weareinteractive/ansible-docker-compose/commit/a913ce121e0b8d8b6343bd9f1aa7395349c6f8c9)) 71 | 72 | 73 | 74 | 75 | ## 1.2.0 (2015-12-03) 76 | 77 | 78 | #### Features 79 | 80 | * using ansible-role docgen for README geneartion ([4cf660a6](https://github.com/weareinteractive/ansible-docker-compose/commit/4cf660a6fe0c904abf0b1c46fc176c9875e56933)) 81 | * adds CHANGELOG ([04959ad4](https://github.com/weareinteractive/ansible-docker-compose/commit/04959ad42662e77d9f8246babc7e892243d005b0)) 82 | * adds opensuse and other platform support by using `ansible_pkg_mgr` ([53d6cf42](https://github.com/weareinteractive/ansible-docker-compose/commit/53d6cf42762f88b0feb1282fd89b870dab1e088d)) 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) We Are Interactive 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | lint: 2 | ansible-lint . 3 | 4 | ubuntu18.04: 5 | vagrant up bionic 6 | vagrant destroy -f bionic 7 | 8 | ubuntu16.04: 9 | vagrant up xenial 10 | vagrant destroy -f xenial 11 | 12 | centos7: 13 | vagrant up centos7 14 | vagrant destroy -f centos7 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ansible weareinteractive.docker_compose role 2 | 3 | [![Build Status](https://img.shields.io/travis/weareinteractive/ansible-docker-compose.svg)](https://travis-ci.org/weareinteractive/ansible-docker-compose) 4 | [![Galaxy](http://img.shields.io/badge/galaxy-weareinteractive.docker_compose-blue.svg)](https://galaxy.ansible.com/weareinteractive/docker-compose) 5 | [![GitHub Tags](https://img.shields.io/github/tag/weareinteractive/ansible-docker-compose.svg)](https://github.com/weareinteractive/ansible-docker-compose) 6 | [![GitHub Stars](https://img.shields.io/github/stars/weareinteractive/ansible-docker-compose.svg)](https://github.com/weareinteractive/ansible-docker-compose) 7 | 8 | > `weareinteractive.docker_compose` is an [Ansible](http://www.ansible.com) role which: 9 | > 10 | > * installs docker-compose 11 | 12 | ## Installation 13 | 14 | Using `ansible-galaxy`: 15 | 16 | ```shell 17 | $ ansible-galaxy install weareinteractive.docker_compose 18 | ``` 19 | 20 | Using `requirements.yml`: 21 | 22 | ```yaml 23 | - src: weareinteractive.docker_compose 24 | ``` 25 | 26 | Using `git`: 27 | 28 | ```shell 29 | $ git clone https://github.com/weareinteractive/ansible-docker-compose.git weareinteractive.docker_compose 30 | ``` 31 | 32 | ## Dependencies 33 | 34 | * Ansible >= 2.4 35 | * installed docker i.e. with [weareinteractive.docker_compose](https://github.com/weareinteractive/ansible-docker) 36 | 37 | **Note:** 38 | 39 | > Since Ansible Galaxy switched all role names to the organization name, this role has moved from `franklinkim.docker-compose` to `weareinteractive.docker_compose`! 40 | 41 | ## Variables 42 | 43 | Here is a list of all the default variables for this role, which are also available in `defaults/main.yml`. 44 | 45 | ```yaml 46 | --- 47 | 48 | # version 49 | docker_compose_version: 50 | # dependencies e.g. python3-pip 51 | docker_compose_packages: 52 | - python-pip 53 | # pip executable e.g. pip3 54 | docker_compose_pip_executable: pip 55 | 56 | ``` 57 | 58 | 59 | ## Usage 60 | 61 | This is an example playbook: 62 | 63 | ```yaml 64 | --- 65 | 66 | - hosts: all 67 | become: yes 68 | roles: 69 | - weareinteractive.docker 70 | - weareinteractive.docker_compose 71 | vars: 72 | docker_compose_version: 1.21.0 73 | docker_compose_pip_version: pip #pip==9.0.3 74 | 75 | ``` 76 | 77 | 78 | ## Testing 79 | 80 | ```shell 81 | $ git clone https://github.com/weareinteractive/ansible-docker-compose.git 82 | $ cd ansible-docker-compose 83 | $ make test 84 | ``` 85 | 86 | ## Contributing 87 | In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests and examples for any new or changed functionality. 88 | 89 | 1. Fork it 90 | 2. Create your feature branch (`git checkout -b my-new-feature`) 91 | 3. Commit your changes (`git commit -am 'Add some feature'`) 92 | 4. Push to the branch (`git push origin my-new-feature`) 93 | 5. Create new Pull Request 94 | 95 | *Note: To update the `README.md` file please install and run `ansible-role`:* 96 | 97 | ```shell 98 | $ gem install ansible-role 99 | $ ansible-role docgen 100 | ``` 101 | 102 | ## License 103 | Copyright (c) We Are Interactive under the MIT license. 104 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | $script = <<-SCRIPT 5 | distribution=$(cat /etc/issue | head -n +1 | awk '{print $1}') 6 | if [ "$distribution" = "Ubuntu" ]; then 7 | sudo apt-get update 8 | sudo apt-get install -y python 9 | elif [ "$distribution" = "CentOS" ]; then 10 | echo "done" 11 | fi 12 | SCRIPT 13 | 14 | Vagrant.configure("2") do |config| 15 | config.vbguest.no_remote = true 16 | config.vbguest.auto_update = false 17 | 18 | # Ubuntui 19 | 20 | config.vm.define 'bionic' do |instance| 21 | instance.vm.box = 'ubuntu/bionic64' 22 | end 23 | 24 | config.vm.define 'xenial' do |instance| 25 | instance.vm.box = 'ubuntu/xenial64' 26 | end 27 | 28 | # CentOS 29 | 30 | config.vm.define 'centos7' do |instance| 31 | instance.vm.box = 'centos/7' 32 | end 33 | 34 | config.vm.provision "shell", inline: $script 35 | 36 | 37 | # View the documentation for the provider you're using for more 38 | # information on available options. 39 | config.vm.provision "ansible" do |ansible| 40 | ansible.playbook = "tests/main.yml" 41 | ansible.verbose = 'vv' 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | roles_path = ../ -------------------------------------------------------------------------------- /defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | # version 4 | docker_compose_version: 5 | # dependencies e.g. python3-pip 6 | docker_compose_packages: 7 | - python-pip 8 | # pip executable e.g. pip3 9 | docker_compose_pip_executable: pip 10 | -------------------------------------------------------------------------------- /meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | galaxy_info: 3 | author: franklin 4 | company: We Are Interactive 5 | description: Installs docker-compose 6 | min_ansible_version: 2.4 7 | license: MIT 8 | # Optionally specify the branch Galaxy will use when accessing the GitHub 9 | # repo for this role. During role install, if no tags are available, 10 | # Galaxy will use this branch. During import Galaxy will access files on 11 | # this branch. If travis integration is cofigured, only notification for this 12 | # branch will be accepted. Otherwise, in all cases, the repo's default branch 13 | # (usually master) will be used. 14 | github_branch: master 15 | # 16 | # Below are all platforms currently available. Just uncomment 17 | # the ones that apply to your role. If you don't see your 18 | # platform on this list, let us know and we'll get it added! 19 | # 20 | platforms: 21 | - name: EL 22 | versions: 23 | - all 24 | # - 5 25 | # - 6 26 | # - 7 27 | #- name: GenericUNIX 28 | # versions: 29 | # - all 30 | # - any 31 | #- name: Solaris 32 | # versions: 33 | # - all 34 | # - 10 35 | # - 11.0 36 | # - 11.1 37 | # - 11.2 38 | # - 11.3 39 | #- name: Fedora 40 | # versions: 41 | # - all 42 | # - 16 43 | # - 17 44 | # - 18 45 | # - 19 46 | # - 20 47 | # - 21 48 | # - 22 49 | # - 23 50 | #- name: Windows 51 | # versions: 52 | # - all 53 | # - 2012R2 54 | #- name: SmartOS 55 | # versions: 56 | # - all 57 | # - any 58 | - name: opensuse 59 | versions: 60 | # - all 61 | # - 12.1 62 | # - 12.2 63 | # - 12.3 64 | # - 13.1 65 | - 13.2 66 | #- name: Amazon 67 | # versions: 68 | # - all 69 | # - 2013.03 70 | # - 2013.09 71 | #- name: GenericBSD 72 | # versions: 73 | # - all 74 | # - any 75 | #- name: FreeBSD 76 | # versions: 77 | # - all 78 | # - 10.0 79 | # - 10.1 80 | # - 10.2 81 | # - 8.0 82 | # - 8.1 83 | # - 8.2 84 | # - 8.3 85 | # - 8.4 86 | # - 9.0 87 | # - 9.1 88 | # - 9.1 89 | # - 9.2 90 | # - 9.3 91 | - name: Ubuntu 92 | versions: 93 | - all 94 | # - lucid 95 | # - maverick 96 | # - natty 97 | # - oneiric 98 | # - precise 99 | # - quantal 100 | # - raring 101 | # - saucy 102 | # - trusty 103 | # - utopic 104 | # - vivid 105 | # - wily 106 | #- name: SLES 107 | # versions: 108 | # - all 109 | # - 10SP3 110 | # - 10SP4 111 | # - 11 112 | # - 11SP1 113 | # - 11SP2 114 | # - 11SP3 115 | #- name: GenericLinux 116 | # versions: 117 | # - all 118 | # - any 119 | - name: Debian 120 | versions: 121 | - all 122 | # - etch 123 | # - jessie 124 | # - lenny 125 | # - squeeze 126 | # - wheezy categories: 127 | # 128 | # List tags for your role here, one per line. A tag is 129 | # a keyword that describes and categorizes the role. 130 | # Users find roles by searching for tags. Be sure to 131 | # remove the '[]' above if you add tags to this list. 132 | # 133 | # NOTE: A tag is limited to a single word comprised of 134 | # alphanumeric characters. Maximum 20 tags per role. 135 | galaxy_tags: 136 | - docker 137 | - docker-compose 138 | # List your role dependencies here, one per line. Only 139 | # dependencies available via galaxy should be listed here. 140 | # Be sure to remove the '[]' above if you add dependencies 141 | # to this list. 142 | dependencies: [] 143 | 144 | -------------------------------------------------------------------------------- /meta/readme.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | galaxy_name: weareinteractive.docker_compose 4 | github_user: weareinteractive 5 | github_name: ansible-docker-compose 6 | badges: | 7 | [![Build Status](https://img.shields.io/travis/weareinteractive/ansible-docker-compose.svg)](https://travis-ci.org/weareinteractive/ansible-docker-compose) 8 | [![Galaxy](http://img.shields.io/badge/galaxy-weareinteractive.docker_compose-blue.svg)](https://galaxy.ansible.com/weareinteractive/docker-compose) 9 | [![GitHub Tags](https://img.shields.io/github/tag/weareinteractive/ansible-docker-compose.svg)](https://github.com/weareinteractive/ansible-docker-compose) 10 | [![GitHub Stars](https://img.shields.io/github/stars/weareinteractive/ansible-docker-compose.svg)](https://github.com/weareinteractive/ansible-docker-compose) 11 | description: | 12 | > * installs docker-compose 13 | after_dependencies: | 14 | * installed docker i.e. with [weareinteractive.docker_compose](https://github.com/weareinteractive/ansible-docker) 15 | 16 | **Note:** 17 | 18 | > Since Ansible Galaxy switched all role names to the organization name, this role has moved from `franklinkim.docker-compose` to `weareinteractive.docker_compose`! 19 | -------------------------------------------------------------------------------- /tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - name: Installing packages 4 | package: 5 | name: "{{ docker_compose_packages }}" 6 | state: present 7 | 8 | - name: Installing docker compose 9 | pip: 10 | name: docker-compose 11 | version: "{{ docker_compose_version | default(omit) }}" 12 | executable: "{{ docker_compose_pip_executable }}" 13 | state: present 14 | -------------------------------------------------------------------------------- /tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - import_tasks: install.yml 4 | tags: 5 | - development 6 | - docker-compose 7 | - install 8 | - docker-compose-install 9 | 10 | -------------------------------------------------------------------------------- /tests/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | - hosts: all 4 | become: yes 5 | roles: 6 | - weareinteractive.docker 7 | - weareinteractive.docker_compose 8 | vars: 9 | docker_compose_version: 1.21.0 10 | docker_compose_pip_version: pip #pip==9.0.3 11 | --------------------------------------------------------------------------------