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

Tests and bug fixes

parent 697497a4
No related branches found
No related tags found
No related merge requests found
......@@ -17,5 +17,5 @@ sd_groups:
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: "{{ playbook_dir }}/files/sd-plugins"
sd_template_config: 'config.cfg'
---
# file: roles/serverdensity/tasks/main.yml
- name: 'ServerDensity | Init SD plugin'
- name: "ServerDensity | Init SD plugin"
local_action:
serverdensity
api_token={{sd_api_token}}
cleanup={{sd_alert_cleanup}}
api_token={{ sd_api_token }}
cleanup={{ sd_alert_cleanup }}
force={{ sd_force_update }}
cache={{sd_api_cache_file}}
cache={{ sd_api_cache_file }}
when: sd_update_remote
- name: 'ServerDensity | Install Public Repo Key'
- name: "ServerDensity | Install Public Repo Key"
apt_key:
url="{{ sd_repo_public_key_uri }}"
url={{ sd_repo_public_key_uri }}
state=present
- name: 'ServerDensity | Add ServerDensity Repository To Apt'
- name: "ServerDensity | Add ServerDensity Repository To Apt"
copy:
content='deb http://www.serverdensity.com/downloads/linux/deb all main'
dest='/etc/apt/sources.list.d/sd-agent.list'
dest=/etc/apt/sources.list.d/sd-agent.list
mode=644
- name: 'ServerDensity | Install The Agent'
- name: "ServerDensity | Install The Agent"
apt:
pkg=sd-agent
state=installed
update_cache=yes
notify: 'ServerDensity | Restart Agent'
notify: "ServerDensity | Restart Agent"
- name: 'ServerDensity | Create Plugins Directory'
- name: "ServerDensity | Create Plugins Directory"
file:
dest="{{ sd_agent_plugins_dir }}"
dest={{ sd_agent_plugins_dir }}
state=directory
mode=755
- name: 'ServerDensity | Copy Plugins'
- name: "ServerDensity | Copy Plugins"
copy:
src="{{ sd_plugins_files_dir }}/{{item.1}}"
dest="{{ sd_agent_plugins_dir }}/{{item.1}}"
src={{ sd_plugins_files_dir }}/{{ item.1 }}
dest={{ sd_agent_plugins_dir }}/{{ item.1 }}
with_items: sd_plugins|dictsort
when: sd_plugins|length > 0
notify: 'ServerDensity | Restart Agent'
- name: 'ServerDensity | Configure The Agent'
template: src="{{ sd_template_config }}"
dest=/etc/sd-agent/config.cfg
owner=root
group=root
mode=0644
notify: "ServerDensity | Restart Agent"
- name: "ServerDensity | Configure The Agent"
template:
src={{ sd_template_config }}
dest=/etc/sd-agent/config.cfg
owner=root
group=root
mode=0644
when: sd_agent_key != ''
notify: 'ServerDensity | Restart Agent'
notify: "ServerDensity | Restart Agent"
- include: apache.yml
when: sd_groups.apache != 'none' and inventory_hostname in groups[sd_groups.apache]
......@@ -4,6 +4,7 @@
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