mnecas / mnecas.ovirt / 1.5.5 / module / ovirt_nic Module to manage network interfaces of Virtual Machines in oVirt/RHV | "added in version" 1.0.0 of mnecas.ovirt" Authors: Ondra Machacek (@machacekondra), Martin Necas (@mnecas)mnecas.ovirt.ovirt_nic (1.5.5) — module
Install with ansible-galaxy collection install mnecas.ovirt:==1.5.5
collections: - name: mnecas.ovirt version: 1.5.5
Module to manage network interfaces of Virtual Machines in oVirt/RHV.
# Examples don't contain auth parameter for simplicity, # look at ovirt_auth module to see how to reuse authentication: - name: Add NIC to VM mnecas.ovirt.ovirt_nic: state: present vm: myvm name: mynic interface: e1000 mac_address: 00:1a:4a:16:01:56 profile: ovirtmgmt network: ovirtmgmt
- name: Plug NIC to VM mnecas.ovirt.ovirt_nic: state: plugged vm: myvm name: mynic
- name: Unplug NIC from VM mnecas.ovirt.ovirt_nic: state: unplugged linked: false vm: myvm name: mynic
- name: Add NIC to template mnecas.ovirt.ovirt_nic: auth: "{{ ovirt_auth }}" state: present template: my_template name: nic1 interface: virtio profile: ovirtmgmt network: ovirtmgmt
- name: Remove NIC from VM mnecas.ovirt.ovirt_nic: state: absent vm: myvm name: mynic
# Change NIC Name - mnecas.ovirt.ovirt_nic: id: 00000000-0000-0000-0000-000000000000 name: "new_nic_name" vm: myvm
id: description: - ID of the nic to manage. type: str vm: description: - Name of the Virtual Machine to manage. - You must provide either C(vm) parameter or C(template) parameter. type: str auth: description: - 'Dictionary with values needed to create HTTP/HTTPS connection to oVirt:' required: true suboptions: ca_file: description: - A PEM file containing the trusted CA certificates. - The certificate presented by the server will be verified using these CA certificates. - If C(ca_file) parameter is not set, system wide CA certificate store is used. - Default value is set by C(OVIRT_CAFILE) environment variable. type: str compress: default: true description: Flag indicating if compression is used for connection. type: bool headers: description: - Dictionary of HTTP headers to be added to each API call. type: dict hostname: description: - A string containing the hostname of the server, usually something like `I(server.example.com)`. - Default value is set by C(OVIRT_HOSTNAME) environment variable. - Either C(url) or C(hostname) is required. type: str insecure: default: false description: - A boolean flag that indicates if the server TLS certificate and host name should be checked. type: bool kerberos: description: - A boolean flag indicating if Kerberos authentication should be used instead of the default basic authentication. type: bool password: description: - The password of the user. - Default value is set by C(OVIRT_PASSWORD) environment variable. required: true type: str timeout: description: Number of seconds to wait for response. type: int token: description: - Token to be used instead of login with username/password. - Default value is set by C(OVIRT_TOKEN) environment variable. type: str url: description: - A string containing the API URL of the server, usually something like `I(https://server.example.com/ovirt-engine/api)`. - Default value is set by C(OVIRT_URL) environment variable. - Either C(url) or C(hostname) is required. type: str username: description: - The name of the user, something like I(admin@internal). - Default value is set by C(OVIRT_USERNAME) environment variable. required: true type: str type: dict name: description: - Name of the network interface to manage. required: true type: str wait: default: true description: - C(yes) if the module should wait for the entity to get into desired state. type: bool state: choices: - absent - plugged - present - unplugged default: present description: - Should the Virtual Machine NIC be present/absent/plugged/unplugged. type: str linked: description: - Defines if the NIC is linked to the virtual machine. type: bool network: description: - Logical network to which the VM network interface should use, by default Empty network is used if network is not specified. type: str profile: description: - Virtual network interface profile to be attached to VM network interface. - When not specified and network has only single profile it will be auto-selected, otherwise you must specify profile. type: str timeout: default: 180 description: - The amount of time in seconds the module should wait for the instance to get into desired state. type: int template: description: - Name of the template to manage. - You must provide either C(vm) parameter or C(template) parameter. type: str interface: description: - Type of the network interface. For example e1000, pci_passthrough, rtl8139, rtl8139_virtio, spapr_vlan or virtio. - It's required parameter when creating the new NIC. type: str mac_address: description: - Custom MAC address of the network interface, by default it's obtained from MAC pool. type: str fetch_nested: default: false description: - If I(True) the module will fetch additional data from the API. - It will fetch IDs of the VMs disks, snapshots, etc. User can configure to fetch other attributes of the nested entities by specifying C(nested_attributes). type: bool poll_interval: default: 3 description: - Number of the seconds the module waits until another poll request on entity status is sent. type: int template_version: description: - Version number of the template. type: int version_added: 1.2.0 version_added_collection: mnecas.ovirt nested_attributes: description: - Specifies list of the attributes which should be fetched from the API. - This parameter apply only when C(fetch_nested) is I(true). elements: str type: list
id: description: ID of the network interface which is managed returned: On success if network interface is found. sample: 7de90f31-222c-436c-a1ca-7e655bd5b60c type: str nic: description: 'Dictionary of all the network interface attributes. Network interface attributes can be found on your oVirt/RHV instance at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/nic.' returned: On success if network interface is found. type: dict