fragmentedpacket / fragmentedpacket.netbox_modules / 0.1.4 / module / netbox_cluster Create, update or delete clusters within Netbox | "added in version" 0.1.0 of fragmentedpacket.netbox_modules" Authors: Gaelle MANGIN (@gmangin) preview | supported by communityfragmentedpacket.netbox_modules.netbox_cluster (0.1.4) — module
Install with ansible-galaxy collection install fragmentedpacket.netbox_modules:==0.1.4
collections: - name: fragmentedpacket.netbox_modules version: 0.1.4
Creates, updates or removes clusters from Netbox
- name: "Test Netbox modules" connection: local hosts: localhost gather_facts: False tasks: - name: Create cluster within Netbox with only required information netbox_cluster: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: name: Test Cluster cluster_type: libvirt state: present - name: Delete cluster within netbox netbox_cluster: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: name: Test Cluster state: absent - name: Create cluster with tags netbox_cluster: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: name: Another Test Cluster cluster_type: libvirt tags: - Schnozzberry state: present - name: Update the group and site of an existing cluster netbox_cluster: netbox_url: http://netbox.local netbox_token: thisIsMyToken data: name: Test Cluster cluster_type: qemu cluster_group: GROUP site: SITE state: present
data: description: - Defines the cluster configuration required: true suboptions: cluster_group: description: - group of the cluster cluster_type: description: - type of the cluster required: true comments: description: - Comments that may include additional information in regards to the cluster custom_fields: description: - must exist in Netbox name: description: - The name of the cluster required: true site: description: - Required if I(state=present) and the cluster does not exist yet tags: description: - Any tags that the cluster may need to be associated with state: choices: - absent - present default: present description: - Use C(present) or C(absent) for adding or removing. netbox_url: description: - URL of the Netbox instance resolvable by Ansible control host required: true netbox_token: description: - The token created within Netbox to authorize API access required: true validate_certs: default: 'yes' description: - If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. type: bool
cluster: description: Serialized object as created or already existent within Netbox returned: success (when I(state=present)) type: dict msg: description: Message indicating failure or info about what has been achieved returned: always type: str