zabbix: remove set_facts, add vars to each api call
Signed-off-by: David Kirwan <davidkirwanirl@gmail.com>
This commit is contained in:
parent
725498464f
commit
efa7047d3b
7 changed files with 37 additions and 16 deletions
|
@ -29,7 +29,7 @@
|
|||
- rkhunter
|
||||
- nagios_client
|
||||
- zabbix/zabbix_agent
|
||||
# - zabbix/zabbix_templates
|
||||
- zabbix/zabbix_templates
|
||||
- collectd/base
|
||||
- sudo
|
||||
- role: keytab/service
|
||||
|
|
|
@ -91,7 +91,6 @@
|
|||
name: "rawhide"
|
||||
gid: 265
|
||||
state: present
|
||||
local: true
|
||||
|
||||
# rawhide user 265
|
||||
- name: add rawhide user
|
||||
|
@ -103,7 +102,6 @@
|
|||
create_home: false
|
||||
comment: "rawhide compose account"
|
||||
state: present
|
||||
local: true
|
||||
|
||||
- name: make a bunch of dirs
|
||||
file: state=directory path={{ item }}
|
||||
|
|
|
@ -8,3 +8,12 @@
|
|||
with_items: "{{ zabbix_templates }}"
|
||||
tags:
|
||||
- zabbix_add_hosts_to_hostgroups
|
||||
vars:
|
||||
ansible_zabbix_auth_key: "{{ (env == 'staging')|ternary(zabbix_stg_apikey, zabbix_apikey) }}"
|
||||
ansible_network_os: community.zabbix.zabbix
|
||||
ansible_connection: httpapi
|
||||
ansible_httpapi_port: 443
|
||||
ansible_httpapi_use_ssl: true
|
||||
ansible_httpapi_validate_certs: false
|
||||
ansible_host: "{{ (env == 'staging')|ternary(zabbix_stg_hostname, zabbix_hostname) }}"
|
||||
ansible_zabbix_url_path: "" # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
|
||||
|
|
|
@ -8,3 +8,12 @@
|
|||
with_items: "{{ zabbix_templates }}"
|
||||
tags:
|
||||
- zabbix_add_templates_to_hosts
|
||||
vars:
|
||||
ansible_zabbix_auth_key: "{{ (env == 'staging')|ternary(zabbix_stg_apikey, zabbix_apikey) }}"
|
||||
ansible_network_os: community.zabbix.zabbix
|
||||
ansible_connection: httpapi
|
||||
ansible_httpapi_port: 443
|
||||
ansible_httpapi_use_ssl: true
|
||||
ansible_httpapi_validate_certs: false
|
||||
ansible_host: "{{ (env == 'staging')|ternary(zabbix_stg_hostname, zabbix_hostname) }}"
|
||||
ansible_zabbix_url_path: "" # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
|
||||
|
|
|
@ -8,3 +8,12 @@
|
|||
run_once: True
|
||||
tags:
|
||||
- zabbix_hostgroups
|
||||
vars:
|
||||
ansible_zabbix_auth_key: "{{ (env == 'staging')|ternary(zabbix_stg_apikey, zabbix_apikey) }}"
|
||||
ansible_network_os: community.zabbix.zabbix
|
||||
ansible_connection: httpapi
|
||||
ansible_httpapi_port: 443
|
||||
ansible_httpapi_use_ssl: true
|
||||
ansible_httpapi_validate_certs: false
|
||||
ansible_host: "{{ (env == 'staging')|ternary(zabbix_stg_hostname, zabbix_hostname) }}"
|
||||
ansible_zabbix_url_path: "" # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
|
||||
|
|
|
@ -1,17 +1,4 @@
|
|||
---
|
||||
- name: Set API token
|
||||
tags: always
|
||||
set_fact:
|
||||
ansible_zabbix_auth_key: "{{ (env == 'staging')|ternary(zabbix_stg_apikey, zabbix_apikey) }}"
|
||||
ansible_network_os: community.zabbix.zabbix
|
||||
ansible_connection: httpapi
|
||||
ansible_httpapi_port: 443
|
||||
ansible_httpapi_use_ssl: true
|
||||
ansible_httpapi_validate_certs: false
|
||||
ansible_host: "{{ (env == 'staging')|ternary(zabbix_stg_hostname, zabbix_hostname) }}"
|
||||
ansible_zabbix_url_path: "" # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
|
||||
|
||||
|
||||
- include_tasks: hostgroups.yml
|
||||
tags:
|
||||
- zabbix_hostgroups
|
||||
|
|
|
@ -19,3 +19,12 @@
|
|||
with_items: "{{ zabbix_templates }}" # Templates specific to an ansible group, can be overwridden in inventory/group_vars/group_name
|
||||
tags:
|
||||
- zabbix_templates
|
||||
vars:
|
||||
ansible_zabbix_auth_key: "{{ (env == 'staging')|ternary(zabbix_stg_apikey, zabbix_apikey) }}"
|
||||
ansible_network_os: community.zabbix.zabbix
|
||||
ansible_connection: httpapi
|
||||
ansible_httpapi_port: 443
|
||||
ansible_httpapi_use_ssl: true
|
||||
ansible_httpapi_validate_certs: false
|
||||
ansible_host: "{{ (env == 'staging')|ternary(zabbix_stg_hostname, zabbix_hostname) }}"
|
||||
ansible_zabbix_url_path: "" # If Zabbix WebUI runs on non-default (zabbix) path ,e.g. http://<FQDN>/zabbixeu
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue