Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial migration of zabbix module namespace from ansible-base #1

Merged
merged 1 commit into from
Mar 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Zabbix Collection Changes

## 0.1.0
- Initial migration of Zabbix content from Ansible core (2.9 / devel), including content:
- **Connection Plugins**:
- **Filter Plugins**:
- **Inventory Source**:
- `zabbix`
- **Callback Plugins**:
- **Lookup Plugins**:
- **Modules**:
- `zabbix_action`
- `zabbix_group_facts`
- `zabbix_group_info`
- `zabbix_group`
- `zabbix_host_events_info`
- `zabbix_host_facts`
- `zabbix_host_info`
- `zabbix_hostmacro`
- `zabbix_host`
- `zabbix_maintenance`
- `zabbix_map`
- `zabbix_mediatype`
- `zabbix_proxy`
- `zabbix_screen`
- `zabbix_service`
- `zabbix_template_info`
- `zabbix_template`
- `zabbix_user_info`
- `zabbix_user`
- `zabbix_valuemap`
111 changes: 111 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Zabbix collection for Ansible

This repo hosts the `community.zabbix` Ansible Collection.

The collection includes a variety of Ansible content to help automate the management of resources in Zabbix.

## Included content

Click on the name of a plugin or module to view that content's documentation:

- **Connection Plugins**:
- **Filter Plugins**:
- **Inventory Source**:
- [zabbix](https://github.com/ansible-collections/community.zabbix/blob/master/scripts/inventory/zabbix.py)
- **Callback Plugins**:
- **Lookup Plugins**:
- **Modules**:
- [zabbix\_action](https://docs.ansible.com/ansible/latest/modules/zabbix_action_module.html)
- [zabbix\_group\_info](https://docs.ansible.com/ansible/latest/modules/zabbix_group_info_module.html)
- [zabbix\_group](https://docs.ansible.com/ansible/latest/modules/zabbix_group_module.html)
- zabbix\_host\_events\_info
- [zabbix\_host\_info](https://docs.ansible.com/ansible/latest/modules/zabbix_host_info_module.html)
- [zabbix\_hostmacro](https://docs.ansible.com/ansible/latest/modules/zabbix_hostmacro_module.html)
- [zabbix\_host](https://docs.ansible.com/ansible/latest/modules/zabbix_host_module.html)
- [zabbix\_maintenance](https://docs.ansible.com/ansible/latest/modules/zabbix_maintenance_module.html)
- [zabbix\_map](https://docs.ansible.com/ansible/latest/modules/zabbix_map_module.html)
- [zabbix\_mediatype](https://docs.ansible.com/ansible/latest/modules/zabbix_mediatype_module.html)
- [zabbix\_proxy](https://docs.ansible.com/ansible/latest/modules/zabbix_proxy_module.html)
- [zabbix\_screen](https://docs.ansible.com/ansible/latest/modules/zabbix_screen_module.html)
- zabbix\_service
- zabbix\_template\_info
- [zabbix\_template](https://docs.ansible.com/ansible/latest/modules/zabbix_template_module.html)
- zabbix\_user\_info
- zabbix\_user
- zabbix\_valuemap

## Supported Zabbix versions

## Installation and Usage

### Installing the Collection from Ansible Galaxy

Before using the Zabbix collection, you need to install it with the Ansible Galaxy CLI:

ansible-galaxy collection install community.zabbix

You can also include it in a `requirements.yml` file and install it via `ansible-galaxy collection install -r requirements.yml`, using the format:

```yaml
---
collections:
- name: community.zabbix
version: v0.1.0
```

### Using modules from the Zabbix Collection in your playbooks

You can either call modules by their Fully Qualified Collection Namespace (FQCN), like `community.zabbix.zabbix_host`, or you can call modules by their short name if you list the `community.zabbix` collection in the playbook's `collections`, like so:

```yaml
---
- hosts: localhost
gather_facts: false
connection: local

collections:
- community.zabbix

tasks:
- name: Ensure host is monitored by Zabbix.
zabbix_host:
server_url: https://zabbix.example.com
login_user: username
login_password: password
host_name: '{{ inventory_hostname }}'
host_groups:
- Linux servers
link_templates:
- Template Module ICMP Ping
status: enabled
state: present
interfaces:
- type: 1
main: 1
dns: '{{ inventory_hostname }}'
proxy: zbx-proxy.example.com
macros:
- macro: SITE
value: '{{ ansible_domain }}'
delegate_to: localhost
```

For documentation on how to use individual modules and other content included in this collection, please see the links in the 'Included content' section earlier in this README.

## Testing and Development

Coming soon

## Publishing New Versions

Coming soon

## License

GNU General Public License v3.0 or later

See LICENCE to see the full text.

## Contributing

Coming soon
17 changes: 17 additions & 0 deletions galaxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace: community
name: zabbix
version: 0.1.0
readme: README.md
authors:
- Dusan Matejka (@D3DeFi)
- sky-joker (@sky-joker)
description: Collection allowing to configure resources in Zabbix monitoring system
license_file: LICENSE
tags:
- monitoring
- zabbix
dependencies: {}
repository: https://github.com/ansible-collections/community.zabbix.git
documentation: https://github.com/ansible-collections/community.zabbix.git
homepage: https://github.com/ansible-collections/community.zabbix
issues: https://github.com/ansible-collections/community.zabbix/issues
50 changes: 50 additions & 0 deletions plugins/doc_fragments/zabbix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-

# Copyright: (c) 2017, Ansible, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)


class ModuleDocFragment(object):

# Standard documentation fragment
DOCUMENTATION = r'''
options:
server_url:
description:
- URL of Zabbix server, with protocol (http or https).
C(url) is an alias for C(server_url).
required: true
type: str
aliases: [ url ]
login_user:
description:
- Zabbix user name.
type: str
required: true
login_password:
description:
- Zabbix user password.
type: str
required: true
http_login_user:
description:
- Basic Auth login
type: str
http_login_password:
description:
- Basic Auth password
type: str
timeout:
description:
- The timeout of API request (seconds).
type: int
default: 10
validate_certs:
description:
- If set to False, SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.
type: bool
default: yes
notes:
- If you use I(login_password=zabbix), the word "zabbix" is replaced by "********" in all module output, because I(login_password) uses C(no_log).
See L(this FAQ,https://docs.ansible.com/ansible/latest/network/user_guide/faq.html#why-is-my-output-sometimes-replaced-with) for more information.
'''
Loading