From 58e5fd719d428a68841071b233cf20cfbfe9f51a Mon Sep 17 00:00:00 2001 From: Laur Ivan Date: Fri, 28 Apr 2023 01:10:21 +0200 Subject: [PATCH] fix: Role works now. We need named volumes (not paths). --- defaults/main.yml | 23 ++++------------------- templates/docker-compose.yml.j2 | 9 +++++---- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 9a738b8..7e8f82f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,24 +1,16 @@ --- ## General -sonarqube_image: sonarqube:latest +sonarqube_image: sonarqube +sonarqube_db_image: postgres -sonarqube_http_port: 3000 +sonarqube_http_port: 9000 +sonarqube_api_port: 9001 # Sonarqube paths sonarqube_root_path: /var/local -# sonarqube_data_base: "{{ sonarqube_root_path }}/sonarqube" sonarqube_config_path: "{{ sonarqube_root_path }}/conf/sonarqube" -# sonarqube_data_volume: "{{ sonarqube_data_base }}/data" -# sonarqube_conf_volume: "{{ sonarqube_data_base }}/conf" -# sonarqube_logs_volume: "{{ sonarqube_data_base }}/logs" -# sonarqube_extensions_volume: "{{ sonarqube_data_base }}/extensions" -# sonarqube_bundled_plugins_volume: "{{ sonarqube_data_base }}/bundled_plugins" - -# sonarqube_db_volume: "{{ sonarqube_data_base }}/posgresql/db" -# sonarqube_db_data_volume: "{{ sonarqube_data_base }}/posgresql/data" - sonarqube_db_user: "changeme" sonarqube_db_password: "changeme" @@ -26,13 +18,6 @@ sonarqube_db_password: "changeme" # sonarqube_skeleton_paths: - "{{ sonarqube_config_path }}" - # - "{{ sonarqube_data_volume }}" - # - "{{ sonarqube_conf_volume }}" - # - "{{ sonarqube_logs_volume }}" - # - "{{ sonarqube_extensions_volume }}" - # - "{{ sonarqube_bundled_plugins_volume }}" - # - "{{ sonarqube_db_volume }}" - # - "{{ sonarqube_db_data_volume }}" # Add more templates to be copied into the config sonarqube_configuration_files: diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index 6aa42ea..0d58737 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -3,12 +3,12 @@ version: '3.9' services: sonarqube: image: "{{ sonarqube_image }}" - container_name: sonarqube-service restart: always env_file: - "{{ sonarqube_config_path | expanduser }}/env.sonarqube.conf" ports: - - "{{ sonarqube_http_port }}" + - "{{ sonarqube_http_port }}:9000" + - "{{ sonarqube_api_port }}:9001" # Add more ports if necessary networks: - sonarqube-net @@ -22,14 +22,15 @@ services: - db db: - image: postgres:12 - container_name: sonarqube-db + image: "{{ sonarqube_db_image }}" restart: always env_file: - "{{ sonarqube_config_path | expanduser }}/env.db.conf" volumes: - sonarqube_db:/var/lib/postgresql - postgresql_data:/var/lib/postgresql/data + networks: + - sonarqube-net volumes: postgresql_data: