Skip to content

Commit

Permalink
Merge pull request #242 from Sajna-Shetty/collections
Browse files Browse the repository at this point in the history
Release 3.1.0
  • Loading branch information
rajeevarakkal authored Feb 23, 2021
2 parents a36cc8a + d73c7f4 commit 0eeb66a
Show file tree
Hide file tree
Showing 15 changed files with 1,563 additions and 119 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,31 @@ Dell EMC OpenManage Ansible Modules Release Notes
.. contents:: Topics


v3.1.0
======

Release Summary
---------------

OpenManage Enterprise profiles management support added.

Bugfixes
--------

- ome_firmware_baseline_compliance_info - OMEnt firmware baseline compliance info pagination support added (https://github.com/dell/dellemc-openmanage-ansible-modules/issues/171)
- ome_network_proxy - OMEnt network proxy check mode support added (https://github.com/dell/dellemc-openmanage-ansible-modules/issues/187)

Known Issues
------------

- ome_smart_fabric - Issue(185322) Only three design types are supported by OpenManage Enterprise Modular but the module successfully creates a fabric when the design type is not supported.
- ome_smart_fabric_uplink - Issue(186024) ome_smart_fabric_uplink module does not allow the creation of multiple uplinks of the same name even though this is supported by OpenManage Enterprise Modular. If an uplink is created using the same name as an existing uplink, the existing uplink is modified.

New Modules
-----------

- dellemc.openmanage.ome_profile - Create, modify, delete, assign, unassign and migrate a profile on OpenManage Enterprise

v3.0.0
======

Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ OpenManage Ansible Modules simplifies and automates provisioning, deployment, an
* Dell EMC OpenManage Enterprise-Modular versions 1.20.00 and above.

## Prerequisites
* [Ansible >= 2.10.3](https://github.com/ansible/ansible)
* [Ansible >= 2.10.0](https://github.com/ansible/ansible)
* Python >=2.7.17 or >=3.6.5
* To run the iDRAC modules, install OpenManage Python Software Development
Kit (OMSDK) using ``` pip install omsdk --upgrade``` or from
Expand All @@ -20,7 +20,7 @@ OpenManage Ansible Modules simplifies and automates provisioning, deployment, an
## Installation

* From [galaxy](https://galaxy.ansible.com/dellemc/openmanage):
```ansible-galaxy collection install dellemc.openmanage -f```
```ansible-galaxy collection install dellemc.openmanage```

- For offline installation on the Ansible control machine, download the required tar archive version of the collection from [Dell EMC OpenManage collection](https://galaxy.ansible.com/dellemc/openmanage) and run the command given below:
```ansible-galaxy collection install dellemc-openmanage-<version>.tar.gz```
Expand All @@ -35,7 +35,6 @@ Latest sample playbooks and examples are available at [playbooks](https://github
## Documentation
Use `ansible-doc` to view the documentation of each module and plugin.
For example-```ansible-doc dellemc.openmanage.<module_name>```
For detailed information on Dell EMC OpenManage Ansible Modules refer the guides [here.](https://github.com/dell/dellemc-openmanage-ansible-modules/tree/devel/guides)

## LICENSE
This project is licensed under GPL-3.0 License. See the [COPYING](https://github.com/dell/dellemc-openmanage-ansible-modules/tree/collections/COPYING.md) for more information.
Expand Down
3 changes: 2 additions & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace: dellemc
name: openmanage
version: 3.0.0
version: 3.1.0
readme: README.md
authors:
- Rajeev Arakkal <[email protected]>
Expand Down Expand Up @@ -28,3 +28,4 @@ repository: https://github.com/dell/dellemc-openmanage-ansible-modules/tree/coll
homepage: https://github.com/dell/dellemc-openmanage-ansible-modules

issues: https://github.com/dell/dellemc-openmanage-ansible-modules/issues

197 changes: 197 additions & 0 deletions playbooks/ome/profile/ome_profile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
---
- hosts: ome
connection: local
name: Dell EMC OpenManage Ansible profile operations.
gather_facts: False

collections:
- dellemc.openmanage

tasks:
- name: Create two profiles from a template
ome_profile:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
command: create
template_name: "template 1"
name_prefix: "omam_profile"
number_of_profiles: 2
tags:
- create_profile

- name: Create profile with NFS share
ome_profile:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
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
tags:
- create_profile_nfs

- name: Create profile with CIFS share
ome_profile:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
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
tags:
- create_profile_cifs

- name: Modify profile name with NFS share and attributes
ome_profile:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
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.1"
iso_path: "/path/to/my_iso.iso"
iso_timeout: 8
attributes:
Attributes:
- Id: 4506
Value: "server attr 1"
IsIgnored: true
- Id: 4507
Value: "server attr 2"
IsIgnored: true
tags:
- modify_profile

- name: Delete using profile name
ome_profile:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
command: "delete"
name: "Profile 00003"
tags:
- delete_profile_name

- name: Delete using filter
ome_profile:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
command: "delete"
filters:
SelectAll: True
Filters: =contains(ProfileName,'Profile 00002')
tags:
- delete_filter

- name: Delete using profile list filter
ome_profile:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
command: "delete"
filters:
ProfileIds:
- 17123
- 12124
tags:
- delete_profile_ids

- name: Assign profile name with network share
ome_profile:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
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
tags:
- assign_profile

- name: Unassign using profile name
ome_profile:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
command: "unassign"
name: "Profile 00003"
tags:
- unassign_profile_name

- name: "Unassign using filters"
ome_profile:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
command: "unassign"
filters:
SelectAll: True
Filters: =contains(ProfileName,'Profile 00003')
tags:
- unassign_filter

- name: Unassign using filter
ome_profile:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
command: "unassign"
filters:
ProfileIds:
- 17123
- 16123
tags:
- unassign_profile_list

- name: Migrate profile
ome_profile:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
command: "migrate"
name: "Profile 0001"
device_id: 12456
tags:
- migrate_profile
45 changes: 45 additions & 0 deletions playbooks/ome/profile/ome_profile_assign_job_tracking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
- hosts: ome
connection: local
name: Dell EMC OpenManage Ansible profile operations.
gather_facts: False
vars:
retries_count: 120
polling_interval: 30 # 30 seconds x 120 times = 1 hour
failed_states: ['Failed', 'Warning', 'Aborted', 'Paused', 'Stopped',
'Canceled']
completed_states: ['Completed', 'Failed', 'Warning', 'Aborted', 'Paused',
'Stopped', 'Canceled']

collections:
- dellemc.openmanage

tasks:
- name: Assign a profile to target
ome_profile:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
command: "assign"
name: "Profile 00001"
device_id: 12456
register: result

- name: End play when no job_id in result
meta: end_play
when:
- result.changed == false
- "'job_id' not in result"

- name: Get job details using job id
ome_job_info:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
job_id: "{{ result.job_id }}"
register: job_result
failed_when: job_result.job_info.LastRunStatus.Name in "{{ failed_states }}"
changed_when: job_result.job_info.LastRunStatus.Name == 'Completed'
until: job_result.job_info.LastRunStatus.Name in "{{ completed_states }}"
retries: "{{ retries_count }}"
delay: "{{ polling_interval }}"
46 changes: 46 additions & 0 deletions playbooks/ome/profile/ome_profile_migrate_job_tracking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
- hosts: ome
connection: local
name: Dell EMC OpenManage Ansible profile operations.
gather_facts: False
vars:
retries_count: 120
polling_interval: 30 # 30 seconds x 120 times = 1 hour
failed_states: ['Failed', 'Warning', 'Aborted', 'Paused', 'Stopped',
'Canceled']
completed_states: ['Completed', 'Failed', 'Warning', 'Aborted', 'Paused',
'Stopped', 'Canceled']

collections:
- dellemc.openmanage

tasks:

- name: Migrate a profile
ome_profile:
hostname: "{{hostname}}"
username: "{{username}}"
password: "{{password}}"
command: "migrate"
name: "Profile 00001"
device_id: 12456
register: result

- name: End play when no job_id in result
meta: end_play
when:
- result.changed == false
- "'job_id' not in result"

- name: Get job details using job id
ome_job_info:
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
job_id: "{{ result.job_id }}"
register: job_result
failed_when: job_result.job_info.LastRunStatus.Name in "{{ failed_states }}"
changed_when: job_result.job_info.LastRunStatus.Name == 'Completed'
until: job_result.job_info.LastRunStatus.Name in "{{ completed_states }}"
retries: "{{ retries_count }}"
delay: "{{ polling_interval }}"
Loading

0 comments on commit 0eeb66a

Please sign in to comment.