Skip to content

Commit

Permalink
molecule cleanup (reduce code dupl)
Browse files Browse the repository at this point in the history
  • Loading branch information
rpelisse committed Oct 3, 2023
1 parent 300b0bc commit 4f981e0
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 126 deletions.
2 changes: 1 addition & 1 deletion molecule/all_auth/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ provisioner:
ssh_connection:
pipelining: false
playbooks:
prepare: prepare.yml
prepare: ../prepare.yml
converge: converge.yml
verify: verify.yml
inventory:
Expand Down
2 changes: 1 addition & 1 deletion molecule/all_cluster/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ provisioner:
ssh_connection:
pipelining: false
playbooks:
prepare: prepare.yml
prepare: ../prepare.yml
converge: converge.yml
verify: verify.yml
inventory:
Expand Down
10 changes: 0 additions & 10 deletions molecule/all_cluster/prepare.yml

This file was deleted.

2 changes: 1 addition & 1 deletion molecule/connect/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ provisioner:
ssh_connection:
pipelining: false
playbooks:
prepare: prepare.yml
prepare: ../prepare.yml
converge: converge.yml
verify: verify.yml
inventory:
Expand Down
10 changes: 0 additions & 10 deletions molecule/connect/prepare.yml

This file was deleted.

2 changes: 1 addition & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ provisioner:
ssh_connection:
pipelining: false
playbooks:
prepare: prepare.yml
prepare: ../prepare.yml
converge: converge.yml
verify: verify.yml
inventory:
Expand Down
10 changes: 0 additions & 10 deletions molecule/default/prepare.yml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion molecule/ssl_auth_sasl/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ provisioner:
ssh_connection:
pipelining: false
playbooks:
prepare: prepare.yml
prepare: ../prepare_ssl.yml
converge: converge.yml
verify: verify.yml
inventory:
Expand Down
42 changes: 0 additions & 42 deletions molecule/ssl_auth_sasl/prepare.yml

This file was deleted.

48 changes: 0 additions & 48 deletions molecule/ssl_no_auth/generate_keys_and_certs.sh

This file was deleted.

2 changes: 1 addition & 1 deletion molecule/ssl_no_auth/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ provisioner:
ssh_connection:
pipelining: false
playbooks:
prepare: prepare.yml
prepare: ../prepare.yml
converge: converge.yml
verify: verify.yml
inventory:
Expand Down
26 changes: 26 additions & 0 deletions roles/amq_streams_common/tasks/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
- name: "Ensure required parameters for Prometheus are provided."
ansible.builtin.assert:
that:
- amq_streams_common_prometheus_config_file is defined and amq_streams_common_prometheus_config_file | length > 0
- amq_streams_common_prometheus_config_file_template is defined and amq_streams_common_prometheus_config_file_template | length > 0
quiet: True

- name: "Ensure directory {{ amq_streams_common_prometheus_metrics_config_home }} exits."
ansible.builtin.file:
path: "{{ amq_streams_common_prometheus_metrics_config_home }}"
state: directory

- name: "Deploy Prometheus metrics file (src: {{ amq_streams_common_prometheus_config_file_template }} to dest: {{ amq_streams_common_prometheus_metrics_config_home }}{{ amq_streams_common_prometheus_config_file }}"
ansible.builtin.template:
src: "{{ amq_streams_common_prometheus_config_file_template }}"
dest: "{{ amq_streams_common_prometheus_metrics_config_home }}{{ amq_streams_common_prometheus_config_file }}"
owner: "{{ amq_streams_common_prometheus_user | default(omit) }}"
group: "{{ amq_streams_common_prometheus_group | default(omit) }}"
mode: 0644

- name: "Add prometheus dependency (if enabled: {{ amq_streams_common_prometheus_enabled }})."
ansible.builtin.set_fact:
amq_streams_common_dependencies: "{{ [amq_streams_common_dependencies + ['{{ amq_streams_common_prometheus_package_name }}']] | flatten }}"
when:
- amq_streams_common_prometheus_install_rpm is defined and amq_streams_common_prometheus_install_rpm

0 comments on commit 4f981e0

Please sign in to comment.