diff --git a/README.md b/README.md index 9ef1ec1..394bc16 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Docker Role ========= -Install docker-engine +Install docker-engine and optionally docker-compose Role Variables -------------- @@ -15,6 +15,7 @@ Role Variables - `docker_log_driver` (optional): Log driver to use. Default: 'json-file' - `docker_logs_opts` (optional): Log driver options. Default: { 'max-file': '3', 'max-size': '100m' } - `docker_pip_package` (optional): The name of the packge to install to get pip on the system. For older systems that don't have Python 3 available, you can set this to `python-pip`. Default: `python3-pip` +- `docker_compose_version` (optional): if provided, docker-compose will be installed with the requested version. Default: "", i.e. docker-compose is not installed by default. Dependencies -------------- diff --git a/defaults/main.yml b/defaults/main.yml index ae3ab51..7d8e41c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -11,6 +11,7 @@ docker_options: storage-driver : "{{ docker_storage_driver |default(None) }}" log-driver: "{{ docker_log_driver |default('json-file') }}" log-opts: "{{ docker_logs_opts |default( { 'max-file': '3', 'max-size': '100m' } ) }}" +docker_compose_version: "" diff --git a/tasks/common.yml b/tasks/common.yml index 88de8b8..47a2255 100644 --- a/tasks/common.yml +++ b/tasks/common.yml @@ -11,3 +11,7 @@ - name: "Configure docker" include: configure.yml + +- name: "Install compose" + pip: name="docker-compose" state="present" version="{{ docker_compose_version }}" + when: docker_compose_version != ""