Newer
Older
---
# file: roles/serverdensity/tasks/serverdensity.yml
- name: Import uninstallv1
import_tasks: uninstallv1.yml
when: sd_uninstallv1
api_token: '{{ sd_api_token }}'
cleanup: '{{ sd_alert_cleanup }}'
force: '{{ sd_force_update }}'
cache: '{{ sd_api_cache_file }}'
when: sd_update_remote
- name: Install Public Repo Key
apt_key:
url: '{{ sd_repo_public_key_uri }}'
state: present
- name: Add ServerDensity Repository To Apt
copy:
content: deb http://archive.serverdensity.com/ubuntu/ all main
dest: /etc/apt/sources.list.d/sd-agent.list
mode: 0644
apt:
pkg: sd-agent
state: present
update_cache: yes
notify:
- Restart Agent
- name: Create Plugins Directory
file:
dest: '{{ sd_agent_plugins_dir }}'
state: directory
mode: 0755
copy:
src: '{{ sd_plugins_files_dir }}/{{ item }}'
dest: '{{ sd_agent_plugins_dir }}/{{ item }}'
template:
src: '{{ item }}'
dest: '/etc/sd-agent/{{ item }}'
owner: root
group: root
mode: 0644
with_items:
when: sd_agent_key != ''
- name: Import apache
import_tasks: apache.yml
when: sd_groups.apache != 'none' and inventory_hostname in groups[sd_groups.apache]
- name: Import mysql
import_tasks: mysql.yml
when: sd_groups.mysql != 'none' and inventory_hostname in groups[sd_groups.mysql]