Skip to content
Snippets Groups Projects
Commit a0415ab0 authored by jurgenhaas's avatar jurgenhaas
Browse files

Cleanup and Apache support

parent 9deef7eb
No related branches found
No related tags found
No related merge requests found
......@@ -14,9 +14,7 @@ sd_groups:
mysql: 'none'
proxy: 'none'
sd_repo_public_key_uri: 'https://www.serverdensity.com/downloads/boxedice-public.key'
sd_agent_plugins_dir: '/usr/bin/sd-agent/plugins'
sd_plugins_files_dir: "{{inventory_dir}}/files/sd-plugins"
sd_plugins_files_dir: "{{ inventory_dir }}/files/sd-plugins"
sd_template_config: 'config.cfg'
...
---
# file: roles/serverdensity/handlers/main.yml
- name: 'ServerDensity | Restart Agent'
service: name=sd-agent state=restarted
- name: "ServerDensity | Restart Agent"
service:
name=sd-agent
state=restarted
- name: "ServerDensity | Restart Apache"
service:
name=apache2
state=restarted
---
# file: roles/serverdensity/tasks/apache.yml
- name: "ServerDensity | Apache | Enable some required modules"
apache_module:
name={{ item }}
state=present
with_items:
- status
notify: "ServerDensity | Restart Apache"
- name: "ServerDensity | Apache | Configuration file for ServerDensity"
template:
src=etc-apache2-sites-available-sd-agent
dest=/etc/apache2/sites-available/sd-agent{{ apache_conf_ext }}
owner=root
group=root
mode=0644
notify: "ServerDensity | Restart Apache"
- name: "ServerDensity | Apache | Enable the sd-agent site"
command: a2ensite sd-agent creates=/etc/apache2/sites-enabled/sd-agent{{ apache_conf_ext }}
notify: "ServerDensity | Restart Apache"
......@@ -49,3 +49,6 @@
mode=0644
when: sd_agent_key != ''
notify: 'ServerDensity | Restart Agent'
- include: apache.yml
when: sd_groups.apache != 'none' and inventory_hostname in groups[sd_groups.apache]
......@@ -3,17 +3,17 @@
# Plugins: http://plugins.serverdensity.com/
[Main]
sd_url: {{sd_url}}
agent_key: {{sd_agent_key}}
sd_url: {{ sd_url }}
agent_key: {{ sd_agent_key }}
plugin_directory: {{ sd_agent_plugins_dir }}
logging_level: {{sd_logging_level}}
plugin_directory: {{ sd_agent_plugins_dir }}
logging_level: {{ sd_logging_level }}
{% if sd_groups.apache != 'none' and inventory_hostname in groups[sd_groups.apache] %}
# Apache
# See https://support.serverdensity.com/hc/en-us/articles/201253343-Apache-monitoring-Linux-Mac-and-FreeBSD
apache_status_url: http://{{inventory_hostname}}/server-status/?auto
apache_status_url: http://{{ inventory_hostname }}/server-status/?auto
apache_status_user:
apache_status_pass:
{% endif %}
......@@ -28,6 +28,6 @@ mysql_pass: root
{% endif %}
{% if sd_groups.proxy != 'none' and inventory_hostname in groups[sd_groups.proxy] %}
haproxy_svname: {{inventory_hostname}}
haproxy_svname: {{ inventory_hostname }}
haproxy_url: http://127.0.0.1:7000/haproxy_stats
{% endif %}
<VirtualHost *:80>
<Location /server-status>
SetHandler server-status
Order Deny,Allow
Deny from all
Allow from 127.0.0.1{% for address in ansible_all_ipv4_addresses %} {{ address }}{% endfor %}
</Location>
ServerName {{ inventory_hostname }}
</VirtualHost>
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