0
munin
플러그인을 매우 비슷하게 설치하십시오 : 일부 심볼릭 링크 + 템플릿 구성 파일을 만드십시오. 예를 들어가능성있는 유사한 역할 리팩토링
:
역할 munin_plugin_nginx
:
---
- name: create symlink for plugin
file:
src="/usr/share/munin/plugins/{{ item }}"
dest="/etc/munin/plugins/{{ item }}"
state=link
with_items:
- "nginx_request"
- "nginx_status"
- name: template /etc/munin/plugin-conf.d/nginx
template:
src: etc/munin/plugin-conf.d/nginx.j2
dest: /etc/munin/plugin-conf.d/nginx
owner: root
group: root
mode: 0644
notify: restart munin-node
역할 munin_plugin_httpd
:
---
- name: create symlink for plugin
file:
src="/usr/share/munin/plugins/{{ item }}"
dest="/etc/munin/plugins/{{ item }}"
state=link
with_items:
- "apache_accesses"
- "apache_processes"
- "apache_volume"
- name: template /etc/munin/plugin-conf.d/httpd
template:
src: etc/munin/plugin-conf.d/httpd.j2
dest: /etc/munin/plugin-conf.d/httpd
owner: root
group: root
mode: 0644
notify: restart munin-node
다른 munin_plugins도 유사한 단계가 있습니다.
어떻게 '복사 붙여 넣기'코드를 피하기 위해이 역할을 리팩터링 할 수 있습니까? 가능한 방법의