Skip to content
Snippets Groups Projects
Commit 88689bf7 authored by Erick Hitter's avatar Erick Hitter
Browse files

Basic, working role

parent ec9954b9
No related branches found
No related tags found
1 merge request!1Initial release
Pipeline #193 passed with stage
in 3 minutes and 32 seconds
---
# defaults file for eth-log-alerting
\ No newline at end of file
eth_log_alerting_binary_url: "https://git.ethitter.com/debian/eth-log-alerting/uploads/73fb61dcec9e953d24f1180d03959e4c/eth-log-alerting_linux_amd64"
eth_log_alerting_binary_dest: /usr/local/bin/eth-log-alerting
eth_log_alerting_config_dest: /etc/eth-log-alerting.json
eth_log_alerting_debug_dest: "os.Stdout"
eth_log_alerting_debug: false
eth_log_alerting_logs:
- log_path: ""
webhook_url: ""
username: ""
channel: ""
color: ""
icon_url: ""
search: ""
---
# tasks file for eth-log-alerting
\ No newline at end of file
- name: Download and install binary
get_url:
url: "{{ eth_log_alerting_binary_url }}"
dest: "{{ eth_log_alerting_binary_dest }}"
mode: 0755
force: yes
- name: Set configuration
template:
src: templates/config.j2
dest: "{{ eth_log_alerting_config_dest }}"
force: yes
owner: root
group: root
mode: 0400
- name: Configure logrotate
template:
src: templates/logrotate.j2
dest: /etc/logrotate.d/eth-log-alerting
force: yes
owner: root
group: root
mode: 0644
when: eth_log_alerting_debug_dest != "os.Stdout"
- name: Remove logrotate configuration
file:
dest: /etc/logrotate.d/eth-log-alerting
state: absent
when: eth_log_alerting_debug_dest == "os.Stdout"
{
"debug-dest": "{{ eth_log_alerting_debug_dest }}",
"debug": {{ eth_log_alerting_debug|lower }},
"logs": [
{% for item in eth_log_alerting_logs %}{% if 0 != loop.index0 %},{% endif %}
{
"log_path": "{{ item.log_path }}",
"webhook_url": "{{ item.webhook_url }}",
"username": "{{ item.username }}",
"channel": "{{ item.channel }}",
"color": "{{ item.color }}",
"icon_url": "{{ item.icon_url }}",
"search": "{{ item.search }}"
}
{% endfor %}
]
}
{{ eth_log_alerting_debug_dest }} {
daily
rotate 14
notifempty
missingok
compress
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment