Commit 75a1df37 authored by Lars Beckers's avatar Lars Beckers
Browse files

zabbix-repo/zabbix-server: fix yamllint issues, fix shell module usage

parent 8a55e625
......@@ -18,6 +18,7 @@
repo: "{{ item }}"
state: absent
with_items:
# yamllint disable-line rule:line-length
- 'deb http://repo.zabbix.com/zabbix/{{old_zabbix_version}}/debian {{ debian_version }} main'
# yamllint disable-line rule:line-length
- 'deb-src http://repo.zabbix.com/zabbix/{{old_zabbix_version}}/debian {{ debian_version }} main'
......@@ -30,8 +31,10 @@
- name: ensure apt knows about the current zabbix repo
apt_repository:
repo: "{{ item }}"
# yamllint disable-line rule:line-length
state: '{{"present" if debian_version == "jessie" or debian_version == "stretch" else "absent"}}'
with_items:
# yamllint disable-line rule:line-length
- 'deb http://repo.zabbix.com/zabbix/{{zabbix_version}}/debian {{ debian_version }} main'
# yamllint disable-line rule:line-length
- 'deb-src http://repo.zabbix.com/zabbix/{{zabbix_version}}/debian {{debian_version }} main'
......@@ -66,6 +69,7 @@
- chr
- name: query installed packages
# yamllint disable-line rule:empty-values
package_facts:
register: installed_packages
tags:
......
......@@ -6,3 +6,6 @@
- name: restart postgres
service: name=postgresql state=restarted
delegate_to: "{{ zabbix_db_host }}"
- name: download mibs
command: download-mibs
......@@ -127,10 +127,14 @@
- meta: flush_handlers
- name: apply database schema
# yamllint disable-line rule:line-length
shell: zcat /usr/share/doc/zabbix-server-pgsql/create.sql.gz | psql -h {{ zabbix_db_host }} -U {{ zabbix_db_user }} -w -d {{ zabbix_db_name }} && touch /var/lib/zabbix/.db_schema_created
# yamllint disable rule:line-length
shell: |
set -o pipefail
zcat /usr/share/doc/zabbix-server-pgsql/create.sql.gz | psql -h {{ zabbix_db_host }} -U {{ zabbix_db_user }} -w -d {{ zabbix_db_name }} && touch /var/lib/zabbix/.db_schema_created
args:
creates: /var/lib/zabbix/.db_schema_created
executable: /bin/bash
# yamllint enable rule:line-length
become: true
become_user: zabbix
notify:
......
......@@ -6,6 +6,8 @@
- snmp
- snmp-mibs-downloader
state: present
notify:
- download mibs
tags:
- snmp
......@@ -13,10 +15,7 @@
copy:
src: snmp.conf
dest: /etc/snmp/snmp.conf
tags:
- snmp
- name: ensure the snmp MIB libs are present
command: download-mibs
notify:
- download mibs
tags:
- snmp
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment