From fbd8530fce85365555f911103b1b03d1e8d8634a Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Sun, 3 Nov 2024 20:57:09 +0100 Subject: [PATCH] Use host network for gitea container. --- roles/role_configure_ovh_instance/files/containers.conf | 2 +- roles/role_deploy_gitea/tasks/main.yml | 6 +----- roles/role_deploy_mysql-server/tasks/main.yml | 6 ++++++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/roles/role_configure_ovh_instance/files/containers.conf b/roles/role_configure_ovh_instance/files/containers.conf index f3dc74d..24951da 100644 --- a/roles/role_configure_ovh_instance/files/containers.conf +++ b/roles/role_configure_ovh_instance/files/containers.conf @@ -4,4 +4,4 @@ # uses the hosts file from the container image or "none" which means # no base hosts file is used. The default is "" which will use /etc/hosts. -base_hosts_file = "none" +#base_hosts_file = "none" diff --git a/roles/role_deploy_gitea/tasks/main.yml b/roles/role_deploy_gitea/tasks/main.yml index a32ba90..ba7e703 100644 --- a/roles/role_deploy_gitea/tasks/main.yml +++ b/roles/role_deploy_gitea/tasks/main.yml @@ -80,10 +80,7 @@ image: docker.io/gitea/gitea:1.22.3 state: present network: - - reverse-proxy - - mysqlnet - ports: - - 2222:22/tcp + - host volume: - /mnt/volumes/gitea_data/data:/data:Z env: @@ -94,7 +91,6 @@ GITEA__database__NAME: "gitea" GITEA__database__USER: "gitea" GITEA__database__PASSWD: "{{ gitea_db_password }}" - dns_search: "{{ SHORTNAME }}-sub.{{ DOMAIN }}" generate_systemd: path: /etc/systemd/system become: true diff --git a/roles/role_deploy_mysql-server/tasks/main.yml b/roles/role_deploy_mysql-server/tasks/main.yml index 4d23807..6690b9d 100644 --- a/roles/role_deploy_mysql-server/tasks/main.yml +++ b/roles/role_deploy_mysql-server/tasks/main.yml @@ -98,3 +98,9 @@ state: restarted become: true when: create_mysql_container is changed + +- name: Add mysql-server.{{ DOMAIN }} to /etc/hosts + ansible.builtin.lineinfile: + path: "/etc/hosts" + line: "127.0.0.1 mysql-server.{{ DOMAIN }} mysql-server" + become: true