-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #242 from Sajna-Shetty/collections
Release 3.1.0
- Loading branch information
Showing
15 changed files
with
1,563 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]> | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
46
playbooks/ome/profile/ome_profile_migrate_job_tracking.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" |
Oops, something went wrong.