diff --git a/roles/docker-mediawiki/README.md b/roles/docker-mediawiki/README.md index 27979f03..83d2772b 100644 --- a/roles/docker-mediawiki/README.md +++ b/roles/docker-mediawiki/README.md @@ -142,3 +142,6 @@ wfLoadSkin( 'Vector' ); # Add more configuration options below. EOF ``` + +## Further Information +This role was adapted to solve some deprecation message. Please test it before using productive. [See this conversation](https://chatgpt.com/share/6781487e-45fc-800f-a35e-e93f49448176). diff --git a/roles/docker-mediawiki/tasks/main.yml b/roles/docker-mediawiki/tasks/main.yml index d6be0213..452e6d50 100644 --- a/roles/docker-mediawiki/tasks/main.yml +++ b/roles/docker-mediawiki/tasks/main.yml @@ -1,29 +1,10 @@ +--- +- name: "include docker/compose/database.yml" + include_tasks: docker/compose/database.yml + - name: "include tasks nginx-docker-proxy-domain.yml" include_tasks: nginx-docker-proxy-domain.yml -- name: "docker mediawiki" - docker_compose: - project_name: mediawiki - definition: - application: - log_driver: journald - image: mediawiki - restart: "{{docker_restart_policy}}" - depends_on: - - database - volumes: - - "mediawiki-data:/var/www/html/" - ports: - - "127.0.0.1:{{http_port}}:80" - database: - log_driver: journald - image: mariadb - environment: - MYSQL_DATABASE: mediawiki - MYSQL_ROOT_PASSWORD: "{{mediawiki_database_password}}" - MYSQL_USER: mediawiki - MYSQL_PASSWORD: "{{mediawiki_database_password}}" - MARIADB_AUTO_UPGRADE: "1" - volumes: - - database:/var/lib/mysql - restart: "{{docker_restart_policy}}" +- name: add docker-compose.yml + template: src=docker-compose.yml.j2 dest={{docker_compose_instance_directory}}docker-compose.yml + notify: docker compose project setup diff --git a/roles/docker-mediawiki/templates/docker-compose.yml.j2 b/roles/docker-mediawiki/templates/docker-compose.yml.j2 new file mode 100644 index 00000000..7cef1078 --- /dev/null +++ b/roles/docker-mediawiki/templates/docker-compose.yml.j2 @@ -0,0 +1,19 @@ +services: + +{% include 'templates/docker/services/' + database_type + '.yml.j2' %} + application: + log_driver: journald + restart: "{{docker_restart_policy}}" + depends_on: + - database + volumes: + - "mediawiki-data:/var/www/html/" + ports: + - "127.0.0.1:{{http_port}}:80" +{% include 'templates/docker/container/networks.yml.j2' %} +{% include 'templates/docker/container/depends-on-just-database.yml.j2' %} + +{% include 'templates/docker/compose/volumes.yml.j2' %} + data: + +{% include 'templates/docker/compose/networks.yml.j2' %} \ No newline at end of file diff --git a/roles/docker-mediawiki/vars/main.yml b/roles/docker-mediawiki/vars/main.yml new file mode 100644 index 00000000..9ab83cf3 --- /dev/null +++ b/roles/docker-mediawiki/vars/main.yml @@ -0,0 +1,3 @@ +docker_compose_project_name: "mediawiki" +database_password: "{{mediawiki_database_password}}" +database_type: "mariadb" \ No newline at end of file