| 1 | --- |
| 2 | - name: Dell OpenManage Ansible profile operations. |
| 3 | hosts: ome |
| 4 | gather_facts: false |
| 5 | |
| 6 | tasks: |
| 7 | - name: Create two profiles from a template |
| 8 | dellemc.openmanage.ome_profile: |
| 9 | hostname: "{{ hostname }}" |
| 10 | username: "{{ username }}" |
| 11 | password: "{{ password }}" |
| 12 | ca_path: "/path/to/ca_cert.pem" |
| 13 | command: create |
| 14 | template_name: "template 1" |
| 15 | name_prefix: "omam_profile" |
| 16 | number_of_profiles: 2 |
| 17 | tags: |
| 18 | - create_profile |
| 19 | delegate_to: localhost |
| 20 | |
| 21 | - name: Create profile with NFS share |
| 22 | dellemc.openmanage.ome_profile: |
| 23 | hostname: "{{ hostname }}" |
| 24 | username: "{{ username }}" |
| 25 | password: "{{ password }}" |
| 26 | ca_path: "/path/to/ca_cert.pem" |
| 27 | command: create |
| 28 | template_name: "template 1" |
| 29 | name_prefix: "omam_profile" |
| 30 | number_of_profiles: 1 |
| 31 | boot_to_network_iso: |
| 32 | boot_to_network: true |
| 33 | share_type: "NFS" |
| 34 | share_ip: "192.168.0.1" |
| 35 | iso_path: "/path/to/my_iso.iso" |
| 36 | iso_timeout: 8 |
| 37 | tags: |
| 38 | - create_profile_nfs |
| 39 | delegate_to: localhost |
| 40 | |
| 41 | - name: Create profile with CIFS share |
| 42 | dellemc.openmanage.ome_profile: |
| 43 | hostname: "{{ hostname }}" |
| 44 | username: "{{ username }}" |
| 45 | password: "{{ password }}" |
| 46 | ca_path: "/path/to/ca_cert.pem" |
| 47 | command: create |
| 48 | template_name: "template 1" |
| 49 | name_prefix: "omam_profile" |
| 50 | number_of_profiles: 1 |
| 51 | boot_to_network_iso: |
| 52 | boot_to_network: true |
| 53 | share_type: CIFS |
| 54 | share_ip: "192.168.0.2" |
| 55 | share_user: "username" |
| 56 | share_password: "password" |
| 57 | workgroup: "workgroup" |
| 58 | iso_path: "\\path\\to\\my_iso.iso" |
| 59 | iso_timeout: 8 |
| 60 | tags: |
| 61 | - create_profile_cifs |
| 62 | delegate_to: localhost |
| 63 | |
| 64 | - name: Modify profile name with NFS share and attributes |
| 65 | dellemc.openmanage.ome_profile: |
| 66 | hostname: "{{ hostname }}" |
| 67 | username: "{{ username }}" |
| 68 | password: "{{ password }}" |
| 69 | ca_path: "/path/to/ca_cert.pem" |
| 70 | command: modify |
| 71 | name: "Profile 00001" |
| 72 | new_name: "modified profile" |
| 73 | description: "new description" |
| 74 | boot_to_network_iso: |
| 75 | boot_to_network: true |
| 76 | share_type: NFS |
| 77 | share_ip: "192.168.0.1" |
| 78 | iso_path: "/path/to/my_iso.iso" |
| 79 | iso_timeout: 8 |
| 80 | attributes: |
| 81 | Attributes: |
| 82 | - Id: 4506 |
| 83 | Value: "server attr 1" |
| 84 | IsIgnored: true |
| 85 | - Id: 4507 |
| 86 | Value: "server attr 2" |
| 87 | IsIgnored: true |
| 88 | - DisplayName: "System, Server Topology, |
| 89 | ServerTopology 1 Aisle Name" |
| 90 | Value: Aisle 5 |
| 91 | IsIgnored: false |
| 92 | tags: |
| 93 | - modify_profile |
| 94 | delegate_to: localhost |
| 95 | |
| 96 | - name: Delete using profile name |
| 97 | dellemc.openmanage.ome_profile: |
| 98 | hostname: "{{ hostname }}" |
| 99 | username: "{{ username }}" |
| 100 | password: "{{ password }}" |
| 101 | ca_path: "/path/to/ca_cert.pem" |
| 102 | command: "delete" |
| 103 | name: "Profile 00003" |
| 104 | tags: |
| 105 | - delete_profile_name |
| 106 | delegate_to: localhost |
| 107 | |
| 108 | - name: Delete using filter |
| 109 | dellemc.openmanage.ome_profile: |
| 110 | hostname: "{{ hostname }}" |
| 111 | username: "{{ username }}" |
| 112 | password: "{{ password }}" |
| 113 | ca_path: "/path/to/ca_cert.pem" |
| 114 | command: "delete" |
| 115 | filters: |
| 116 | SelectAll: true |
| 117 | Filters: =contains(ProfileName,'Profile 00002') |
| 118 | tags: |
| 119 | - delete_filter |
| 120 | delegate_to: localhost |
| 121 | |
| 122 | - name: Delete using profile list filter |
| 123 | dellemc.openmanage.ome_profile: |
| 124 | hostname: "{{ hostname }}" |
| 125 | username: "{{ username }}" |
| 126 | password: "{{ password }}" |
| 127 | ca_path: "/path/to/ca_cert.pem" |
| 128 | command: "delete" |
| 129 | filters: |
| 130 | ProfileIds: |
| 131 | - 17123 |
| 132 | - 12124 |
| 133 | tags: |
| 134 | - delete_profile_ids |
| 135 | delegate_to: localhost |
| 136 | |
| 137 | - name: Assign profile name with network share |
| 138 | dellemc.openmanage.ome_profile: |
| 139 | hostname: "{{ hostname }}" |
| 140 | username: "{{ username }}" |
| 141 | password: "{{ password }}" |
| 142 | ca_path: "/path/to/ca_cert.pem" |
| 143 | command: assign |
| 144 | name: "Profile 00001" |
| 145 | device_id: 12456 |
| 146 | boot_to_network_iso: |
| 147 | boot_to_network: true |
| 148 | share_type: NFS |
| 149 | share_ip: "192.168.0.1" |
| 150 | iso_path: "/path/to/my_iso.iso" |
| 151 | iso_timeout: 8 |
| 152 | attributes: |
| 153 | Attributes: |
| 154 | - Id: 4506 |
| 155 | Value: "server attr 1" |
| 156 | IsIgnored: true |
| 157 | Options: |
| 158 | ShutdownType: 0 |
| 159 | TimeToWaitBeforeShutdown: 300 |
| 160 | EndHostPowerState: 1 |
| 161 | StrictCheckingVlan: true |
| 162 | Schedule: |
| 163 | RunNow: true |
| 164 | RunLater: false |
| 165 | tags: |
| 166 | - assign_profile |
| 167 | delegate_to: localhost |
| 168 | |
| 169 | - name: Unassign using profile name |
| 170 | dellemc.openmanage.ome_profile: |
| 171 | hostname: "{{ hostname }}" |
| 172 | username: "{{ username }}" |
| 173 | password: "{{ password }}" |
| 174 | ca_path: "/path/to/ca_cert.pem" |
| 175 | command: "unassign" |
| 176 | name: "Profile 00003" |
| 177 | tags: |
| 178 | - unassign_profile_name |
| 179 | delegate_to: localhost |
| 180 | |
| 181 | - name: "Unassign using filters" |
| 182 | dellemc.openmanage.ome_profile: |
| 183 | hostname: "{{ hostname }}" |
| 184 | username: "{{ username }}" |
| 185 | password: "{{ password }}" |
| 186 | ca_path: "/path/to/ca_cert.pem" |
| 187 | command: "unassign" |
| 188 | filters: |
| 189 | SelectAll: true |
| 190 | Filters: =contains(ProfileName,'Profile 00003') |
| 191 | tags: |
| 192 | - unassign_filter |
| 193 | delegate_to: localhost |
| 194 | |
| 195 | - name: Unassign using filter |
| 196 | dellemc.openmanage.ome_profile: |
| 197 | hostname: "{{ hostname }}" |
| 198 | username: "{{ username }}" |
| 199 | password: "{{ password }}" |
| 200 | ca_path: "/path/to/ca_cert.pem" |
| 201 | command: "unassign" |
| 202 | filters: |
| 203 | ProfileIds: |
| 204 | - 17123 |
| 205 | - 16123 |
| 206 | tags: |
| 207 | - unassign_profile_list |
| 208 | delegate_to: localhost |
| 209 | |
| 210 | - name: Migrate profile |
| 211 | dellemc.openmanage.ome_profile: |
| 212 | hostname: "{{ hostname }}" |
| 213 | username: "{{ username }}" |
| 214 | password: "{{ password }}" |
| 215 | ca_path: "/path/to/ca_cert.pem" |
| 216 | command: "migrate" |
| 217 | name: "Profile 0001" |
| 218 | device_id: 12456 |
| 219 | tags: |
| 220 | - migrate_profile |
| 221 | delegate_to: localhost |