diff options
author | Lars Wirzenius <liw@liw.fi> | 2018-06-02 18:20:37 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2018-06-02 18:20:37 +0300 |
commit | ee43d795de8fff8ea4657226b97f22c188880d27 (patch) | |
tree | e0946e82bd0ffcb6b238da61f9064975bd2e20b5 | |
parent | 471e77d02f2aad857800832989ac07127b9f004e (diff) | |
download | ick2-ansible-ee43d795de8fff8ea4657226b97f22c188880d27.tar.gz |
Add: ick-notifier role
-rw-r--r-- | roles/ick-notifier/tasks/main.yml | 32 | ||||
-rw-r--r-- | roles/ick-notifier/templates/notifications.yaml.j2 | 11 |
2 files changed, 43 insertions, 0 deletions
diff --git a/roles/ick-notifier/tasks/main.yml b/roles/ick-notifier/tasks/main.yml new file mode 100644 index 0000000..c0479b8 --- /dev/null +++ b/roles/ick-notifier/tasks/main.yml @@ -0,0 +1,32 @@ +- name: install notification packages + apt: + name: "{{ item }}" + with_items: + - "{{ ick_prefix }}ick2" + +- name: create config dirs + file: + state: directory + path: "{{ item }}" + owner: root + group: root + mode: 0755 + with_items: + - /etc/ick + +- name: install notification config + template: + src: notifications.yaml.j2 + dest: /etc/ick/notifications.yaml + owner: root + group: root + mode: 0644 + +- name: enable and start units + systemd: + daemon_reload: yes + name: "{{ item }}" + state: restarted + enabled: yes + with_items: + - notification_service diff --git a/roles/ick-notifier/templates/notifications.yaml.j2 b/roles/ick-notifier/templates/notifications.yaml.j2 new file mode 100644 index 0000000..6c0bd9c --- /dev/null +++ b/roles/ick-notifier/templates/notifications.yaml.j2 @@ -0,0 +1,11 @@ +token-issuer: "{{ qvisqve_url }}" +token-audience: localhost +token-public-key: "{{ token_public_key }}" +log: + - filename: /var/log/ickns/notification_service.log +from_addr: Lars Wirzenius <liw@liw.fi> +smtp_server: pieni.net +smtp_port: 587 +smtp_user: pienirelay +smtp_password: {{ smtp_password }} + |