From 4dbd1e660fe815a2cc6032c54a2c1d1dbf62cd7b Mon Sep 17 00:00:00 2001 From: Colin Wilk Date: Sat, 27 May 2023 20:00:19 +0200 Subject: Add molecule with some simple test cases Signed-off-by: Colin Wilk --- molecule/default/converge.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 molecule/default/converge.yml (limited to 'molecule/default/converge.yml') diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml new file mode 100644 index 0000000..f9bd174 --- /dev/null +++ b/molecule/default/converge.yml @@ -0,0 +1,43 @@ +--- +- name: Converge + hosts: application + pre_tasks: + - name: Create targets + ansible.builtin.file: + path: '{{ item }}' + state: touch + modification_time: preserve + access_time: preserve + mode: '0644' + become: true + delegate_to: '{{ prometheus_target_host }}' + loop: + - /opt/target1.yml + - /opt/target2.yml + - /opt/target3.yml + + vars: + prometheus_target_handler_command_enabled: true + prometheus_target_handler_command: + cmd: echo test + prometheus_target_handler_shell_enabled: true + prometheus_target_handler_shell: + cmd: echo test + prometheus_target_exporter_defaults: + node_exporter: + path: /opt/target1.yml + host: '{{ inventory_hostname }}' + blackbox_exporter: + path: /opt/target2.yml + host: '{{ inventory_hostname }}_AA' + + roles: + - role: kliwniloc.prometheus_target + prometheus_target_exporter: + - id: node_exporter + - { id: blackbox_exporter, host: test1 } + - { id: blackbox_exporter, host: test2 } + - role: kliwniloc.prometheus_target + prometheus_target_exporter: + - id: blackbox_exporter + path: /opt/target3.yml -- cgit v1.2.3