netbox_community / netbox_community.ansible_modules / 0.1.10 / module / netbox_service Creates or removes service from Netbox | "added in version" 0.1.5 of netbox_community.ansible_modules" Authors: Kulakov Ilya (@TawR1024) preview | supported by communitynetbox_community.ansible_modules.netbox_service (0.1.10) — module
Install with ansible-galaxy collection install netbox_community.ansible_modules:==0.1.10
collections: - name: netbox_community.ansible_modules version: 0.1.10
Creates or removes service from Netbox
- name: "Create netbox service" connection: local hosts: all gather_facts: False tasks: - name: Create service netbox_service: netbox_url: netbox_url netbox_token: netbox_token data: device: Test666 name: node-exporter port: 9100 protocol: 6 state: present
- name: "Delete netbox service" connection: local hosts: all gather_facts: False tasks: - name: Delete service netbox_service: netbox_url: netbox_url netbox_token: netbox_token data: device: Test666 name: node-exporter port: 9100 protocol: 6 state: absent
data: description: - Defines the service configuration required: true suboptions: custom_fields: description: - Must exist in Netbox and in key/value format type: dict description: description: - Service description type: str device: description: - Specifies on which device the service is running type: raw ipaddress: description: - VRF that prefix is associated with type: str port: description: - Specifies which port used by service type: int protocol: choices: - 6 TCP - 17 UDP description: - Specifies which protocol used by service type: int virtual_machine: description: null type: raw 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 type: str netbox_token: description: - The token created within Netbox to authorize API access required: true type: str 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