summaryrefslogtreecommitdiffstats
path: root/roles/lib_zabbix/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/lib_zabbix/tasks')
-rw-r--r--roles/lib_zabbix/tasks/create_template.yml146
-rw-r--r--roles/lib_zabbix/tasks/create_user.yml11
2 files changed, 0 insertions, 157 deletions
diff --git a/roles/lib_zabbix/tasks/create_template.yml b/roles/lib_zabbix/tasks/create_template.yml
deleted file mode 100644
index 783249c3a..000000000
--- a/roles/lib_zabbix/tasks/create_template.yml
+++ /dev/null
@@ -1,146 +0,0 @@
----
-- name: Template Create Template
- zbx_template:
- zbx_server: "{{ server }}"
- zbx_user: "{{ user }}"
- zbx_password: "{{ password }}"
- name: "{{ template.name }}"
- register: created_template
-
-
-- set_fact:
- lzbx_item_applications: "{{ template.zitems | default([], True) | oo_select_keys_from_list(['applications']) | oo_flatten | unique }}"
- lzbx_itemprototype_applications: "{{ template.zitemprototypes | default([], True) | oo_select_keys_from_list(['applications']) | oo_flatten | unique }}"
-
-- name: Create Application
- zbx_application:
- zbx_server: "{{ server }}"
- zbx_user: "{{ user }}"
- zbx_password: "{{ password }}"
- name: "{{ item }}"
- template_name: "{{ template.name }}"
- with_items:
- - "{{ lzbx_item_applications }}"
- - "{{ lzbx_itemprototype_applications }}"
- register: created_application
- when: template.zitems is defined or template.zitemprototypes is defined
-
-- name: Create Items
- zbx_item:
- zbx_server: "{{ server }}"
- zbx_user: "{{ user }}"
- zbx_password: "{{ password }}"
- key: "{{ item.key }}"
- name: "{{ item.name | default(item.key, true) }}"
- value_type: "{{ item.value_type | default('int') }}"
- data_type: "{{ item.data_type | default('decimal') }}"
- description: "{{ item.description | default('', True) }}"
- multiplier: "{{ item.multiplier | default('', True) }}"
- units: "{{ item.units | default('', True) }}"
- template_name: "{{ template.name }}"
- applications: "{{ item.applications }}"
- zabbix_type: "{{ item.zabbix_type | default('trapper') }}"
- interval: "{{ item.interval | default(60, True) }}"
- delta: "{{ item.delta | default(0, True) }}"
- with_items: template.zitems
- register: created_items
- when: template.zitems is defined
-
-- name: Create Triggers
- zbx_trigger:
- zbx_server: "{{ server }}"
- zbx_user: "{{ user }}"
- zbx_password: "{{ password }}"
- name: "{{ item.name }}"
- description: "{{ item.description | default('', True) }}"
- dependencies: "{{ item.dependencies | default([], True) }}"
- expression: "{{ item.expression }}"
- priority: "{{ item.priority }}"
- url: "{{ item.url | default(None, True) }}"
- status: "{{ item.status | default('', True) }}"
- with_items: template.ztriggers
- when: template.ztriggers is defined
-
-- name: Create Actions
- zbx_action:
- zbx_server: "{{ server }}"
- zbx_user: "{{ user }}"
- zbx_password: "{{ password }}"
- state: "{{ item.state | default('present', True) }}"
- name: "{{ item.name }}"
- status: "{{ item.status | default('enabled', True) }}"
- escalation_time: "{{ item.escalation_time }}"
- conditions_filter: "{{ item.conditions_filter }}"
- operations: "{{ item.operations }}"
- with_items: template.zactions
- when: template.zactions is defined
-
-- name: Create Discoveryrules
- zbx_discoveryrule:
- zbx_server: "{{ server }}"
- zbx_user: "{{ user }}"
- zbx_password: "{{ password }}"
- name: "{{ item.name }}"
- key: "{{ item.key }}"
- lifetime: "{{ item.lifetime }}"
- template_name: "{{ template.name }}"
- description: "{{ item.description | default('', True) }}"
- with_items: template.zdiscoveryrules
- when: template.zdiscoveryrules is defined
-
-- name: Create Item Prototypes
- zbx_itemprototype:
- zbx_server: "{{ server }}"
- zbx_user: "{{ user }}"
- zbx_password: "{{ password }}"
- name: "{{ item.name }}"
- key: "{{ item.key }}"
- discoveryrule_key: "{{ item.discoveryrule_key }}"
- value_type: "{{ item.value_type }}"
- data_type: "{{ item.data_type | default('decimal') }}"
- template_name: "{{ template.name }}"
- applications: "{{ item.applications }}"
- description: "{{ item.description | default('', True) }}"
- multiplier: "{{ item.multiplier | default('', True) }}"
- units: "{{ item.units | default('', True) }}"
- interval: "{{ item.interval | default(60, True) }}"
- delta: "{{ item.delta | default(0, True) }}"
- with_items: template.zitemprototypes
- when: template.zitemprototypes is defined
-
-- name: Create Trigger Prototypes
- zbx_triggerprototype:
- zbx_server: "{{ server }}"
- zbx_user: "{{ user }}"
- zbx_password: "{{ password }}"
- name: "{{ item.name }}"
- expression: "{{ item.expression }}"
- url: "{{ item.url | default('', True) }}"
- priority: "{{ item.priority | default('average', True) }}"
- description: "{{ item.description | default('', True) }}"
- with_items: template.ztriggerprototypes
- when: template.ztriggerprototypes is defined
-
-- name: Create Graphs
- zbx_graph:
- zbx_server: "{{ server }}"
- zbx_user: "{{ user }}"
- zbx_password: "{{ password }}"
- name: "{{ item.name }}"
- height: "{{ item.height }}"
- width: "{{ item.width }}"
- graph_items: "{{ item.graph_items }}"
- with_items: template.zgraphs
- when: template.zgraphs is defined
-
-- name: Create Graph Prototypes
- zbx_graphprototype:
- zbx_server: "{{ server }}"
- zbx_user: "{{ user }}"
- zbx_password: "{{ password }}"
- name: "{{ item.name }}"
- height: "{{ item.height }}"
- width: "{{ item.width }}"
- graph_items: "{{ item.graph_items }}"
- with_items: template.zgraphprototypes
- when: template.zgraphprototypes is defined
diff --git a/roles/lib_zabbix/tasks/create_user.yml b/roles/lib_zabbix/tasks/create_user.yml
deleted file mode 100644
index 1f752a9e1..000000000
--- a/roles/lib_zabbix/tasks/create_user.yml
+++ /dev/null
@@ -1,11 +0,0 @@
----
-- name: Update zabbix credentialss for a user
- zbx_user:
- server: "{{ ozb_server }}"
- user: "{{ ozb_user }}"
- password: "{{ ozb_password }}"
- alias: "{{ ozb_username }}"
- passwd: "{{ ozb_new_password | default(ozb_password, true) }}"
- register: user
-
-- debug: var=user.results