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

Tests and bug fixes

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