diff --git a/README.md b/README.md index 78fe0fb..c240a86 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,16 @@ hashi_vault_install: true # by default, set to true ``` This variable defines if the vault package is to be installed or not before configuring. If you install vault using another task, you can set this to `false`. +```yaml +install_docker_compose: false # by default, set to false +``` +This variables defines whether or not to install docker-compose on the host. + +```yaml +install_docker_compose_version: latest # by default, set to latest +``` +This variable defines the version of docker-compose to install. It support either `latest`, or the version number (`vX.Y.Z`). Officially, only versions `>=2.0.1` are supported, as the naming for most packages changed at this release. + Dependencies ------------ diff --git a/tasks/install_compose.yml b/tasks/install_compose.yml index 53c7e7b..4fef327 100644 --- a/tasks/install_compose.yml +++ b/tasks/install_compose.yml @@ -9,7 +9,7 @@ register: _docker_compose_new_release - name: "Check current compose version" - command: "{{ install_docker_compose_path }} --version" + command: "{{ install_docker_compose_path }} --version --short" register: _docker_compose_old_release check_mode: false changed_when: false @@ -23,7 +23,7 @@ - name: "Set facts for current compose release" ansible.builtin.set_fact: - install_docker_compose_current_version: "{{ _docker_compose_old_release.stdout | regex_search('(\\d+(\\.\\d+)+)') }}" + install_docker_compose_current_version: "{{ _docker_compose_old_release.stdout | regex_replace('v', '') }}" when: _docker_compose_old_release.stdout is defined and (_docker_compose_old_release.stdout | length > 0)