]> git.somenet.org - root/pub/somesible.git/blob - roles/service/munin-server/tasks/main.yml
roles/service/nextcloud/defaults
[root/pub/somesible.git] / roles / service / munin-server / tasks / main.yml
1 #####################################
2 ### someone"s ansible provisioner ###
3 #####################################
4 # Part of: https://git.somenet.org/root/pub/somesible.git
5 # 2017-2024 by someone <someone@somenet.org>
6 #
7 # Install munin-node and munin-async.
8 #
9 ---
10 - name: install munin
11   apt:
12     pkg:
13     - munin
14     state: present
15     policy_rc_d: 101
16   tags: "online"
17
18
19 - name: copy munin.conf to /etc/munin/munin.conf
20   copy:
21     src: "{{item}}"
22     dest: "/etc/munin/munin.conf"
23     mode: 0644
24     owner: "root"
25     group: "root"
26   with_first_found:
27     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/munin.conf"
28     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/munin.conf"
29     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/munin.conf"
30     - "default/munin.conf"
31
32
33 - name: create .ssh-dir
34   file:
35     path: "/var/lib/munin/.ssh"
36     state: directory
37     mode: 0700
38     owner: "munin"
39     group: "munin"
40
41
42 - name: copy id_ed25519 to /var/lib/munin/.ssh/id_ed25519
43   copy:
44     src: "{{item}}"
45     dest: "/var/lib/munin/.ssh/id_ed25519"
46     mode: 0600
47     owner: "munin"
48     group: "munin"
49   with_first_found:
50     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/id_ed25519"
51     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/id_ed25519"
52     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/id_ed25519"
53     - "default/id_ed25519"
54
55
56 - name: include vars_nginx_vhost_custom
57   include_vars:
58     file: "{{item}}"
59     name: vars_nginx_vhost_custom
60   with_first_found:
61     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/{{munin_domain}}-vars_nginx_vhost_custom.yml"
62     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/{{munin_domain}}-vars_nginx_vhost_custom.yml"
63     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/{{munin_domain}}-vars_nginx_vhost_custom.yml"
64     - "{{lookup('env','PWD')}}/host_files/{{inventory_hostname}}/{{role_name}}/vars_nginx_vhost_custom.yml"
65     - "{{lookup('env','PWD')}}/group_files/{{group_files_group}}/{{role_name}}/vars_nginx_vhost_custom.yml"
66     - "{{lookup('env','PWD')}}/group_files/all/{{role_name}}/vars_nginx_vhost_custom.yml"
67     - "default/vars_nginx_vhost_custom.yml"
68
69
70 - name: configure munin vhost
71   include_role:
72     name: server/nginx/vhost-unified
73   vars:
74     vhost_type: "custom"
75     vhost_name: "{{munin_domain}}"
76     vhost_custom:
77       vhost_custom_pre_server: "{{vars_nginx_vhost_custom.vhost_custom_pre_server}}"
78       vhost_custom: "{{vars_nginx_vhost_custom.vhost_custom}}"