unify containers

This commit is contained in:
Antonio J. Delgado 2022-11-19 17:31:16 +02:00
parent 7032679179
commit aa45af5852
4 changed files with 19 additions and 125 deletions

View file

@ -14,7 +14,7 @@ ansible_python_interpreter: "/usr/bin/python2"
mastodon_docker_image: "moritzheiber/mastodon-docker"
mastodon_docker_network: "mastodon_network"
docker_command: podman
docker_command: docker
install_python_packages:
- package: "docker"
@ -22,20 +22,18 @@ uninstall_python_packages:
- package: "docker-py"
install_packages:
- package: "podman"
- package: "docker"
- package: "python-pip-whl"
- package: "python-setuptools"
- package: skopeo
- package: containernetworking-plugins
- package: docker-compose
uninstall_packages:
- package: "docker-engine"
- package: "docker"
- package: "docker-ce"
- package: "docker-ce-cli"
- package: "dockerio"
uninstall_packages: []
# - package: "docker-engine"
# - package: "docker"
# - package: "docker-ce"
# - package: "docker-ce-cli"
# - package: "dockerio"
run_preflight_checks: "true"
node_major_version: "16"

View file

@ -8,7 +8,3 @@
- import_tasks: docker/core.yml
- import_tasks: docker/docker.yml
when: docker_command == 'docker'
- import_tasks: docker/podman.yml
when: docker_command == 'podman'

View file

@ -1,100 +1,12 @@
# ---
# - docker_service:
# project_name: redis
# definition:
# version: "2.3"
# services:
# redis:
# image: redis:4.0-alpine
# networks:
# - "{{ mastodon_docker_network }}"
# restart: on-failure
# networks:
# "{{ mastodon_docker_network }}":
# external: true
---
- name: Clone Mastodon repo
git:
repo: https://github.com/mastodon/mastodon.git
dest: /usr/src/mastodon
depth: 1
# - docker_service:
# project_name: db
# definition:
# version: "2.3"
# services:
# db:
# image: postgresql:9.6-alpine
# networks:
# - "{{ mastodon_docker_network }}"
# restart: on-failure
# env_file: /mastodon/.env
# environment:
# - POSTGRES_USER: "{{ db_user }}"
# - POSTGRES_PASSWORD: "{{ db_password }}"
# - POSTGRES_DB: "{{ db_name }}"
# networks:
# "{{ mastodon_docker_network }}":
# external: true
# - docker_service:
# project_name: web
# definition:
# version: "2.3"
# services:
# web:
# image: "gargron/mastodon:v{{ mastodon_release }}"
# networks:
# - "{{ mastodon_docker_network }}"
# command: bundle exec rails s -p 3000 -b '0.0.0.0'
# restart: on-failure
# env_file: /mastodon/.env
# networks:
# "{{ mastodon_docker_network }}":
# external: true
# # notify: "restart caddy webserver"
# - docker_service:
# project_name: sidekiq
# definition:
# version: "2.3"
# services:
# sidekiq:
# image: "moritzheiber/mastodon-docker"
# networks:
# - "{{ mastodon_docker_network }}"
# command: bundle exec sidekiq -q default -q mailers -q pull -q push
# restart: on-failure
# env_file: /mastodon/.env
# networks:
# "{{ mastodon_docker_network }}":
# external: true
# - docker_service:
# project_name: streaming
# definition:
# version: "2.3"
# services:
# streaming:
# image: "moritzheiber/mastodon-docker"
# networks:
# - "{{ mastodon_docker_network }}"
# command: npm run start
# restart: on-failure
# env_file: /mastodon/.env
# networks:
# "{{ mastodon_docker_network }}":
# external: true
# # notify: "restart caddy webserver"
# # - docker_service:
# # project_name: web
# # definition:
# # version: "2.3"
# # services:
# # web:
# # image: "moritzheiber/mastodon-docker"
# # networks:
# # - "{{ mastodon_docker_network }}"
# # command: bundle exec rails s -p 3000 -b '0.0.0.0'
# # restart: on-failure
# # env_file: /mastodon/.env
# # networks:
# # "{{ mastodon_docker_network }}":
# # external: true
# # notify: "restart caddy webserver"
- name: Ensure Mastodon container is composed
community.docker.docker_compose:
project_name: mastodon
project_src: /usr/src/mastodon
state: present

View file

@ -1,12 +0,0 @@
---
- name: Clone Mastodon repo
git:
repo: https://github.com/mastodon/mastodon.git
dest: /usr/src/mastodon
depth: 1
- name: Ensure Mastodon container is composed
community.docker.docker_compose:
project_name: mastodon
project_src: /usr/src/mastodon
state: present