docker_compose: Add Ubuntu / Debian support

This commit is contained in:
saibotk 2021-01-02 04:41:33 +01:00
parent 26a77be80b
commit 23d7bc1fcb
No known key found for this signature in database
GPG key ID: A3299C587D5DF523
5 changed files with 76 additions and 16 deletions

View file

@ -32,12 +32,8 @@ docker_compose_wrapper_path: /usr/local/bin/docker-compose
docker_compose_python_package_install: true
docker_compose_python_package_path: /opt/ansible-dependencies
# The name of the package to install pip via the package manager
docker_compose_python_pip_package: "python-pip"
# The package states of needed packages to install for the python libraries
docker_compose_python_pip_package_state: "present"
# The name of the package to install virtualenv via the package manager
docker_compose_python_virtualenv_package: "python-virtualenv"
docker_compose_python_virtualenv_package_state: "present"
# The pip package name of for `docker-compose`

View file

@ -8,6 +8,9 @@ galaxy_info:
- name: CentOS
versions:
- 7
- name: Ubuntu
versions:
- 20.04
galaxy_tags: []

View file

@ -0,0 +1,32 @@
---
# Tasks file for the docker_compose role
# Infrastructure
# Ansible instructions to deploy the infrastructure
#
# Copyright (C) 2020 Saibotk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
- name: Ensure pip & virtualenv are installed.
package:
name: "{{ item.name }}"
state: "{{ item.state }}"
loop:
- name: "python3-pip"
state: "{{ docker_compose_python_pip_package_state }}"
- name: "python3-virtualenv"
state: "{{ docker_compose_python_virtualenv_package_state }}"
when:
- docker_compose_python_package_install
become: true

View file

@ -0,0 +1,32 @@
---
# Tasks file for the docker_compose role
# Infrastructure
# Ansible instructions to deploy the infrastructure
#
# Copyright (C) 2020 Saibotk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
- name: Ensure pip & virtualenv are installed.
package:
name: "{{ item.name }}"
state: "{{ item.state }}"
loop:
- name: "python-pip"
state: "{{ docker_compose_python_pip_package_state }}"
- name: "python-virtualenv"
state: "{{ docker_compose_python_virtualenv_package_state }}"
when:
- docker_compose_python_package_install
become: true

View file

@ -23,17 +23,14 @@
state: "{{ docker_compose_package_state }}"
become: true
- name: Ensure pip & virtualenv is installed.
package:
name: "{{ item.name }}"
state: "{{ item.state }}"
become: true
loop:
- name: "{{ docker_compose_python_pip_package }}"
state: "{{ docker_compose_python_pip_package_state }}"
- name: "{{ docker_compose_python_virtualenv_package }}"
state: "{{ docker_compose_python_virtualenv_package_state }}"
when: docker_compose_python_package_install
- name: "Select tasks for {{ ansible_distribution }} {{ ansible_distribution_major_version }}"
include_tasks: "{{ distro_file }}"
with_first_found:
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
loop_control:
loop_var: distro_file
- name: Install docker-compose python package.
pip: