mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Updated documentation for zabbix-screen module (#57325)
Updated module settings. Do not check screens options because of module screens.
This commit is contained in:
parent
07d446825a
commit
fba67bbe53
2 changed files with 66 additions and 20 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
minor_changes:
|
||||||
|
- "zabbix_screen - updated documentation and module arguments"
|
|
@ -31,15 +31,56 @@ options:
|
||||||
screens:
|
screens:
|
||||||
description:
|
description:
|
||||||
- List of screens to be created/updated/deleted (see example).
|
- List of screens to be created/updated/deleted (see example).
|
||||||
- If a screen has already been added, the screen name won't be updated.
|
type: list
|
||||||
- When creating or updating a screen, C(screen_name) and C(host_group) are required.
|
|
||||||
- When deleting a screen, the C(screen_name) is required.
|
|
||||||
- Option C(graphs_in_row) will limit columns of a screen and make multiple rows (default 3).
|
|
||||||
- >
|
|
||||||
The available states are: C(present) (default) and C(absent). If the screen already exists, and the state is not C(absent), the screen
|
|
||||||
will be updated as needed.
|
|
||||||
- To sort hosts alphabetically, set the C(sort) option to C(true)
|
|
||||||
required: true
|
required: true
|
||||||
|
suboptions:
|
||||||
|
screen_name:
|
||||||
|
description:
|
||||||
|
- Screen name will be used.
|
||||||
|
- If a screen has already been added, the screen name won't be updated.
|
||||||
|
type: str
|
||||||
|
required: yes
|
||||||
|
host_group:
|
||||||
|
description:
|
||||||
|
- Host group will be used for searching hosts.
|
||||||
|
- Required if I(state=present).
|
||||||
|
type: str
|
||||||
|
required: yes
|
||||||
|
state:
|
||||||
|
description:
|
||||||
|
- I(present) - Create a screen if it doesn't exist. If the screen already exists, the screen will be updated as needed.
|
||||||
|
- I(absent) - If a screen exists, the screen will be deleted.
|
||||||
|
type: str
|
||||||
|
default: present
|
||||||
|
choices:
|
||||||
|
- absent
|
||||||
|
- present
|
||||||
|
graph_names:
|
||||||
|
description:
|
||||||
|
- Graph names will be added to a screen. Case insensitive.
|
||||||
|
- Required if I(state=present).
|
||||||
|
type: list
|
||||||
|
graph_width:
|
||||||
|
description:
|
||||||
|
- Graph width will be set in graph settings.
|
||||||
|
type: int
|
||||||
|
default: None
|
||||||
|
graph_height:
|
||||||
|
description:
|
||||||
|
- Graph height will be set in graph settings.
|
||||||
|
type: int
|
||||||
|
default: None
|
||||||
|
graphs_in_row:
|
||||||
|
description:
|
||||||
|
- Limit columns of a screen and make multiple rows.
|
||||||
|
type: int
|
||||||
|
default: 3
|
||||||
|
sort:
|
||||||
|
description:
|
||||||
|
- Sort hosts alphabetically.
|
||||||
|
- If there are numbers in hostnames, leading zero should be used.
|
||||||
|
type: bool
|
||||||
|
default: no
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- zabbix
|
- zabbix
|
||||||
|
@ -316,7 +357,16 @@ def main():
|
||||||
http_login_password=dict(type='str', required=False, default=None, no_log=True),
|
http_login_password=dict(type='str', required=False, default=None, no_log=True),
|
||||||
validate_certs=dict(type='bool', required=False, default=True),
|
validate_certs=dict(type='bool', required=False, default=True),
|
||||||
timeout=dict(type='int', default=10),
|
timeout=dict(type='int', default=10),
|
||||||
screens=dict(type='list', required=True)
|
screens=dict(type='list', elements='dict', required=True, options=dict(
|
||||||
|
screen_name=dict(type='str', required=True),
|
||||||
|
host_group=dict(type='str'),
|
||||||
|
state=dict(type='str', default='present', choices=['absent', 'present']),
|
||||||
|
graph_names=dict(type='list', elements='str'),
|
||||||
|
graph_width=dict(type='int', default=None),
|
||||||
|
graph_height=dict(type='int', default=None),
|
||||||
|
graphs_in_row=dict(type='int', default=3),
|
||||||
|
sort=dict(default=False, type='bool'),
|
||||||
|
))
|
||||||
),
|
),
|
||||||
supports_check_mode=True
|
supports_check_mode=True
|
||||||
)
|
)
|
||||||
|
@ -350,8 +400,8 @@ def main():
|
||||||
for zabbix_screen in screens:
|
for zabbix_screen in screens:
|
||||||
screen_name = zabbix_screen['screen_name']
|
screen_name = zabbix_screen['screen_name']
|
||||||
screen_id = screen.get_screen_id(screen_name)
|
screen_id = screen.get_screen_id(screen_name)
|
||||||
state = "absent" if "state" in zabbix_screen and zabbix_screen['state'] == "absent" else "present"
|
state = zabbix_screen['state']
|
||||||
sort = bool(zabbix_screen.get("sort", False))
|
sort = zabbix_screen['sort']
|
||||||
|
|
||||||
if state == "absent":
|
if state == "absent":
|
||||||
if screen_id:
|
if screen_id:
|
||||||
|
@ -367,14 +417,8 @@ def main():
|
||||||
else:
|
else:
|
||||||
host_group = zabbix_screen['host_group']
|
host_group = zabbix_screen['host_group']
|
||||||
graph_names = zabbix_screen['graph_names']
|
graph_names = zabbix_screen['graph_names']
|
||||||
graphs_in_row = 3
|
|
||||||
if 'graphs_in_row' in zabbix_screen:
|
|
||||||
graphs_in_row = zabbix_screen['graphs_in_row']
|
graphs_in_row = zabbix_screen['graphs_in_row']
|
||||||
graph_width = None
|
|
||||||
if 'graph_width' in zabbix_screen:
|
|
||||||
graph_width = zabbix_screen['graph_width']
|
graph_width = zabbix_screen['graph_width']
|
||||||
graph_height = None
|
|
||||||
if 'graph_height' in zabbix_screen:
|
|
||||||
graph_height = zabbix_screen['graph_height']
|
graph_height = zabbix_screen['graph_height']
|
||||||
host_group_id = screen.get_host_group_id(host_group)
|
host_group_id = screen.get_host_group_id(host_group)
|
||||||
hosts = screen.get_host_ids_by_group_id(host_group_id, sort)
|
hosts = screen.get_host_ids_by_group_id(host_group_id, sort)
|
||||||
|
|
Loading…
Reference in a new issue