Ansible/roles/sensu.sensu/tasks/FreeBSD/main.yml
James Tombleson b7facd7394 Role Adjustments
Added Sensu
Moved default role downloads to ./roles
Added unattended-upgrades
2019-04-29 07:08:11 -07:00

54 lines
1.1 KiB
YAML

---
# tasks/FreeBSD/main.yml: FreeBSD specific set-up
# This takes care of base prerequisites for FreeBSD
- name: Include ansible_distribution vars
include_vars:
file: "{{ ansible_distribution }}.yml"
tags: setup
- name: Ensure the Sensu group is present
tags: setup
group:
name: "{{ sensu_group_name }}"
state: present
- name: Ensure the Sensu user is present
tags: setup
user:
name: "{{ sensu_user_name }}"
group: "{{ sensu_group_name }}"
shell: /bin/false
home: "{{ sensu_config_path }}"
createhome: true
state: present
- name: Ensure pkgng custom repo config directory exists
tags: setup
file:
path: /usr/local/etc/pkg/repos/
state: directory
- name: Ensure Sensu repo is configured
tags: setup
template:
src: sensu-freebsd-repo.conf.j2
dest: /usr/local/etc/pkg/repos/sensu.conf
notify:
- Update pkgng database
- name: Ensure prerequisite packages are installed
tags: setup
pkgng:
name: "{{ item }}"
state: present
loop:
- bash
- ca_root_nss
- name: Ensure Sensu is installed
tags: setup
pkgng:
name: "{{ sensu_package }}"
state: "{{ sensu_pkg_state }}"