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

Merge branch 'add/initial-release' into 'master'

Initial release

See merge request !1
parents 9b4362a0 184b12ad
No related branches found
No related tags found
1 merge request!1Initial release
Pipeline #201 passed with stage
in 2 minutes and 56 seconds
...@@ -16,7 +16,7 @@ TBD ...@@ -16,7 +16,7 @@ TBD
Dependencies Dependencies
------------ ------------
None [eth-log-alerting](https://git.ethitter.com/debian/eth-log-alerting)
Example Playbook Example Playbook
---------------- ----------------
......
--- ---
# defaults file for eth-log-alerting eth_log_alerting_binary_url: "https://git.ethitter.com/debian/eth-log-alerting/uploads/73fb61dcec9e953d24f1180d03959e4c/eth-log-alerting_linux_amd64"
\ No newline at end of file eth_log_alerting_binary_dest: /usr/local/bin/eth-log-alerting
eth_log_alerting_init_url: "https://git.ethitter.com/debian/eth-log-alerting/raw/v0.0.1/init.sh"
eth_log_alerting_init_dest: /etc/init.d/eth-log-alerting
eth_log_alerting_init_defaults: /etc/default/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: ""
--- ---
# handlers file for eth-log-alerting - name: restart daemon
\ No newline at end of file service:
name: eth-log-alerting
state: restarted
---
- 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
notify: restart daemon
---
- 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"
--- ---
# tasks file for eth-log-alerting - include: install.yml
\ No newline at end of file - include: service.yml
- include: logrotate.yml
---
- name: Install service
get_url:
url: "{{ eth_log_alerting_init_url }}"
dest: "{{ eth_log_alerting_init_dest }}"
mode: 0755
owner: root
group: root
force: yes
- name: Configure service
lineinfile:
dest: "{{ eth_log_alerting_init_defaults }}"
line: "{{ item }}"
mode: 0644
owner: root
group: root
state: present
create: yes
with_items:
- 'DAEMON="{{ eth_log_alerting_binary_dest }}"'
- 'DAEMON_ARGS="-config {{ eth_log_alerting_config_dest }}"'
- 'USER="root"'
notify: restart daemon
- name: Ensure service is enabled and started
service:
name: eth-log-alerting
enabled: yes
state: started
{
"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