Skip to content

Commit

Permalink
Add conditional dependency between enable_charts and provision_promet…
Browse files Browse the repository at this point in the history
…heus
  • Loading branch information
rtorrero committed Jan 19, 2024
1 parent 2fe03f9 commit 18403fb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ These variables are the defaults of our roles, if you want to override the prope
| provision_postgres | Run the postgres provisioning contained into postgres role, set to false if you provide an external postgres to the services | "true" |
| provision_rabbitmq | Run the rabbitmq provisioning contained into rabbitmq role, set to false if you provide an external rabbitmq to the services | "true" |
| provision_proxy | Run the nginx provisioning for exposing all the services, se to false if you don't want to expose the services or you have already in place a reverse proxy infrastructure | "true" |
| provision_prometheus | Run the prometheus provisioning used by trento to store metrics send by agents | "true" |
| provision_prometheus | Run the prometheus provisioning used by trento to store metrics send by agents | true when enable_charts is true or undefined |
| docker_network_name | Name of the docker network interface | trentonet |
| web_container_image | Name of the Web container image to use to create the container | ghcr.io/trento-project/trento-web:rolling |
| web_container_name | Name of the Web container | trento_web |
Expand Down Expand Up @@ -281,7 +281,7 @@ These variables are the defaults of our roles, if you want to override the prope
| nginx_vhost_http_listen_port | Configure the http listen port for trento (redirects to https by default) | 80 |
| nginx_vhost_https_listen_port | Configure the https listen port for trento | 443 |
| enable_api_key | Enable/Disable API key usage. Mostly for testing purposes | true |
| enable_charts | Enable/Disable charts display based on Prometheus metrics | true |
| enable_charts | Enable/Disable charts display based on Prometheus metrics | true when provision_prometheus is true or undefined |
| web_upstream_name | Web nginx upstream name | web |
| wanda_upstream_name | Wanda nginx upstream name | wanda |
| amqp_protocol | Change the amqp protocol type | amqp |
Expand Down
4 changes: 1 addition & 3 deletions playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,10 @@

- name: Provision prometheus
become: true
vars:
provision_prometheus: "true"
hosts: prometheus-hosts
roles:
- role: prometheus
when: provision_prometheus == 'true'
when: provision_prometheus | default(enable_charts | default('true')) == 'true'
become: true

- name: Provision rabbitmq
Expand Down
1 change: 0 additions & 1 deletion roles/containers/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ refresh_token_secret: "lookup('community.general.random_string', base64=True, le
web_admin_username: admin
enable_alerting: "false"
enable_api_key: "true"
enable_charts: "true"
amqp_protocol: amqp
prometheus_url: "http://host.docker.internal:9090"
2 changes: 1 addition & 1 deletion roles/containers/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@
ADMIN_USER: "{{ web_admin_username }}"
ADMIN_PASSWORD: "{{ web_admin_password }}"
ENABLE_API_KEY: "{{ enable_api_key }}"
CHARTS_ENABLED: "{{ enable_charts }}"
CHARTS_ENABLED: "{{ enable_charts | default(provision_prometheus | default('true')) }}"

0 comments on commit 18403fb

Please sign in to comment.