v-zhuravlev / zbx-smartctl

Templates and scripts for monitoring disks health with Zabbix and smartmontools
https://share.zabbix.com/storage-devices/smartmontools/smart-monitoring-with-smartmontools-lld
GNU General Public License v3.0
245 stars 127 forks source link

Add ansible install script for agents (debian) #69

Closed alisinabh closed 5 years ago

alisinabh commented 6 years ago

I just created this Ansible playbook and used it to install zbx-smartctl on my servers.

Workflow:

nerijus commented 5 years ago

Got an error:

ERROR! Syntax Error while loading YAML.
  did not find expected key

The error appears to have been in 'roles/smart-monitoring/tasks/main.yaml': line 5, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: "Create scripts directory"
    file: path=/etc/zabbix/scripts state=directory
    ^ here

Changing to this worked:

- name: Create scripts directory
  file:
    path: /etc/zabbix/scripts
    state: directory
alisinabh commented 5 years ago

@nerijus Thank you.

I've added the fix

v-zhuravlev commented 5 years ago

Hi, @alisinabh , This playbook doesn't look debian specific, Can it be used for RHEL/Centos?

alisinabh commented 5 years ago

Hi, @v-zhuravlev , The only debian(ish) part is the Install smartmontools section which i added with apt. But it can be modified to work with RHEL too using yum i guess.

Actually it looks like in ansible >= 2.0 it is possible to install packages without specifying the package manager.

alisinabh commented 5 years ago

I've updated the Install smartmontools section and used generic package manager module of ansible.

Although i haven't tested it (I don't have a running RHEL) but it should work.

v-zhuravlev commented 5 years ago

Thanks! How about moving it to ansible/ dir out of debian/ if it so no longer debian specific?

alisinabh commented 5 years ago

Done :)