Initial commit
This commit is contained in:
commit
d2f029f8f0
3 changed files with 42 additions and 0 deletions
2
defaults/main.yml
Normal file
2
defaults/main.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
unpoller:
|
||||
config: {}
|
||||
4
handlers/main.yml
Normal file
4
handlers/main.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
- name: restart unpoller
|
||||
service:
|
||||
name: loki
|
||||
state: restarted
|
||||
36
tasks/main.yml
Normal file
36
tasks/main.yml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
- name: Download unpoller repo key
|
||||
ansible.builtin.get_url:
|
||||
url: https://packagecloud.io/golift/pkgs/gpgkey
|
||||
checksum: sha256:7c4beacdf843dff04cd4317cfd9fc93edb725fec741d68146dc54a4300afafee
|
||||
dest: /etc/apt/keyrings/golift_pkgs-archive-keyring.asc
|
||||
|
||||
- name: Setup unpoller repo
|
||||
ansible.builtin.apt_repository:
|
||||
repo: deb [signed-by=/etc/apt/keyrings/golift_pkgs-archive-keyring.asc] https://packagecloud.io/golift/pkgs/ubuntu focal main
|
||||
|
||||
- name: Install unpoller
|
||||
ansible.builtin.apt:
|
||||
pkg: unpoller
|
||||
|
||||
- name: Write unpoller daemon config
|
||||
notify: restart unpoller
|
||||
ansible.builtin.copy:
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
dest: /etc/default/unpoller
|
||||
content: 'DAEMON_OPTS="-c /etc/unpoller/up.yaml"'
|
||||
|
||||
- name: Write unpoller config
|
||||
notify: restart unpoller
|
||||
ansible.builtin.copy:
|
||||
owner: unpoller
|
||||
group: unpoller
|
||||
mode: 0640
|
||||
dest: /etc/unpoller/up.yaml
|
||||
content: "{{ unpoller.config|to_nice_yaml(indent=2) }}"
|
||||
|
||||
- name: Delete default unpoller config
|
||||
ansible.builtin.file:
|
||||
path: /etc/unpoller/up.conf
|
||||
state: absent
|
||||
Loading…
Add table
Add a link
Reference in a new issue