dellemc / dellemc.openmanage / 9.1.0 / module / ome_profile Create, modify, delete, assign, unassign and migrate a profile on OpenManage Enterprise | "added in version" 3.1.0 of dellemc.openmanage" Authors: Jagadeesh N V (@jagadeeshnv)dellemc.openmanage.ome_profile (9.1.0) — module
Install with ansible-galaxy collection install dellemc.openmanage:==9.1.0
collections: - name: dellemc.openmanage version: 9.1.0
This module allows to create, modify, delete, assign, unassign, and migrate a profile on OpenManage Enterprise.
--- - name: Create two profiles from a template dellemc.openmanage.ome_profile: hostname: "192.168.0.1" username: "username" password: "password" ca_path: "/path/to/ca_cert.pem" template_name: "template 1" name_prefix: "omam_profile" number_of_profiles: 2
- name: Create profile with NFS share dellemc.openmanage.ome_profile: hostname: "192.168.0.1" username: "username" password: "password" ca_path: "/path/to/ca_cert.pem" command: create template_name: "template 1" name_prefix: "omam_profile" number_of_profiles: 1 boot_to_network_iso: boot_to_network: true share_type: NFS share_ip: "192.168.0.1" iso_path: "path/to/my_iso.iso" iso_timeout: 8
- name: Create profile with CIFS share dellemc.openmanage.ome_profile: hostname: "192.168.0.1" username: "username" password: "password" ca_path: "/path/to/ca_cert.pem" command: create template_name: "template 1" name_prefix: "omam_profile" number_of_profiles: 1 boot_to_network_iso: boot_to_network: true share_type: CIFS share_ip: "192.168.0.2" share_user: "username" share_password: "password" workgroup: "workgroup" iso_path: "\\path\\to\\my_iso.iso" iso_timeout: 8
- name: Modify profile name with NFS share and attributes dellemc.openmanage.ome_profile: hostname: "192.168.0.1" username: "username" password: "password" ca_path: "/path/to/ca_cert.pem" command: modify name: "Profile 00001" new_name: "modified profile" description: "new description" boot_to_network_iso: boot_to_network: true share_type: NFS share_ip: "192.168.0.3" iso_path: "path/to/my_iso.iso" iso_timeout: 8 attributes: Attributes: - Id: 4506 Value: "server attr 1" IsIgnored: false - Id: 4507 Value: "server attr 2" IsIgnored: false # Enter the comma separated string as appearing in the Detailed view on GUI # System -> Server Topology -> ServerTopology 1 Aisle Name - DisplayName: 'System, Server Topology, ServerTopology 1 Aisle Name' Value: Aisle 5 IsIgnored: false
- name: Delete a profile using profile name dellemc.openmanage.ome_profile: hostname: "192.168.0.1" username: "username" password: "password" ca_path: "/path/to/ca_cert.pem" command: "delete" name: "Profile 00001"
- name: Delete profiles using filters dellemc.openmanage.ome_profile: hostname: "192.168.0.1" username: "username" password: "password" ca_path: "/path/to/ca_cert.pem" command: "delete" filters: SelectAll: true Filters: =contains(ProfileName,'Profile 00002')
- name: Delete profiles using profile list filter dellemc.openmanage.ome_profile: hostname: "192.168.0.1" username: "username" password: "password" ca_path: "/path/to/ca_cert.pem" command: "delete" filters: ProfileIds: - 17123 - 16124
- name: Assign a profile to target along with network share dellemc.openmanage.ome_profile: hostname: "192.168.0.1" username: "username" password: "password" ca_path: "/path/to/ca_cert.pem" command: assign name: "Profile 00001" device_id: 12456 boot_to_network_iso: boot_to_network: true share_type: NFS share_ip: "192.168.0.1" iso_path: "path/to/my_iso.iso" iso_timeout: 8 attributes: Attributes: - Id: 4506 Value: "server attr 1" IsIgnored: true Options: ShutdownType: 0 TimeToWaitBeforeShutdown: 300 EndHostPowerState: 1 StrictCheckingVlan: true Schedule: RunNow: true RunLater: false
- name: Unassign a profile using profile name dellemc.openmanage.ome_profile: hostname: "192.168.0.1" username: "username" password: "password" ca_path: "/path/to/ca_cert.pem" command: "unassign" name: "Profile 00003"
- name: Unassign profiles using filters dellemc.openmanage.ome_profile: hostname: "192.168.0.1" username: "username" password: "password" ca_path: "/path/to/ca_cert.pem" command: "unassign" filters: SelectAll: true Filters: =contains(ProfileName,'Profile 00003')
- name: Unassign profiles using profile list filter dellemc.openmanage.ome_profile: hostname: "192.168.0.1" username: "username" password: "password" ca_path: "/path/to/ca_cert.pem" command: "unassign" filters: ProfileIds: - 17123 - 16123
- name: Migrate a profile dellemc.openmanage.ome_profile: hostname: "192.168.0.1" username: "username" password: "password" ca_path: "/path/to/ca_cert.pem" command: "migrate" name: "Profile 00001" device_id: 12456
name: description: - Name of the profile. - This is applicable for modify, delete, assign, unassign, and migrate operations. - This option is mutually exclusive with I(name_prefix) and I(number_of_profiles). type: str port: default: 443 description: OpenManage Enterprise or OpenManage Enterprise Modular HTTPS port. type: int force: default: false description: - Provides the option to force the migration of a profile even if the source device cannot be contacted. - This option is applicable when I(command) is C(migrate). type: bool ca_path: description: - The Privacy Enhanced Mail (PEM) file that contains a CA certificate to be used for the validation. type: path version_added: 5.0.0 version_added_collection: dellemc.openmanage command: choices: - create - modify - delete - assign - unassign - migrate default: create description: - C(create) creates new profiles. - C(modify) modifies an existing profile. Only I(name), I(description), I(boot_to_network_iso), and I(attributes) can be modified. - C(delete) deletes an existing profile. - C(assign) Deploys an existing profile on a target device and returns a task ID. - C(unassign) unassigns a profile from a specified target and returns a task ID. - C(migrate) migrates an existing profile and returns a task ID. type: str filters: description: - Filters the profiles based on selected criteria. - This is applicable when I(command) is C(delete) or C(unassign). - This supports suboption I(ProfileIds) which takes a list of profile IDs. - This also supports OData filter expressions with the suboption I(Filters). - See OpenManage Enterprise REST API guide for the filtering options available. - I(WARNING) When this option is used in case of C(unassign), task ID is not returned for any of the profiles affected. type: dict timeout: default: 30 description: The socket level timeout in seconds. type: int version_added: 5.0.0 version_added_collection: dellemc.openmanage hostname: description: OpenManage Enterprise or OpenManage Enterprise Modular IP address or hostname. required: true type: str new_name: description: - New name of the profile. - Applicable when I(command) is C(modify). type: str password: description: - OpenManage Enterprise or OpenManage Enterprise Modular password. - If the password is not provided, then the environment variable C(OME_PASSWORD) is used. - 'Example: export OME_PASSWORD=password' required: true type: str username: description: - OpenManage Enterprise or OpenManage Enterprise Modular username. - If the username is not provided, then the environment variable C(OME_USERNAME) is used. - 'Example: export OME_USERNAME=username' required: true type: str device_id: description: - ID of the target device. - This is applicable when I(command) is C(assign) and C(migrate). - This option is mutually exclusive with I(device_service_tag). type: int attributes: description: Attributes for C(modify) and C(assign). suboptions: Attributes: description: - List of attributes to be modified, when I(command) is C(modify). - List of attributes to be overridden when I(command) is C(assign). - Use the I(Id) If the attribute Id is available. If not, use the comma separated I (DisplayName). For more details about using the I(DisplayName), see the example provided. elements: dict type: list Options: description: - Provides the different shut down options. - This is applicable when I(command) is C(assign). type: dict Schedule: description: - Schedule for profile deployment. - This is applicable when I(command) is C(assign). type: dict type: dict description: description: Description of the profile. type: str name_prefix: default: Profile description: - The name provided when creating a profile is used a prefix followed by the number assigned to it by OpenManage Enterprise. - This is applicable only for a create operation. - This option is mutually exclusive with I(name). type: str template_id: description: - ID of the template. - This is applicable when I(command) is C(create). - This option is mutually exclusive with I(template_name). type: int template_name: description: - Name of the template for creating the profile(s). - This is applicable when I(command) is C(create). - This option is mutually exclusive with I(template_id). type: str validate_certs: default: true description: - If C(false), the SSL certificates will not be validated. - Configure C(false) only on personally controlled sites where self-signed certificates are used. - Prior to collection version C(5.0.0), the I(validate_certs) is C(false) by default. type: bool version_added: 5.0.0 version_added_collection: dellemc.openmanage device_service_tag: description: - Identifier of the target device. - This is typically 7 to 8 characters in length. - Applicable when I(command) is C(assign), and C(migrate). - This option is mutually exclusive with I(device_id). - If the device does not exist when I(command) is C(assign) then the profile is auto-deployed. type: str number_of_profiles: default: 1 description: - Provide the number of profiles to be created. - This is applicable when I(name_prefix) is used with C(create). - This option is mutually exclusive with I(name). - Openmanage Enterprise can create a maximum of 100 profiles. type: int boot_to_network_iso: description: - Details of the Share iso. - Applicable when I(command) is C(create), C(assign), and C(modify). suboptions: boot_to_network: description: Enable or disable a network share. required: true type: bool iso_path: description: Specify the full ISO path including the share name. type: str iso_timeout: choices: - 1 - 2 - 4 - 8 - 16 default: 4 description: Set the number of hours that the network ISO file will remain mapped to the target device(s). type: int share_ip: description: IP address of the network share. type: str share_password: description: User password when I(share_type) is C(CIFS). type: str share_type: choices: - NFS - CIFS description: Type of network share. type: str share_user: description: User name when I(share_type) is C(CIFS). type: str workgroup: description: User workgroup when I(share_type) is C(CIFS). type: str type: dict
error_info: description: Details of the HTTP Error. returned: on HTTP error sample: error: '@Message.ExtendedInfo': - Message: Unable to process the request because an error occurred. MessageArgs: [] MessageId: GEN1234 RelatedProperties: [] Resolution: Retry the operation. If the issue persists, contact your system administrator. Severity: Critical code: Base.1.0.GeneralError message: A general error has occurred. See ExtendedInfo for more information. type: dict job_id: description: - Task ID created when I(command) is C(assign), C(migrate) or C(unassign). - C(assign) and C(unassign) operations do not trigger a task if a profile is auto-deployed. returned: when I(command) is C(assign), C(migrate) or C(unassign) sample: 14123 type: int msg: description: Overall status of the profile operation. returned: always sample: Successfully created 2 profile(s). type: str profile_ids: description: IDs of the profiles created. returned: when I(command) is C(create) sample: - 1234 - 5678 type: list