Skip to content

Commit

Permalink
feat: Allow user to configure custom.system.properties
Browse files Browse the repository at this point in the history
Added a template to allow arbitrary key-value pairs in custom.system.properties for the Minion deployment.

Resolve: #42
  • Loading branch information
indigo423 committed Nov 7, 2023
1 parent eba6b2a commit d0ea1d0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
1 change: 0 additions & 1 deletion inventory/simple-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ all:
hosts:
myopennms:
ansible_host: 192.168.10.38

15 changes: 15 additions & 0 deletions roles/opennms_minion/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@
- minion
- package

- name: Configure Minion system properties
ansible.builtin.template:
src: custom.system.properties.j2
dest: "{{ opennms_minion_home }}/etc/custom.system.properties"
owner: minion
group: minion
mode: "0640"
with_dict: "{{ opennms_minion_customer_system_properties }}"
notify:
- Restart minion
tags:
- opennms
- minion
- configuration

# TODO: We need to run the specific role depending on the message broker
- name: Configure Kafka as message broker
ansible.builtin.include_tasks: 21-kafka.yml
Expand Down
7 changes: 7 additions & 0 deletions roles/opennms_minion/templates/custom.system.properties.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#########
# DO NOT EDIT THIS FILE
# {{ ansible_managed }}
######
{% for (key, value) in opennms_minion_customer_system_properties.items() %}
{{ key }} = {{ value }}
{% endfor %}

0 comments on commit d0ea1d0

Please sign in to comment.