devices – Devices management.¶
Synopsis¶
Configures, modifies and unconfigures devices of a logical partition (LPAR).
This module allows to configure a specified device or all devices in defined state. It can change attributes of a device in ‘Defined/Available’ state. At last it can unconfigure or stop a device in ‘Available’ state.
Requirements¶
The below requirements are needed on the host that executes this module.
AIX
Python >= 2.7
Privileged user with authorizations: aix.device.manage.change,aix.device.manage.remove,aix.device.config
Parameters¶
- attributes (optional, dict, None)
When state=available, specifies the device attribute-value pairs used for changing specific attribute values.
- device (optional, str, all)
Specifies the device logical name in the Customized Devices object class.
all
specifies to configure all devices when state=available.- force (optional, bool, False)
Forces the change/unconfigure operation to take place on a locked device.
- recursive (optional, bool, False)
Specifies to unconfigure the device and its children recursively.
- state (optional, str, available)
Specifies the desired state of the device.
available
configures device when its state is ‘defined’, otherwise it changes the device attributes.
defined
unconfigures/stops the device when its state is ‘available’, otherwise it changes the device attributes.- chtype (optional, str, both)
Specifies the change type that is when the change should take place.
reboot
changes the device at system reboot.
current
changes the current state of the device temporarily. Not persistent after a reboot.
both
changes both the current state of the device and the device database. Persistent after a reboot.- parent_device (optional, str, None)
While modifying device, specifies the parent device of the device to be updated. For unconfigure/stop operation, specifies the parent device whose children need to be unconfigured recursively.
- rmtype (optional, str, unconfigure)
Specifies whether to unconfigure/stop the device.
unconfigure
changes are applied to the device when the system is rebooted.
stop
changes the current state of the device temporarily.
Notes¶
Note
You can refer to the IBM documentation for additional information on the commands used at https://www.ibm.com/support/knowledgecenter/ssw_aix_72/c_commands/cfgmgr.html, https://www.ibm.com/support/knowledgecenter/ssw_aix_72/c_commands/chdev.html, https://www.ibm.com/support/knowledgecenter/ssw_aix_72/r_commands/rmdev.html,
Examples¶
- name: Configure a device
devices:
device: proc0
state: available
- name: Modify an attribute of a device
devices:
device: en1
state: available
attributes:
mtu: 900
arp: off
- name: Unconfigure a device
devices:
device: proc0
state: defined
Return Values¶
- msg (always, str, )
The execution message.
- rc (If the command failed., int, )
The return code.
- stdout (If the command failed., str, )
The standard output.
- stderr (If the command failed., str, )
The standard error.