Skip to content

Commit

Permalink
chore: Update ceems_lb config var
Browse files Browse the repository at this point in the history
* Ability to define ceems_lb config in single var

Signed-off-by: Mahendra Paipuri <[email protected]>
  • Loading branch information
mahendrapaipuri committed Apr 16, 2024
1 parent e6c309a commit 6e94dbe
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 39 deletions.
7 changes: 3 additions & 4 deletions roles/ceems_lb/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
ceems_lb_version: "0.1.0-rc.5"
ceems_lb_version: "0.1.0-rc.6"
ceems_lb_binary_local_dir: ""
ceems_lb_binary_url: https://github.com/{{ _ceems_lb_repo }}/releases/download/v{{ ceems_lb_version }}/ceems-{{ ceems_lb_version }}.linux-{{ go_arch }}.tar.gz
ceems_lb_checksums_url: https://github.com/{{ _ceems_lb_repo }}/releases/download/v{{ ceems_lb_version }}/sha256sums.txt
Expand All @@ -10,9 +10,8 @@ ceems_lb_web_listen_address: "0.0.0.0:9030"
ceems_lb_tls_server_config: {}
ceems_lb_http_server_config: {}
ceems_lb_basic_auth_users: {}
ceems_lb_backends: []
ceems_lb_strategy: resource-based
ceems_lb_db_path: ""
ceems_lb_config:
strategy: resource-based

ceems_lb_cli_args: []
ceems_lb_env_vars: {}
Expand Down
22 changes: 5 additions & 17 deletions roles/ceems_lb/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,16 @@ argument_specs:
ceems_lb_web_listen_address:
description: Address on which CEEMS Load Balancer will listen
default: "0.0.0.0:9020"
ceems_lb_backends:
ceems_lb_config:
description:
- List of TSDB backends.
- Each element is a dict with url and skip_tls_verify keys.
type: list
elements: dict
- Configuration of CEEMS LB.
- Keys and values are the same as in L(ceems_lb docs,https://github.com/mahendrapaipuri/ceems/blob/main/build/package/ceems_lb/config.yml).
type: dict
required: true
ceems_lb_strategy:
description:
- Load Balancer strategy.
default: resource-based
choices:
- round-robin
- least-connection
- resource-based
ceems_lb_db_path:
description: Path to CEEMS API server DB
default: ""
ceems_lb_tls_server_config:
description:
- Configuration for TLS authentication.
- Keys and values are the same as in L(ceems_lb docs,https://prometheus.io/docs/prometheus/latest/configuration/https/).
- Keys and values are the same as in L(docs,https://prometheus.io/docs/prometheus/latest/configuration/https/).
type: dict
ceems_lb_http_server_config:
description:
Expand Down
7 changes: 4 additions & 3 deletions roles/ceems_lb/molecule/alternative/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ provisioner:
group_vars:
all:
ceems_lb_web_listen_address: 127.0.0.1:8080
ceems_lb_backends:
- url: http://localhost:9090
skip_tls_verify: true
ceems_lb_config:
strategy: resource-based
backends:
- url: http://localhost:9090
ceems_lb_tls_server_config:
cert_file: /etc/ceems_lb/tls.cert
key_file: /etc/ceems_lb/tls.key
Expand Down
7 changes: 4 additions & 3 deletions roles/ceems_lb/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ provisioner:
group_vars:
all:
ceems_lb_web_listen_address: 127.0.0.1:9030
ceems_lb_backends:
- url: http://localhost:9090
skip_tls_verify: true
ceems_lb_config:
strategy: resource-based
backends:
- url: http://localhost:9090
7 changes: 4 additions & 3 deletions roles/ceems_lb/molecule/latest/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ provisioner:
group_vars:
all:
ceems_lb_version: latest
ceems_lb_backends:
- url: http://localhost:9090
skip_tls_verify: true
ceems_lb_config:
strategy: resource-based
backends:
- url: http://localhost:9090
5 changes: 3 additions & 2 deletions roles/ceems_lb/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@
notify: restart ceems_lb

- name: Copy the ceems_lb config file
ansible.builtin.template:
src: config.yaml.j2
ansible.builtin.copy:
dest: /etc/ceems_lb/config.yaml
owner: "{{ ceems_lb_system_user }}"
group: "{{ ceems_lb_system_group }}"
mode: "0640"
content: |
{{ ceems_lb_config | to_nice_yaml(indent=2) }}
notify: restart ceems_lb

- name: Allow ceems_lb port in SELinux on RedHat OS family
Expand Down
7 changes: 0 additions & 7 deletions roles/ceems_lb/templates/config.yaml.j2

This file was deleted.

0 comments on commit 6e94dbe

Please sign in to comment.