diff --git a/galaxy.yml b/galaxy.yml index 30aee9d..7aea35e 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -9,7 +9,7 @@ namespace: cisco name: ucs # The version of the collection. Must be compatible with semantic versioning -version: 1.10.0 +version: 1.11.0 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md diff --git a/playbooks/ucs_ip_pool.yml b/playbooks/ucs_ip_pool.yml index f1d9da9..c883362 100644 --- a/playbooks/ucs_ip_pool.yml +++ b/playbooks/ucs_ip_pool.yml @@ -24,7 +24,7 @@ parent_org_path: root description: level1 org state: present - delegate_to: localhost + delegate_to: localhost - name: Configure IPv4 and IPv6 address pool cisco.ucs.ucs_ip_pool: @@ -47,6 +47,7 @@ - ipv6_first_addr: fe80::1cae:7992:d7a1:ec07 ipv6_last_addr: fe80::1cae:7992:d7a1:ecfe ipv6_default_gw: fe80::1cae:7992:d7a1:ecff + delegate_to: localhost - name: Remove IPv4 and IPv6 address pool blocks cisco.ucs.ucs_ip_pool: @@ -61,6 +62,7 @@ - ipv6_first_addr: fe80::1cae:7992:d7a1:ec07 ipv6_last_addr: fe80::1cae:7992:d7a1:ecfe state: absent + delegate_to: localhost - name: Remove IPv4 and IPv6 address pool cisco.ucs.ucs_ip_pool: @@ -68,6 +70,7 @@ name: ip-pool-01 org_dn: org-root/org-level1 state: absent + delegate_to: localhost - name: Remove UCS Organization cisco.ucs.ucs_org: @@ -75,4 +78,4 @@ org_name: level1 parent_org_path: root state: absent - delegate_to: localhost + delegate_to: localhost diff --git a/playbooks/ucs_lan_connectivity.yml b/playbooks/ucs_lan_connectivity.yml index 09903ba..5d44e6a 100644 --- a/playbooks/ucs_lan_connectivity.yml +++ b/playbooks/ucs_lan_connectivity.yml @@ -24,7 +24,7 @@ parent_org_path: root description: level1 org state: present - delegate_to: localhost + delegate_to: localhost - name: Configure LAN Connectivity Policy cisco.ucs.ucs_lan_connectivity: @@ -50,6 +50,7 @@ overlay_vnic: eno3 iscsi_adapter_policy: default vlan_name: Container-TNT-A-NFS + delegate_to: localhost - name: Remove LAN Connectivity Policy cisco.ucs.ucs_lan_connectivity: @@ -57,6 +58,7 @@ name: Cntr-FC-Boot org_dn: org-root/org-level1 state: absent + delegate_to: localhost - name: Remove UCS Organization cisco.ucs.ucs_org: @@ -64,4 +66,4 @@ org_name: level1 parent_org_path: root state: absent - delegate_to: localhost + delegate_to: localhost diff --git a/playbooks/ucs_mac_pool.yml b/playbooks/ucs_mac_pool.yml index a590bdf..e486831 100644 --- a/playbooks/ucs_mac_pool.yml +++ b/playbooks/ucs_mac_pool.yml @@ -24,7 +24,7 @@ parent_org_path: root description: level1 org state: present - delegate_to: localhost + delegate_to: localhost - name: Configure MAC address pool cisco.ucs.ucs_mac_pool: @@ -34,6 +34,7 @@ first_addr: 00:25:B5:00:66:00 last_addr: 00:25:B5:00:67:F3 order: sequential + delegate_to: localhost - name: Remove MAC address pool cisco.ucs.ucs_mac_pool: @@ -41,6 +42,7 @@ name: mac-A org_dn: org-root/org-level1 state: absent + delegate_to: localhost - name: Remove UCS Organization cisco.ucs.ucs_org: @@ -48,4 +50,4 @@ org_name: level1 parent_org_path: root state: absent - delegate_to: localhost + delegate_to: localhost diff --git a/playbooks/ucs_managed_objects.yml b/playbooks/ucs_managed_objects.yml index f36d2b2..1a5230a 100644 --- a/playbooks/ucs_managed_objects.yml +++ b/playbooks/ucs_managed_objects.yml @@ -24,7 +24,7 @@ parent_org_path: root description: level1 org state: present - delegate_to: localhost + delegate_to: localhost - name: Configure Network Control Policy cisco.ucs.ucs_managed_objects: @@ -39,6 +39,7 @@ lldp_receive: enabled lldp_transmit: enabled name: Enable-CDP-LLDP + delegate_to: localhost - name: Remove Network Control Policy cisco.ucs.ucs_managed_objects: @@ -50,6 +51,7 @@ parent_mo_or_dn: org-root/org-level1 name: Enable-CDP-LLDP state: absent + delegate_to: localhost - name: Configure Boot Policy Using JSON objects list with children cisco.ucs.ucs_managed_objects: @@ -100,6 +102,7 @@ } ] } + delegate_to: localhost - name: Remove Boot Policy Using JSON objects list cisco.ucs.ucs_managed_objects: @@ -114,6 +117,7 @@ } } state: absent + delegate_to: localhost - name: Remove UCS Organization cisco.ucs.ucs_org: @@ -121,4 +125,4 @@ org_name: level1 parent_org_path: root state: absent - delegate_to: localhost + delegate_to: localhost diff --git a/playbooks/ucs_ntp_server.yml b/playbooks/ucs_ntp_server.yml index be8f049..024e9dd 100644 --- a/playbooks/ucs_ntp_server.yml +++ b/playbooks/ucs_ntp_server.yml @@ -23,6 +23,7 @@ ntp_server: 10.10.10.10 description: Internal NTP Server by IP address state: present + delegate_to: localhost - name: Configure NTP server cisco.ucs.ucs_ntp_server: @@ -30,15 +31,18 @@ ntp_server: pool.ntp.org description: External NTP Server by hostname state: present + delegate_to: localhost - name: Remove NTP server cisco.ucs.ucs_ntp_server: <<: *login_info ntp_server: 10.10.10.10 state: absent + delegate_to: localhost - name: Remove NTP server cisco.ucs.ucs_ntp_server: <<: *login_info ntp_server: pool.ntp.org - state: absent \ No newline at end of file + state: absent + delegate_to: localhost \ No newline at end of file diff --git a/playbooks/ucs_org.yml b/playbooks/ucs_org.yml index 367beb7..7009f41 100644 --- a/playbooks/ucs_org.yml +++ b/playbooks/ucs_org.yml @@ -23,7 +23,7 @@ org_name: test description: testing org state: present - delegate_to: localhost + delegate_to: localhost - name: Update UCS Organization cisco.ucs.ucs_org: @@ -31,14 +31,14 @@ org_name: test description: Testing org state: present - delegate_to: localhost + delegate_to: localhost - name: Remove UCS Organization cisco.ucs.ucs_org: <<: *login_info org_name: test state: absent - delegate_to: localhost + delegate_to: localhost - name: Add UCS Organization cisco.ucs.ucs_org: @@ -47,7 +47,7 @@ parent_org_path: root description: level1 org state: present - delegate_to: localhost + delegate_to: localhost - name: Add UCS Organization cisco.ucs.ucs_org: @@ -56,6 +56,7 @@ parent_org_path: root/level1 description: level2 org state: present + delegate_to: localhost - name: Add UCS Organization cisco.ucs.ucs_org: @@ -64,6 +65,7 @@ parent_org_path: root/level1/level2 description: level3 org state: present + delegate_to: localhost - name: Remove UCS Organization cisco.ucs.ucs_org: @@ -71,3 +73,4 @@ org_name: level2 parent_org_path: root/level1 state: absent + delegate_to: localhost diff --git a/playbooks/ucs_query.yml b/playbooks/ucs_query.yml index be9d70e..6d271b0 100644 --- a/playbooks/ucs_query.yml +++ b/playbooks/ucs_query.yml @@ -21,7 +21,7 @@ cisco.ucs.ucs_query: <<: *login_info class_ids: computeBlade - delegate_to: localhost + delegate_to: localhost register: response - name: show response @@ -32,7 +32,7 @@ cisco.ucs.ucs_query: <<: *login_info class_ids: computeBlade, fabricVlan - delegate_to: localhost + delegate_to: localhost register: response - name: show response @@ -43,7 +43,7 @@ cisco.ucs.ucs_query: <<: *login_info distinguished_names: org-root - delegate_to: localhost + delegate_to: localhost register: response - name: show response @@ -54,7 +54,7 @@ cisco.ucs.ucs_query: <<: *login_info distinguished_names: org-root, sys/rack-unit-1, sys/chassis-1/blade-2 - delegate_to: localhost + delegate_to: localhost register: response - name: show response diff --git a/playbooks/ucs_san_connectivity.yml b/playbooks/ucs_san_connectivity.yml index 7958af1..a8370dc 100644 --- a/playbooks/ucs_san_connectivity.yml +++ b/playbooks/ucs_san_connectivity.yml @@ -24,7 +24,7 @@ parent_org_path: root description: level1 org state: present - delegate_to: localhost + delegate_to: localhost - name: Configure SAN Connectivity Policy cisco.ucs.ucs_san_connectivity: @@ -39,6 +39,7 @@ - name: Fabric-B vhba_template: vHBA-Template-B adapter_policy: Linux + delegate_to: localhost - name: Remove SAN Connectivity Policy cisco.ucs.ucs_san_connectivity: @@ -46,6 +47,7 @@ name: Cntr-FC-Boot org_dn: org-root/org-level1 state: absent + delegate_to: localhost - name: Remove UCS Organization cisco.ucs.ucs_org: @@ -53,4 +55,4 @@ org_name: level1 parent_org_path: root state: absent - delegate_to: localhost + delegate_to: localhost diff --git a/playbooks/ucs_service_profile_association.yml b/playbooks/ucs_service_profile_association.yml index 96d1ca7..cb02d5d 100644 --- a/playbooks/ucs_service_profile_association.yml +++ b/playbooks/ucs_service_profile_association.yml @@ -26,8 +26,9 @@ delegate_to: localhost register: result until: result.assign_state == 'assigned' and result.assoc_state == 'associated' - retries: 10 - delay: 60 + retries: 1 + delay: 2 + ignore_errors: true - name: Change Service Profile Association to Pool cisco.ucs.ucs_service_profile_association: @@ -38,8 +39,9 @@ delegate_to: localhost register: result until: result.assign_state == 'assigned' and result.assoc_state == 'associated' - retries: 10 - delay: 60 + retries: 1 + delay: 2 + ignore_errors: true - name: Disassociate Service Profile cisco.ucs.ucs_service_profile_association: @@ -49,5 +51,6 @@ delegate_to: localhost register: result until: result.assign_state == 'unassigned' and result.assoc_state == 'unassociated' - retries: 10 - delay: 60 + retries: 1 + delay: 2 + ignore_errors: true diff --git a/playbooks/ucs_service_profile_from_template.yml b/playbooks/ucs_service_profile_from_template.yml index ba05b11..a81d130 100644 --- a/playbooks/ucs_service_profile_from_template.yml +++ b/playbooks/ucs_service_profile_from_template.yml @@ -24,7 +24,7 @@ parent_org_path: root description: level1 org state: present - delegate_to: localhost + delegate_to: localhost - name: Configure Service Profile Template with LAN/SAN Connectivity and all other options defaulted cisco.ucs.ucs_service_profile_template: @@ -42,6 +42,7 @@ server_pool: Container-Pool host_firmware_package: 3.1.2b bios_policy: Docker + delegate_to: localhost - name: Configure Service Profile from Template cisco.ucs.ucs_service_profile_from_template: @@ -51,6 +52,7 @@ user_label: SP Instance power_state: down source_template: sp-template + delegate_to: localhost - name: Remove Service Profile Template cisco.ucs.ucs_service_profile_template: @@ -58,6 +60,7 @@ name: sp-template org_dn: org-root/org-level1 state: absent + delegate_to: localhost - name: Remove UCS Organization cisco.ucs.ucs_org: @@ -65,4 +68,4 @@ org_name: level1 parent_org_path: root state: absent - delegate_to: localhost + delegate_to: localhost diff --git a/playbooks/ucs_service_profile_template.yml b/playbooks/ucs_service_profile_template.yml index a63330c..ac08264 100644 --- a/playbooks/ucs_service_profile_template.yml +++ b/playbooks/ucs_service_profile_template.yml @@ -24,7 +24,7 @@ parent_org_path: root description: level1 org state: present - delegate_to: localhost + delegate_to: localhost - name: Configure Service Profile Template with LAN/SAN Connectivity and all other options defaulted cisco.ucs.ucs_service_profile_template: @@ -42,6 +42,7 @@ server_pool: Container-Pool host_firmware_package: 3.1.2b bios_policy: Docker + delegate_to: localhost - name: Remove Service Profile Template cisco.ucs.ucs_service_profile_template: @@ -49,6 +50,7 @@ name: sp-template org_dn: org-root/org-level1 state: absent + delegate_to: localhost - name: Remove UCS Organization cisco.ucs.ucs_org: @@ -56,4 +58,4 @@ org_name: level1 parent_org_path: root state: absent - delegate_to: localhost + delegate_to: localhost diff --git a/playbooks/ucs_storage_profile.yml b/playbooks/ucs_storage_profile.yml index aaeac87..7d9375f 100644 --- a/playbooks/ucs_storage_profile.yml +++ b/playbooks/ucs_storage_profile.yml @@ -24,7 +24,7 @@ parent_org_path: root description: level1 org state: present - delegate_to: localhost + delegate_to: localhost - name: Configure Storage Profile cisco.ucs.ucs_storage_profile: @@ -38,6 +38,7 @@ - name: Data-LUN size: '200' disk_policy_name: DEE-DG + delegate_to: localhost - name: Remove Local LUN from Storage Profile cisco.ucs.ucs_storage_profile: @@ -47,6 +48,7 @@ local_luns: - name: Data-LUN state: absent + delegate_to: localhost - name: Remove Storage Profile cisco.ucs.ucs_storage_profile: @@ -54,6 +56,7 @@ name: DEE-StgProf org_dn: org-root/org-level1 state: absent + delegate_to: localhost - name: Remove UCS Organization cisco.ucs.ucs_org: @@ -61,4 +64,4 @@ org_name: level1 parent_org_path: root state: absent - delegate_to: localhost + delegate_to: localhost diff --git a/playbooks/ucs_timezone.yml b/playbooks/ucs_timezone.yml index 15a5c3b..a3165fb 100644 --- a/playbooks/ucs_timezone.yml +++ b/playbooks/ucs_timezone.yml @@ -23,9 +23,11 @@ state: present admin_state: enabled timezone: America/Phoenix + delegate_to: localhost - name: Unconfigure Time Zone cisco.ucs.ucs_timezone: <<: *login_info state: absent - admin_state: disabled \ No newline at end of file + admin_state: disabled + delegate_to: localhost \ No newline at end of file diff --git a/playbooks/ucs_uuid_pool.yml b/playbooks/ucs_uuid_pool.yml index a0b3798..f74de5b 100644 --- a/playbooks/ucs_uuid_pool.yml +++ b/playbooks/ucs_uuid_pool.yml @@ -24,7 +24,7 @@ parent_org_path: root description: level1 org state: present - delegate_to: localhost + delegate_to: localhost - name: Configure UUID address pool cisco.ucs.ucs_uuid_pool: @@ -34,6 +34,7 @@ order: sequential first_uuid: 0000-000000000001 last_uuid: 0000-000000000078 + delegate_to: localhost - name: Remove UUID address pool cisco.ucs.ucs_uuid_pool: @@ -41,6 +42,7 @@ name: UUID-Pool org_dn: org-root/org-level1 state: absent + delegate_to: localhost - name: Remove UCS Organization cisco.ucs.ucs_org: @@ -48,4 +50,4 @@ org_name: level1 parent_org_path: root state: absent - delegate_to: localhost + delegate_to: localhost diff --git a/playbooks/ucs_vhba_template.yml b/playbooks/ucs_vhba_template.yml index e830147..9c51de9 100644 --- a/playbooks/ucs_vhba_template.yml +++ b/playbooks/ucs_vhba_template.yml @@ -24,7 +24,7 @@ parent_org_path: root description: level1 org state: present - delegate_to: localhost + delegate_to: localhost - name: Configure vHBA template cisco.ucs.ucs_vhba_template: @@ -34,6 +34,7 @@ fabric: A vsan: VSAN-A wwpn_pool: WWPN-Pool-A + delegate_to: localhost - name: Remote vHBA template cisco.ucs.ucs_vhba_template: @@ -41,6 +42,7 @@ name: vHBA-A org_dn: org-root/org-level1 state: absent + delegate_to: localhost - name: Remove UCS Organization cisco.ucs.ucs_org: @@ -48,4 +50,4 @@ org_name: level1 parent_org_path: root state: absent - delegate_to: localhost + delegate_to: localhost diff --git a/playbooks/ucs_vlan_find.yml b/playbooks/ucs_vlan_find.yml index b2568b1..2fc2f99 100644 --- a/playbooks/ucs_vlan_find.yml +++ b/playbooks/ucs_vlan_find.yml @@ -23,6 +23,7 @@ fabric: 'common' pattern: '.' register: response + delegate_to: localhost - name: show response debug: @@ -33,6 +34,7 @@ <<: *login_info vlanid: '200' register: response + delegate_to: localhost - name: show response debug: diff --git a/playbooks/ucs_vlans.yml b/playbooks/ucs_vlans.yml index d7796ac..f9e92c5 100644 --- a/playbooks/ucs_vlans.yml +++ b/playbooks/ucs_vlans.yml @@ -23,9 +23,11 @@ name: vlan300 id: '300' native: 'no' + delegate_to: localhost - name: Remove VLAN cisco.ucs.ucs_vlans: <<: *login_info name: vlan300 state: absent + delegate_to: localhost diff --git a/playbooks/ucs_vnic_template.yml b/playbooks/ucs_vnic_template.yml index ff98822..ec51965 100644 --- a/playbooks/ucs_vnic_template.yml +++ b/playbooks/ucs_vnic_template.yml @@ -24,7 +24,7 @@ parent_org_path: root description: level1 org state: present - delegate_to: localhost + delegate_to: localhost - name: Configure vNIC template cisco.ucs.ucs_vnic_template: @@ -37,6 +37,7 @@ native: 'yes' - name: vlan200 native: 'no' + delegate_to: localhost - name: Remove VLAN from template cisco.ucs.ucs_vnic_template: @@ -47,6 +48,7 @@ vlans_list: - name: vlan200 state: absent + delegate_to: localhost - name: Configure vNIC template for failover cisco.ucs.ucs_vnic_template: @@ -60,6 +62,7 @@ native: 'yes' - name: vlan200 native: 'no' + delegate_to: localhost - name: Configure vNIC template for failover cisco.ucs.ucs_vnic_template: @@ -73,6 +76,7 @@ native: 'yes' - name: vlan200 native: 'no' + delegate_to: localhost - name: Remove vNIC template @@ -80,19 +84,21 @@ <<: *login_info name: vNIC-A-B org_dn: org-root/org-level1 -# state: absent + state: absent + delegate_to: localhost - name: Remove vNIC template cisco.ucs.ucs_vnic_template: <<: *login_info name: vNIC-B-A org_dn: org-root/org-level1 -# state: absent + state: absent + delegate_to: localhost - name: Remove UCS Organization cisco.ucs.ucs_org: <<: *login_info org_name: level1 parent_org_path: root -# state: absent - delegate_to: localhost + state: absent + delegate_to: localhost diff --git a/playbooks/ucs_vsans.yml b/playbooks/ucs_vsans.yml index 5868690..3469779 100644 --- a/playbooks/ucs_vsans.yml +++ b/playbooks/ucs_vsans.yml @@ -24,9 +24,11 @@ fabric: common vsan_id: '110' vlan_id: '110' + delegate_to: localhost - name: Remove VSAN cisco.ucs.ucs_vsans: <<: *login_info name: vsan110 state: absent + delegate_to: localhost diff --git a/playbooks/ucs_wwn_pool.yml b/playbooks/ucs_wwn_pool.yml index 17ccb62..6a78205 100644 --- a/playbooks/ucs_wwn_pool.yml +++ b/playbooks/ucs_wwn_pool.yml @@ -24,7 +24,7 @@ parent_org_path: root description: level1 org state: present - delegate_to: localhost + delegate_to: localhost - name: Configure WWNN pool cisco.ucs.ucs_wwn_pool: @@ -34,6 +34,7 @@ purpose: node first_addr: 20:00:00:25:B5:48:00:00 last_addr: 20:00:00:25:B5:48:00:0F + delegate_to: localhost - name: Configure WWPN A pool cisco.ucs.ucs_wwn_pool: @@ -44,6 +45,7 @@ order: sequential first_addr: 20:00:00:25:B5:48:0A:00 last_addr: 20:00:00:25:B5:48:0A:0F + delegate_to: localhost - name: Configure WWPN Bpool cisco.ucs.ucs_wwn_pool: @@ -54,6 +56,7 @@ order: sequential first_addr: 20:00:00:25:B5:48:0B:00 last_addr: 20:00:00:25:B5:48:0B:0F + delegate_to: localhost - name: Remove WWNN pool cisco.ucs.ucs_wwn_pool: @@ -61,6 +64,7 @@ org_dn: org-root/org-level1 name: WWNN-Pool state: absent + delegate_to: localhost - name: Remove WWPN pool cisco.ucs.ucs_wwn_pool: @@ -68,6 +72,7 @@ name: WWPN-Pool-A org_dn: org-root/org-level1 state: absent + delegate_to: localhost - name: Remove WWPN pool cisco.ucs.ucs_wwn_pool: @@ -75,6 +80,7 @@ name: WWPN-Pool-B org_dn: org-root/org-level1 state: absent + delegate_to: localhost - name: Remove UCS Organization cisco.ucs.ucs_org: @@ -82,4 +88,4 @@ org_name: level1 parent_org_path: root state: absent - delegate_to: localhost + delegate_to: localhost diff --git a/plugins/modules/ucs_dns_server.py b/plugins/modules/ucs_dns_server.py index bcdd7a1..445f955 100644 --- a/plugins/modules/ucs_dns_server.py +++ b/plugins/modules/ucs_dns_server.py @@ -56,8 +56,6 @@ - David Soper (@dsoper2) - John McDonough (@movinalot) - CiscoUcs (@CiscoUcs) - -version_added: "2.8" ''' EXAMPLES = r''' @@ -93,7 +91,7 @@ def run_module(): argument_spec = ucs_argument_spec.copy() argument_spec.update( dns_server=dict(type='str', aliases=['name']), - description=dict(type='str', aliases=['descr'], default=''), + description=dict(type='str', aliases=['descr']), state=dict(type='str', default='present', choices=['present', 'absent']), delegate_to=dict(type='str', default='localhost'), ) diff --git a/plugins/modules/ucs_graphics_card_policy.py b/plugins/modules/ucs_graphics_card_policy.py index d2d838a..ae74875 100644 --- a/plugins/modules/ucs_graphics_card_policy.py +++ b/plugins/modules/ucs_graphics_card_policy.py @@ -68,7 +68,6 @@ author: - John McDonough (@movinalot) -version_added: "2.9" ''' EXAMPLES = r''' @@ -155,7 +154,6 @@ def main(): argument_spec.update( org_dn=dict(type='str', default='org-root'), name=dict(required=True, type='str'), - descr=dict(type='str'), description=dict(type='str', aliases=['descr']), graphics_card_mode=dict(type='str', choices=[ 'any-configuration', @@ -196,15 +194,9 @@ def main(): kwargs = dict() - # Manage Aliased Attributes - for attribute in ['descr:description']: - attribute_alias = attribute.split(':') - if module.params[attribute_alias[1]] is not None: - kwargs[attribute_alias[0]] = module.params[attribute_alias[1]] - # Manage Attributes for attribute in [ - 'graphics_card_mode', 'descr']: + 'graphics_card_mode', 'description']: if module.params[attribute] is not None: kwargs[attribute] = module.params[attribute] diff --git a/plugins/modules/ucs_ip_pool.py b/plugins/modules/ucs_ip_pool.py index 40922f4..b288312 100644 --- a/plugins/modules/ucs_ip_pool.py +++ b/plugins/modules/ucs_ip_pool.py @@ -25,6 +25,7 @@ - If C(absent), will verify IP pool is absent and will delete if needed. choices: [present, absent] default: present + type: str name: description: - The name of the IP address pool. @@ -32,6 +33,7 @@ - "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)." - You cannot change this name after the IP address pool is created. required: yes + type: str description: description: - The user-defined description of the IP address pool. @@ -39,6 +41,7 @@ - "You can use any characters or spaces except the following:" - "` (accent mark), \ (backslash), ^ (carat), \" (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote)." aliases: [ descr ] + type: str order: description: - The Assignment Order field. @@ -47,66 +50,98 @@ - "sequential - Cisco UCS Manager selects the lowest available identity from the pool." choices: [default, sequential] default: default - ip_blocks: + type: str + ipv4_blocks: description: - List of IPv4 blocks used by the IP Pool. + type: list + elements: dict suboptions: first_addr: description: - The first IPv4 address in the IPv4 addresses block. - This is the From field in the UCS Manager Add IPv4 Blocks menu. + type: str last_addr: description: - The last IPv4 address in the IPv4 addresses block. - This is the To field in the UCS Manager Add IPv4 Blocks menu. + type: str subnet_mask: description: - The subnet mask associated with the IPv4 addresses in the block. default: 255.255.255.0 + type: str default_gw: description: - The default gateway associated with the IPv4 addresses in the block. default: 0.0.0.0 + type: str primary_dns: description: - The primary DNS server that this block of IPv4 addresses should access. default: 0.0.0.0 + type: str secondary_dns: description: - The secondary DNS server that this block of IPv4 addresses should access. default: 0.0.0.0 + type: str + state: + description: + - If C(present), will verify IP block is present and will create if needed. + - If C(absent), will verify IP block is absent and will delete if needed. + choices: [present, absent] + default: present + type: str ipv6_blocks: description: - List of IPv6 blocks used by the IP Pool. + type: list + elements: dict suboptions: ipv6_first_addr: description: - The first IPv6 address in the IPv6 addresses block. - This is the From field in the UCS Manager Add IPv6 Blocks menu. + type: str ipv6_last_addr: description: - The last IPv6 address in the IPv6 addresses block. - This is the To field in the UCS Manager Add IPv6 Blocks menu. + type: str ipv6_prefix: description: - The network address prefix associated with the IPv6 addresses in the block. default: '64' + type: str ipv6_default_gw: description: - The default gateway associated with the IPv6 addresses in the block. default: '::' + type: str ipv6_primary_dns: description: - The primary DNS server that this block of IPv6 addresses should access. default: '::' + type: str ipv6_secondary_dns: description: - The secondary DNS server that this block of IPv6 addresses should access. default: '::' + type: str + state: + description: + - If C(present), will verify IP block is present and will create if needed. + - If C(absent), will verify IP block is absent and will delete if needed. + choices: [present, absent] + default: present + type: str org_dn: description: - Org dn (distinguished name) default: org-root + type: str requirements: - ucsmsdk author: @@ -114,7 +149,6 @@ - David Soper (@dsoper2) - John McDonough (@movinalot) - CiscoUcs (@CiscoUcs) -version_added: '2.5' ''' EXAMPLES = r''' @@ -304,20 +338,8 @@ def main(): argument_spec.update( org_dn=dict(type='str', default='org-root'), name=dict(type='str', required=True), - descr=dict(type='str', default='', aliases=['description']), + descr=dict(type='str', aliases=['description']), order=dict(type='str', default='default', choices=['default', 'sequential']), - first_addr=dict(type='str'), - last_addr=dict(type='str'), - subnet_mask=dict(type='str', default='255.255.255.0'), - default_gw=dict(type='str', default='0.0.0.0'), - primary_dns=dict(type='str', default='0.0.0.0'), - secondary_dns=dict(type='str', default='0.0.0.0'), - ipv6_first_addr=dict(type='str'), - ipv6_last_addr=dict(type='str'), - ipv6_prefix=dict(type='str', default='64'), - ipv6_default_gw=dict(type='str', default='::'), - ipv6_primary_dns=dict(type='str', default='::'), - ipv6_secondary_dns=dict(type='str', default='::'), state=dict(type='str', default='present', choices=['present', 'absent']), ipv4_blocks=dict(type='list', default=None, elements='dict', options=ipv4_configuration_spec), ipv6_blocks=dict(type='list', default=None, elements='dict', options=ipv6_configuration_spec), diff --git a/plugins/modules/ucs_lan_connectivity.py b/plugins/modules/ucs_lan_connectivity.py index a30d793..469fbfa 100644 --- a/plugins/modules/ucs_lan_connectivity.py +++ b/plugins/modules/ucs_lan_connectivity.py @@ -24,13 +24,15 @@ - If C(absent), will verify LAN Connectivity Policies are absent and will delete if needed. choices: [present, absent] default: present + type: str name: description: - The name of the LAN Connectivity Policy. - This name can be between 1 and 16 alphanumeric characters. - "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)." - You cannot change this name after the policy is created. - required: yes + required: true + type: str description: description: - A description of the LAN Connectivity Policy. @@ -39,75 +41,89 @@ - "You can use any characters or spaces except the following:" - "` (accent mark), \ (backslash), ^ (carat), \" (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote)." aliases: [ descr ] + type: str vnic_list: description: - List of vNICs used by the LAN Connectivity Policy. - vNICs used by the LAN Connectivity Policy must be created from a vNIC template. + type: list + elements: dict suboptions: name: description: - The name of the vNIC. - required: yes + required: true + type: str vnic_template: description: - The name of the vNIC template. - required: yes + required: true + type: str adapter_policy: description: - The name of the Ethernet adapter policy. - A user defined policy can be used, or one of the system defined policies. + type: str order: description: - String specifying the vNIC assignment order (e.g., '1', '2'). default: 'unspecified' + type: str state: description: - If C(present), will verify vnic is configured within policy. If C(absent), will verify vnic is absent from policy. choices: [ present, absent ] default: present - version_added: '2.8' + type: str iscsi_vnic_list: description: - List of iSCSI vNICs used by the LAN Connectivity Policy. + type: list + elements: dict suboptions: name: description: - The name of the iSCSI vNIC. - required: yes + required: true + type: str overlay_vnic: description: - The LAN vNIC associated with this iSCSI vNIC. + type: str iscsi_adapter_policy: description: - The iSCSI adapter policy associated with this iSCSI vNIC. + type: str mac_address: description: - The MAC address associated with this iSCSI vNIC. - If the MAC address is not set, Cisco UCS Manager uses a derived MAC address. default: derived + type: str vlan_name: description: - The VLAN used for the iSCSI vNIC. default: default + type: str state: description: - If C(present), will verify iscsi vnic is configured within policy. If C(absent), will verify iscsi vnic is absent from policy. choices: [ present, absent ] default: present - version_added: '2.8' + type: str org_dn: description: - Org dn (distinguished name) default: org-root + type: str requirements: - ucsmsdk author: - David Soper (@dsoper2) - John McDonough (@movinalot) - CiscoUcs (@CiscoUcs) -version_added: '2.5' ''' EXAMPLES = r''' @@ -298,14 +314,14 @@ def main(): vnic = dict( name=dict(type='str', required=True), vnic_template=dict(type='str', required=True), - adapter_policy=dict(type='str', default=''), + adapter_policy=dict(type='str'), order=dict(type='str', default='unspecified'), state=dict(type='str', default='present', choices=['present', 'absent']), ) iscsi_vnic = dict( name=dict(type='str', required=True), - overlay_vnic=dict(type='str', default=''), - iscsi_adapter_policy=dict(type='str', default=''), + overlay_vnic=dict(type='str'), + iscsi_adapter_policy=dict(type='str'), mac_address=dict(type='str', default='derived'), vlan_name=dict(type='str', default='default'), state=dict(type='str', default='present', choices=['present', 'absent']), @@ -315,7 +331,7 @@ def main(): argument_spec.update( org_dn=dict(type='str', default='org-root'), name=dict(type='str', required=True), - description=dict(type='str', aliases=['descr'], default=''), + description=dict(type='str', aliases=['descr']), vnic_list=dict(type='list', elements='dict', options=vnic), iscsi_vnic_list=dict(type='list', elements='dict', options=iscsi_vnic), state=dict(type='str', default='present', choices=['present', 'absent']), diff --git a/plugins/modules/ucs_mac_pool.py b/plugins/modules/ucs_mac_pool.py index 3a0bd64..cfb973f 100644 --- a/plugins/modules/ucs_mac_pool.py +++ b/plugins/modules/ucs_mac_pool.py @@ -24,13 +24,15 @@ - If C(absent), will verify MAC pool is absent and will delete if needed. choices: [present, absent] default: present + type: str name: description: - The name of the MAC pool. - This name can be between 1 and 32 alphanumeric characters. - "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)." - You cannot change this name after the MAC pool is created. - required: yes + required: true + type: str description: description: - A description of the MAC pool. @@ -38,6 +40,7 @@ - "You can use any characters or spaces except the following:" - "` (accent mark), \ (backslash), ^ (carat), \" (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote)." aliases: [ descr ] + type: str order: description: - The Assignment Order field. @@ -46,24 +49,27 @@ - "sequential - Cisco UCS Manager selects the lowest available identity from the pool." choices: [default, sequential] default: default + type: str first_addr: description: - The first MAC address in the block of addresses. - This is the From field in the UCS Manager MAC Blocks menu. + type: str last_addr: description: - The last MAC address in the block of addresses. - This is the To field in the UCS Manager Add MAC Blocks menu. + type: str org_dn: description: - The distinguished name (dn) of the organization where the resource is assigned. default: org-root + type: str requirements: - ucsmsdk author: - David Soper (@dsoper2) - CiscoUcs (@CiscoUcs) -version_added: '2.5' ''' EXAMPLES = r''' @@ -99,7 +105,7 @@ def main(): argument_spec.update( org_dn=dict(type='str', default='org-root'), name=dict(type='str', required=True), - descr=dict(type='str', default='', aliases=['description']), + description=dict(type='str', aliases=['descr']), order=dict(type='str', default='default', choices=['default', 'sequential']), first_addr=dict(type='str'), last_addr=dict(type='str'), diff --git a/plugins/modules/ucs_managed_objects.py b/plugins/modules/ucs_managed_objects.py index aac372d..3a4f961 100644 --- a/plugins/modules/ucs_managed_objects.py +++ b/plugins/modules/ucs_managed_objects.py @@ -26,33 +26,41 @@ - If C(absent), will verify that the Managed Objects are absent and will delete if needed. choices: [ absent, present ] default: present + type: str objects: description: - List of managed objects to configure. Each managed object has suboptions the specify the Python SDK module, class, and properties to configure. + type: list + elements: dict suboptions: module: description: - Name of the Python SDK module implementing the required class. - required: yes + required: true + type: str class_name: description: - Name of the Python class that will be used to configure the Managed Object. - required: yes + required: true + type: str + aliases: [class] properties: description: - List of properties to configure on the Managed Object. See the UCSM Python SDK for information on properties for each class. - required: yes + required: true + type: dict children: description: - Optional list of child objects. Each child has its own module, class, and properties suboptions. - The parent_mo_or_dn property for child objects is automatically set as the list of children is configured. - required: yes + type: list + elements: dict + required: true requirements: - ucsmsdk author: - David Soper (@dsoper2) - CiscoUcs (@CiscoUcs) -version_added: '2.8' ''' EXAMPLES = r''' @@ -218,7 +226,7 @@ def main(): module=dict(type='str', required=True), class_name=dict(type='str', aliases=['class'], required=True), properties=dict(type='dict', required=True), - children=dict(type='list'), + children=dict(type='list', elements='dict'), ) argument_spec = ucs_argument_spec.copy() argument_spec.update( diff --git a/plugins/modules/ucs_ntp_server.py b/plugins/modules/ucs_ntp_server.py index 2c20c62..b1a1ce3 100644 --- a/plugins/modules/ucs_ntp_server.py +++ b/plugins/modules/ucs_ntp_server.py @@ -24,6 +24,7 @@ - If C(present), will add or update an NTP server. choices: [absent, present] default: present + type: str ntp_server: description: @@ -31,7 +32,7 @@ - Enter up to 63 characters that form a valid hostname. - Enter a valid IPV4 Address. aliases: [ name ] - default: "" + type: str description: description: @@ -40,7 +41,7 @@ - "You can use any characters or spaces except the following:" - "` (accent mark), \ (backslash), ^ (carat), \" (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote)." aliases: [ descr ] - default: "" + type: str requirements: - ucsmsdk @@ -48,7 +49,6 @@ - David Soper (@dsoper2) - John McDonough (@movinalot) - CiscoUcs (@CiscoUcs) -version_added: "2.7" ''' EXAMPLES = r''' @@ -99,7 +99,7 @@ def run_module(): argument_spec = ucs_argument_spec.copy() argument_spec.update( ntp_server=dict(type='str', aliases=['name']), - description=dict(type='str', aliases=['descr'], default=''), + description=dict(type='str', aliases=['descr']), state=dict(type='str', default='present', choices=['present', 'absent']), ) diff --git a/plugins/modules/ucs_org.py b/plugins/modules/ucs_org.py index baee409..4687d73 100644 --- a/plugins/modules/ucs_org.py +++ b/plugins/modules/ucs_org.py @@ -70,7 +70,6 @@ - David Soper (@dsoper2) - John McDonough (@movinalot) - CiscoUcs (@CiscoUcs) -version_added: "2.8" ''' EXAMPLES = r''' diff --git a/plugins/modules/ucs_query.py b/plugins/modules/ucs_query.py index 720d374..23b4833 100644 --- a/plugins/modules/ucs_query.py +++ b/plugins/modules/ucs_query.py @@ -46,7 +46,6 @@ author: - John McDonough (@movinalot) - CiscoUcs (@CiscoUcs) -version_added: "2.8" ''' EXAMPLES = r''' @@ -83,9 +82,10 @@ delegate_to: localhost ''' -RETURN = ''' +RETURN = r''' objects: description: results JSON encodded + returned: always type: dict ''' diff --git a/plugins/modules/ucs_san_connectivity.py b/plugins/modules/ucs_san_connectivity.py index 941eea9..3b6d8b6 100644 --- a/plugins/modules/ucs_san_connectivity.py +++ b/plugins/modules/ucs_san_connectivity.py @@ -24,13 +24,14 @@ - If C(absent), will verify SAN Connectivity Policies are absent and will delete if needed. choices: [present, absent] default: present + type: str name: description: - The name of the SAN Connectivity Policy. - This name can be between 1 and 16 alphanumeric characters. - "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)." - You cannot change this name after the policy is created. - required: yes + type: str description: description: - A description of the policy. @@ -39,37 +40,49 @@ - "You can use any characters or spaces except the following:" - "` (accent mark), \ (backslash), ^ (carat), \" (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote)." aliases: [ descr ] + type: str wwnn_pool: description: - Name of the WWNN pool to use for WWNN assignment. default: default + type: str vhba_list: description: - List of vHBAs used by the SAN Connectivity Policy. - vHBAs used by the SAN Connectivity Policy must be created from a vHBA template. - - "Each list element has the following suboptions:" - - "= name" - - " The name of the virtual HBA (required)." - - "= vhba_template" - - " The name of the virtual HBA template (required)." - - "- adapter_policy" - - " The name of the Fibre Channel adapter policy." - - " A user defined policy can be used, or one of the system defined policies (default, Linux, Solaris, VMware, Windows, WindowsBoot)" - - " [Default: default]" - - "- order" - - " String specifying the vHBA assignment order (e.g., '1', '2')." - - " [Default: unspecified]" + type: list + elements: dict + suboptions: + name: + description: + - The name of the virtual HBA (required). + type: str + vhba_template: + description: + - The name of the virtual HBA template (required). + type: str + adapter_policy: + description: + - The name of the Fibre Channel adapter policy. + - A user defined policy can be used, or one of the system defined policies (default, Linux, Solaris, VMware, Windows, WindowsBoot) + default: default + type: str + order: + description: + - String specifying the vHBA assignment order (e.g., '1', '2'). + default: unspecified + type: str org_dn: description: - Org dn (distinguished name) default: org-root + type: str requirements: - ucsmsdk author: - David Soper (@dsoper2) - John McDonough (@movinalot) - CiscoUcs (@CiscoUcs) -version_added: '2.5' ''' EXAMPLES = r''' @@ -106,30 +119,25 @@ def main(): + vhba_list = dict( + name=dict(type='str'), + vhba_template=dict(type='str'), + adapter_policy=dict(type='str', default='default'), + order=dict(type='str', default='unspecified'), + ) argument_spec = ucs_argument_spec.copy() argument_spec.update( org_dn=dict(type='str', default='org-root'), name=dict(type='str'), - descr=dict(type='str'), + description=dict(type='str', aliases=['descr']), wwnn_pool=dict(type='str', default='default'), - vhba_list=dict(type='list'), + vhba_list=dict(type='list', elements='dict', options=vhba_list), state=dict(type='str', default='present', choices=['present', 'absent']), - san_connectivity_list=dict(type='list'), ) - # Note that use of san_connectivity_list is an experimental feature which allows multiple resource updates with a single UCSM connection. - # Support for san_connectivity_list may change or be removed once persistent UCS connections are supported. - # Either san_connectivity_list or name is required (user can specify either a list or single resource). - module = AnsibleModule( argument_spec, supports_check_mode=True, - required_one_of=[ - ['san_connectivity_list', 'name'], - ], - mutually_exclusive=[ - ['san_connectivity_list', 'name'], - ], ) ucs = UCSModule(module) @@ -142,15 +150,7 @@ def main(): changed = False try: - # Only documented use is a single resource, but to also support experimental - # feature allowing multiple updates all params are converted to a san_connectivity_list below. - - if module.params['san_connectivity_list']: - # directly use the list (single resource and list are mutually exclusive - san_connectivity_list = module.params['san_connectivity_list'] - else: - # single resource specified, create list from the current params - san_connectivity_list = [module.params] + san_connectivity_list = [module.params] for san_connectivity in san_connectivity_list: mo_exists = False props_match = False diff --git a/plugins/modules/ucs_scrub_policy.py b/plugins/modules/ucs_scrub_policy.py index de32e02..5c14376 100644 --- a/plugins/modules/ucs_scrub_policy.py +++ b/plugins/modules/ucs_scrub_policy.py @@ -61,7 +61,7 @@ - preserved. - yes scrub the BIOS settings. - no do not scrub the BIOS settings. - choices: [yes, no] + choices: ['yes', 'no'] type: str disk_scrub: @@ -74,7 +74,7 @@ - configuration. - yes scrub the server disks. - no do not scrub the server disks. - choices: [yes, no] + choices: ['yes', 'no'] type: str flex_flash_scrub: @@ -85,7 +85,7 @@ - reacknowledged. If this field is set to No, the SD card is preserved. - yes scrub the flex flash. - no do not scrub the flex flash. - choices: [yes, no] + choices: ['yes', 'no'] type: str persistent_memory_scrub: @@ -98,7 +98,7 @@ - memory modules are preserved. - yes scrub the persistent memory. - no do not scrub the persistent memory. - choices: [yes, no] + choices: ['yes', 'no'] type: str org_dn: @@ -112,7 +112,6 @@ author: - John McDonough (@movinalot) -version_added: "2.9" ''' EXAMPLES = r''' @@ -210,7 +209,6 @@ def main(): argument_spec.update( org_dn=dict(type='str', default='org-root'), name=dict(required=True, type='str'), - descr=dict(type='str'), description=dict(type='str', aliases=['descr']), bios_settings_scrub=dict(type='str', choices=['yes', 'no']), disk_scrub=dict(type='str', choices=['yes', 'no']), @@ -250,16 +248,10 @@ def main(): kwargs = dict() - # Manage Aliased Attributes - for attribute in ['descr:description']: - attribute_alias = attribute.split(':') - if module.params[attribute_alias[1]] is not None: - kwargs[attribute_alias[0]] = module.params[attribute_alias[1]] - # Manage Attributes for attribute in [ 'bios_settings_scrub', - 'descr', + 'description', 'disk_scrub', 'flex_flash_scrub', 'persistent_memory_scrub' diff --git a/plugins/modules/ucs_serial_over_lan_policy.py b/plugins/modules/ucs_serial_over_lan_policy.py index 0b01569..fe086cf 100644 --- a/plugins/modules/ucs_serial_over_lan_policy.py +++ b/plugins/modules/ucs_serial_over_lan_policy.py @@ -62,7 +62,7 @@ speed: description: - The transmission speed of the serial over lan policy. - choices: [9600, 19200, 38400, 57600, 115200] + choices: ['9600', '19200', '38400', '57600', '115200'] type: str org_dn: @@ -76,7 +76,6 @@ author: - John McDonough (@movinalot) -version_added: "2.9" ''' EXAMPLES = r''' @@ -167,7 +166,6 @@ def main(): argument_spec.update( org_dn=dict(type='str', default='org-root'), name=dict(required=True, type='str'), - descr=dict(type='str'), description=dict(type='str', aliases=['descr']), admin_state=dict(type='str', choices=['enable', 'disable']), speed=dict(type='str', choices=[ @@ -207,14 +205,8 @@ def main(): kwargs = dict() - # Manage Aliased Attributes - for attribute in ['descr:description']: - attribute_alias = attribute.split(':') - if module.params[attribute_alias[1]] is not None: - kwargs[attribute_alias[0]] = module.params[attribute_alias[1]] - # Manage Attributes - for attribute in ['admin_state', 'descr', 'speed']: + for attribute in ['admin_state', 'description', 'speed']: if module.params[attribute] is not None: kwargs[attribute] = module.params[attribute] diff --git a/plugins/modules/ucs_server_maintenance.py b/plugins/modules/ucs_server_maintenance.py index d46f433..0bdca52 100644 --- a/plugins/modules/ucs_server_maintenance.py +++ b/plugins/modules/ucs_server_maintenance.py @@ -15,7 +15,6 @@ --- module: ucs_server_maintenance short_description: Creates Server Maintenance Policy on Cisco UCS Manager -version_added: 2.10 description: - Configures Server Maintenance Policy on Cisco UCS Manager. extends_documentation_fragment: cisco.ucs.ucs @@ -26,6 +25,7 @@ - If C(absent), will verify Server Maintenance Policy is absent and will delete if needed. choices: [present, absent] default: present + type: str name: description: - The name assigned to the Server Maintenance Policy. @@ -34,6 +34,7 @@ - "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)." - You cannot change this name after the Server Maintenance Policy is created. required: yes + type: str description: description: - A description of the Server Maintenance Package Policy. @@ -42,18 +43,21 @@ - "You can use any characters or spaces except the following:" - "` (accent mark), \ (backslash), ^ (carat), \" (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote)." aliases: [ descr ] + type: str trigger_config: description: - This option is used in combination with either User Ack (user-ack) or Timer Automatic (timer-automatic). - When the On Next Boot option is enabled, the host OS reboot, shutdown, or server reset also triggers the associated FSM to apply the changes. - Note that de-selecting the On Next Boot option disables the Maintenance Policy on the BMC. choices: [on-next-boot] + type: str uptime_disr: description: - When a Server profile is associated with a Server, or when changes are made to an associated Server profile, you must reboot the Server. - The Reboot Policy field determines when the reboot occurs for Server associated with any Server profiles that include this maintenance policy. choices: [immediate, timer-automatic, user-ack] required: true + type: str requirements: - ucsmsdk author: @@ -83,8 +87,8 @@ def main(): argument_spec = ucs_argument_spec.copy() argument_spec.update( name=dict(type='str', required=True), - description=dict(type='str', default=''), - trigger_config=dict(type='str', default='', choices=['on-next-boot']), + description=dict(type='str', aliases=['descr']), + trigger_config=dict(type='str', choices=['on-next-boot']), uptime_disr=dict(type='str', required=True, choices=['immediate', 'timer-automatic', 'user-ack']), state=dict(type='str', default='present', choices=['present', 'absent']), ) diff --git a/plugins/modules/ucs_service_profile_association.py b/plugins/modules/ucs_service_profile_association.py index 0be2deb..4b62f3a 100644 --- a/plugins/modules/ucs_service_profile_association.py +++ b/plugins/modules/ucs_service_profile_association.py @@ -24,10 +24,12 @@ - If C(absent), will verify service profile is not associated and will disassociate if needed. This is the same as specifying Assign Later in the webUI. choices: [present, absent] default: present + type: str service_profile_name: description: - The name of the Service Profile being associated or disassociated. - required: yes + required: true + type: str server_assignment: description: - "Specifies how to associate servers with this service profile using the following choices:" @@ -36,17 +38,19 @@ - Option is not valid if the service profile is bound to a template. - Optional if the state is absent. choices: [server, pool] - required: yes + type: str server_dn: description: - The Distinguished Name (dn) of the server object used for pre-provisioning or selecting an existing server. - Required if the server_assignment option is server. - Optional if the state is absent. + type: str server_pool_name: description: - Name of the server pool used for server pool based assignment. - Required if the server_assignment option is pool. - Optional if the state is absent. + type: str restrict_migration: description: - Restricts the migration of the service profile after it has been associated with a server. @@ -54,16 +58,17 @@ - If set to no and the hardware of both servers used in migration are not similar, the association might fail. choices: ['yes', 'no'] default: 'no' + type: str org_dn: description: - The distinguished name (dn) of the organization where the resource is assigned. default: org-root + type: str requirements: - ucsmsdk author: - David Soper (@dsoper2) - CiscoUcs (@CiscoUcs) -version_added: 2.10 ''' EXAMPLES = r''' @@ -103,12 +108,12 @@ assign_state: description: The logical server Assigned State (assigned, unassigned, or failed). returned: success - type: string + type: str sample: assigned assoc_state: description: The logical server Association State (associated or unassociated). returned: success - type: string + type: str sample: associated ''' diff --git a/plugins/modules/ucs_service_profile_from_template.py b/plugins/modules/ucs_service_profile_from_template.py index f485ceb..950001c 100644 --- a/plugins/modules/ucs_service_profile_from_template.py +++ b/plugins/modules/ucs_service_profile_from_template.py @@ -24,39 +24,45 @@ - If C(absent), will verify Service Profiles are absent and will delete if needed. choices: [present, absent] default: present + type: str name: description: - The name of the service profile. - This name can be between 2 and 32 alphanumeric characters. - "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)." - This name must be unique across all service profiles and service profile templates within the same organization. - required: yes + required: true + type: str source_template: description: - The name of the service profile template used to create this serivce profile. - required: yes + required: true + type: str power_state: description: - The power state to be applied when this service profile is associated with a server. - If no value is provided, the power_state for the service profile will not be modified. choices: [up, down] + type: str user_label: description: - The User Label you want to assign to this service profile. + type: str org_dn: description: - Org dn (distinguished name) default: org-root + type: str description: description: - Optional - The Description of the service profile + type: str requirements: - ucsmsdk author: - David Soper (@dsoper2) - CiscoUcs (@CiscoUcs) -version_added: '2.5' ''' EXAMPLES = r''' @@ -92,10 +98,10 @@ def main(): org_dn=dict(type='str', default='org-root'), name=dict(type='str', required=True), source_template=dict(type='str', required=True), - user_label=dict(type='str', default=''), + user_label=dict(type='str'), power_state=dict(type='str', choices=['up', 'down']), state=dict(type='str', default='present', choices=['present', 'absent']), - description=dict(type='str', default=''), + description=dict(type='str'), ) module = AnsibleModule( diff --git a/plugins/modules/ucs_service_profile_template.py b/plugins/modules/ucs_service_profile_template.py index 05beb72..8989310 100644 --- a/plugins/modules/ucs_service_profile_template.py +++ b/plugins/modules/ucs_service_profile_template.py @@ -24,6 +24,7 @@ - If C(absent), will verify Service Profile Templates are absent and will delete if needed. choices: [present, absent] default: present + type: str name: description: - The name of the service profile template. @@ -31,6 +32,7 @@ - "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)." - This name must be unique across all service profiles and service profile templates within the same organization. required: yes + type: str template_type: description: - "The template type field which can be one of the following:" @@ -38,6 +40,7 @@ - "updating-template — Any service profiles created from this template are updated if the template changes." choices: [initial-template, updating-template] default: initial-template + type: str uuid_pool: description: - Specifies how the UUID will be set on a server associated with a service profile created from this template. @@ -47,6 +50,7 @@ - the UUID is set to the UUID value assigned to the server by the manufacturer. If the service profile is later moved to - a different server, the UUID is changed to match the new server." default: default + type: str description: description: - A user-defined description of the service profile template. @@ -54,106 +58,134 @@ - "You can use any characters or spaces except the following:" - "` (accent mark), \ (backslash), ^ (carat), \" (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote)." aliases: [ descr ] + type: str storage_profile: description: - The name of the storage profile you want to associate with service profiles created from this template + type: str local_disk_policy: description: - The name of the local disk policy you want to associate with service profiles created from this template. + type: str lan_connectivity_policy: description: - The name of the LAN connectivity policy you want to associate with service profiles created from this template. + type: str iqn_pool: description: - The name of the IQN pool (initiator) you want to apply to all iSCSI vNICs for service profiles created from this template. + type: str san_connectivity_policy: description: - The name of the SAN connectivity policy you want to associate with service profiles created from this template. + type: str vmedia_policy: description: - The name of the vMedia policy you want to associate with service profiles created from this template. + type: str boot_policy: description: - The name of the boot order policy you want to associate with service profiles created from this template. default: default + type: str maintenance_policy: description: - The name of the maintenance policy you want to associate with service profiles created from this template. + type: str server_pool: description: - The name of the server pool you want to associate with this service profile template. + type: str server_pool_qualification: description: - The name of the server pool policy qualificaiton you want to use for this service profile template. + type: str power_state: description: - The power state to be applied when a service profile created from this template is associated with a server. choices: [up, down] default: up + type: str host_firmware_package: description: - The name of the host firmware package you want to associate with service profiles created from this template. + type: str bios_policy: description: - The name of the BIOS policy you want to associate with service profiles created from this template. + type: str ipmi_access_profile: description: - The name of the IPMI access profile you want to associate with service profiles created from this template. + type: str sol_policy: description: - The name of the Serial over LAN (SoL) policy you want to associate with service profiles created from this template. + type: str mgmt_ip_state: description: - The state for the Outband Management IP pool you want to use with service profiles created from this template. - choices: [none, pooled] + - Choices are none or pooled. default: pooled + type: str mgmt_ip_pool: description: - The name of the Outband Management IP pool you want to use with service profiles created from this template. default: ext-mgmt + type: str power_control_policy: description: - The name of the power control policy you want to associate with service profiles created from this template. default: default + type: str power_sync_policy: description: - The name of the power sync policy you want to associate with service profiles created from this template. + type: str scrub_policy: description: - The name of the scrub policy you want to associate with service profiles created from this template. + type: str kvm_mgmt_policy: description: - The name of the KVM management policy you want to associate with service profiles created from this template. + type: str graphics_card_policy: description: - The name of the graphics card policy you want to associate with service profiles created from this template. + type: str threshold_policy: description: - The name of the threshold policy you want to associate with service profiles created from this template. default: default + type: str user_label: description: - The User Label you want to assign to service profiles created from this template. + type: str mgmt_interface_mode: description: - The Management Interface you want to assign to service profiles created from this template. choices: ['', in-band] + type: str mgmt_vnet_name: description: - A VLAN selected from the associated VLAN group. + type: str mgmt_inband_pool_name: description: - How the inband management IPv4 address is derived for the server associated with this service profile. + type: str org_dn: description: - Org dn (distinguished name) default: org-root + type: str requirements: - ucsmsdk author: - David Soper (@dsoper2) - CiscoUcs (@CiscoUcs) -version_added: '2.8' ''' EXAMPLES = r''' @@ -456,36 +488,36 @@ def main(): argument_spec.update( org_dn=dict(type='str', default='org-root'), name=dict(type='str', required=True), - bios_policy=dict(type='str', default=''), + bios_policy=dict(type='str'), boot_policy=dict(type='str', default='default'), - description=dict(type='str', aliases=['descr'], default=''), + description=dict(type='str', aliases=['descr']), mgmt_ip_state=dict(type='str', default='pooled'), mgmt_ip_pool=dict(type='str', default='ext-mgmt'), - graphics_card_policy=dict(type='str', default=''), - host_firmware_package=dict(type='str', default=''), + graphics_card_policy=dict(type='str'), + host_firmware_package=dict(type='str'), uuid_pool=dict(type='str', default='default'), - kvm_mgmt_policy=dict(type='str', default=''), - local_disk_policy=dict(type='str', default=''), - maintenance_policy=dict(type='str', default=''), - ipmi_access_profile=dict(type='str', default=''), + kvm_mgmt_policy=dict(type='str'), + local_disk_policy=dict(type='str'), + maintenance_policy=dict(type='str'), + ipmi_access_profile=dict(type='str'), power_control_policy=dict(type='str', default='default'), - power_sync_policy=dict(type='str', default=''), - scrub_policy=dict(type='str', default=''), - sol_policy=dict(type='str', default=''), + power_sync_policy=dict(type='str'), + scrub_policy=dict(type='str'), + sol_policy=dict(type='str'), threshold_policy=dict(type='str', default='default'), template_type=dict(type='str', default='initial-template', choices=['initial-template', 'updating-template']), - user_label=dict(type='str', default=''), - vmedia_policy=dict(type='str', default=''), - storage_profile=dict(type='str', default=''), - lan_connectivity_policy=dict(type='str', default=''), - iqn_pool=dict(type='str', default=''), - san_connectivity_policy=dict(type='str', default=''), - server_pool=dict(type='str', default=''), - server_pool_qualification=dict(type='str', default=''), + user_label=dict(type='str'), + vmedia_policy=dict(type='str'), + storage_profile=dict(type='str'), + lan_connectivity_policy=dict(type='str'), + iqn_pool=dict(type='str'), + san_connectivity_policy=dict(type='str'), + server_pool=dict(type='str'), + server_pool_qualification=dict(type='str'), power_state=dict(type='str', default='up', choices=['up', 'down']), - mgmt_interface_mode=dict(type='str', default='', choices=['', 'in-band']), - mgmt_vnet_name=dict(type='str', default=''), - mgmt_inband_pool_name=dict(type='str', default=''), + mgmt_interface_mode=dict(type='str', choices=['', 'in-band']), + mgmt_vnet_name=dict(type='str'), + mgmt_inband_pool_name=dict(type='str'), state=dict(type='str', default='present', choices=['present', 'absent']), ) diff --git a/plugins/modules/ucs_sp_vnic_order.py b/plugins/modules/ucs_sp_vnic_order.py index 247b5bd..dcd6ee5 100644 --- a/plugins/modules/ucs_sp_vnic_order.py +++ b/plugins/modules/ucs_sp_vnic_order.py @@ -17,36 +17,45 @@ short_description: Configures vNIC order for service profiles and templates on Cisco UCS Manager -version_added: 2.10 - description: - Configures Configures vNIC order for service profiles and templates on Cisco UCS Manager options: sp_name: description: DN of the service profile + required: true + type: str vnics: description: List of vNIC order properties + type: list + elements: dict + required: true suboptions: name: description: Name of the vNIC required: true + type: str admin_vcon: description: Name of the virtual connection choices: ["1","2","3","4","any"] + type: str order: - description: vNIC connection order - choices: ["unspecified", "0-256"] + description: vNIC connection order. Choices are 0-256 or unspecified. + type: str transport: description: transport medium choices: ["ethernet", "fc"] required: true + type: str state: description: Desired state of the vNIC. choices: [present, absent] default: present + type: str org_dn: description: root org dn + default: org-root + type: str extends_documentation_fragment: - cisco.ucs.ucs requirements: diff --git a/plugins/modules/ucs_storage_profile.py b/plugins/modules/ucs_storage_profile.py index c404f9a..3cc86a4 100644 --- a/plugins/modules/ucs_storage_profile.py +++ b/plugins/modules/ucs_storage_profile.py @@ -24,6 +24,7 @@ - If C(absent), will verify that the storage profile is absent and will delete if needed. choices: [ absent, present ] default: present + type: str name: description: - The name of the storage profile. @@ -31,6 +32,7 @@ - "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)." - You cannot change this name after profile is created. required: yes + type: str description: description: - The user-defined description of the storage profile. @@ -38,48 +40,59 @@ - "You can use any characters or spaces except the following:" - "` (accent mark), \ (backslash), ^ (carat), \" (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote)." aliases: [ descr ] + type: str local_luns: description: - List of Local LUNs used by the storage profile. + type: list + elements: dict suboptions: name: description: - The name of the local LUN. required: yes + type: str size: description: - Size of this LUN in GB. - The size can range from 1 to 10240 GB. default: '1' + type: str auto_deploy: description: - Whether the local LUN should be automatically deployed or not. choices: [ auto-deploy, no-auto-deploy ] default: auto-deploy + type: str expand_to_avail: description: - Specifies that this LUN can be expanded to use the entire available disk group. - For each service profile, only one LUN can use this option. - Expand To Available option is not supported for already deployed LUN. - type: bool + choices: ['no', 'yes'] default: 'no' + type: str fractional_size: description: - Fractional size of this LUN in MB. default: '0' + type: str disk_policy_name: description: - The disk group configuration policy to be applied to this local LUN. + type: str state: description: - If C(present), will verify local LUN is present on profile. If C(absent), will verify local LUN is absent on profile. choices: [ absent, present ] default: present + type: str org_dn: description: - The distinguished name (dn) of the organization where the resource is assigned. default: org-root + type: str requirements: - ucsmsdk author: @@ -87,7 +100,6 @@ - David Soper (@dsoper2) - John McDonough (@movinalot) - CiscoUcs (@CiscoUcs) -version_added: '2.7' ''' EXAMPLES = r''' @@ -140,13 +152,13 @@ def main(): auto_deploy=dict(type='str', default='auto-deploy', choices=['auto-deploy', 'no-auto-deploy']), expand_to_avail=dict(type='str', default='no', choices=['no', 'yes']), fractional_size=dict(type='str', default='0'), - disk_policy_name=dict(type='str', default=''), + disk_policy_name=dict(type='str'), ) argument_spec = ucs_argument_spec.copy() argument_spec.update( org_dn=dict(type='str', default='org-root'), name=dict(type='str', required=True), - description=dict(type='str', aliases=['descr'], default=''), + description=dict(type='str', aliases=['descr']), local_luns=dict(type='list', elements='dict', options=local_lun), state=dict(type='str', default='present', choices=['present', 'absent']), ) diff --git a/plugins/modules/ucs_system_qos.py b/plugins/modules/ucs_system_qos.py index 43e0af2..f60dc62 100644 --- a/plugins/modules/ucs_system_qos.py +++ b/plugins/modules/ucs_system_qos.py @@ -14,7 +14,6 @@ --- module: ucs_system_qos short_description: Configures system QoS settings -version_added: 2.10 description: - Configures system QoS settings extends_documentation_fragment: cisco.ucs.ucs @@ -23,29 +22,34 @@ description: Priority to configure choices: ["best-effort", "bronze", "fc", "gold","platinum", "silver"] required: true + type: str admin_state: description: Admin state of QoS Policy choices: ['disabled', 'enabled'] default: enabled + type: str cos: - description: CoS setting - choices: ['any', '0-6'] + description: CoS setting. Choices are any or 0-6. required: true + type: str weight: - description: CoS profile weight - choices: ['best-effort', 'none', '0-10'] + description: CoS profile weight. Choices are best-effort, none or 0-10. required: true + type: str mtu: - description: MTU size - choices: ['fc', 'normal', '0-4294967295'] + description: MTU size. Choices are fc, normal or 0-4294967295. default: normal + type: str multicast_optimize: description: Set multicast optimization options choices: ['false', 'no', 'true', 'yes'] + default: 'no' + type: str drop: description: Set multicast optimization options default: 'drop' choices: ['drop', 'no-drop'] + type: str requirements: ['ucsmsdk'] author: "Brett Johnson (@sdbrett)" ''' diff --git a/plugins/modules/ucs_timezone.py b/plugins/modules/ucs_timezone.py index 59c4781..f50b966 100644 --- a/plugins/modules/ucs_timezone.py +++ b/plugins/modules/ucs_timezone.py @@ -24,6 +24,7 @@ - If C(present), will set or update timezone. choices: [absent, present] default: present + type: str admin_state: description: @@ -32,6 +33,7 @@ - The disabled admin_state indicates the timezone configuration is ignored by UCS Manager. choices: [disabled, enabled] default: enabled + type: str description: description: @@ -40,7 +42,7 @@ - "You can use any characters or spaces except the following:" - "` (accent mark), \ (backslash), ^ (carat), \" (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote)." aliases: [ descr ] - default: "" + type: str timezone: description: @@ -50,6 +52,7 @@ - The timezone name can be between 0 and 510 alphanumeric characters. - You cannot use spaces or any special characters other than - "\"-\" (hyphen), \"_\" (underscore), \"/\" (backslash)." + type: str requirements: - ucsmsdk @@ -57,7 +60,6 @@ - David Soper (@dsoper2) - John McDonough (@movinalot) - CiscoUcs (@CiscoUcs) -version_added: '2.7' ''' EXAMPLES = r''' @@ -92,7 +94,7 @@ def run_module(): argument_spec = ucs_argument_spec.copy() argument_spec.update( timezone=dict(type='str'), - description=dict(type='str', aliases=['descr'], default=''), + description=dict(type='str', aliases=['descr']), admin_state=dict(type='str', default='enabled', choices=['disabled', 'enabled']), state=dict(type='str', default='present', choices=['present', 'absent']), ) diff --git a/plugins/modules/ucs_uuid_pool.py b/plugins/modules/ucs_uuid_pool.py index 56c66e2..758ee33 100644 --- a/plugins/modules/ucs_uuid_pool.py +++ b/plugins/modules/ucs_uuid_pool.py @@ -24,6 +24,7 @@ - If C(absent), will verify UUID pool is absent and will delete if needed. choices: [present, absent] default: present + type: str name: description: - The name of the UUID pool. @@ -31,6 +32,7 @@ - "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)." - You cannot change this name after the UUID pool is created. required: yes + type: str description: description: - "The user-defined description of the UUID pool." @@ -38,12 +40,14 @@ - "You can use any characters or spaces except the following:" - "` (accent mark), \ (backslash), ^ (carat), \" (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote)." aliases: [ descr ] + type: str prefix: description: - UUID prefix used for the range of server UUIDs. - "If no value is provided, the system derived prefix will be used (equivalent to selecting 'derived' option in UI)." - "If the user provides a value, the user provided prefix will be used (equivalent to selecting 'other' option in UI)." - A user provided value should be in the format XXXXXXXX-XXXX-XXXX. + type: str order: description: - The Assignment Order field. @@ -52,24 +56,27 @@ - "sequential - Cisco UCS Manager selects the lowest available identity from the pool." choices: [default, sequential] default: default + type: str first_uuid: description: - The first UUID in the block of UUIDs. - This is the From field in the UCS Manager UUID Blocks menu. + type: str last_uuid: description: - The last UUID in the block of UUIDs. - This is the To field in the UCS Manager Add UUID Blocks menu. + type: str org_dn: description: - The distinguished name (dn) of the organization where the resource is assigned. default: org-root + type: str requirements: - ucsmsdk author: - David Soper (@dsoper2) - CiscoUcs (@CiscoUcs) -version_added: '2.7' ''' EXAMPLES = r''' @@ -105,9 +112,9 @@ def main(): argument_spec.update( org_dn=dict(type='str', default='org-root'), name=dict(type='str', required=True), - description=dict(type='str', aliases=['descr'], default=''), + description=dict(type='str', aliases=['descr']), order=dict(type='str', default='default', choices=['default', 'sequential']), - prefix=dict(type='str', default=''), + prefix=dict(type='str'), first_uuid=dict(type='str'), last_uuid=dict(type='str'), state=dict(default='present', choices=['present', 'absent'], type='str'), diff --git a/plugins/modules/ucs_vhba_template.py b/plugins/modules/ucs_vhba_template.py index cee8e02..8601a71 100644 --- a/plugins/modules/ucs_vhba_template.py +++ b/plugins/modules/ucs_vhba_template.py @@ -24,6 +24,7 @@ - If C(absent), will verify vHBA templates are absent and will delete if needed. choices: [present, absent] default: present + type: str name: description: - The name of the virtual HBA template. @@ -31,6 +32,7 @@ - "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)." - You cannot change this name after the template is created. required: yes + type: str description: description: - A user-defined description of the template. @@ -38,12 +40,14 @@ - "You can use any characters or spaces except the following:" - "` (accent mark), \ (backslash), ^ (carat), \" (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote)." aliases: [ descr ] + type: str fabric: description: - The Fabric ID field. - The name of the fabric interconnect that vHBAs created with this template are associated with. choices: [A, B] default: A + type: str redundancy_type: description: - The Redundancy Type used for template pairing from the Primary or Secondary redundancy template. @@ -53,10 +57,12 @@ - "none - Legacy vHBA template behavior. Select this option if you do not want to use redundancy." choices: [none, primary, secondary] default: none + type: str vsan: description: - The VSAN to associate with vHBAs created from this template. default: default + type: str template_type: description: - The Template Type field. @@ -65,37 +71,43 @@ - "updating-template - vHBAs created from this template are updated if the template changes." choices: [initial-template, updating-template] default: initial-template + type: str max_data: description: - The Max Data Field Size field. - The maximum size of the Fibre Channel frame payload bytes that the vHBA supports. - Enter an string between '256' and '2112'. default: '2048' + type: str wwpn_pool: description: - The WWPN pool that a vHBA created from this template uses to derive its WWPN address. default: default + type: str qos_policy: description: - The QoS policy that is associated with vHBAs created from this template. + type: str pin_group: description: - The SAN pin group that is associated with vHBAs created from this template. + type: str stats_policy: description: - The statistics collection policy that is associated with vHBAs created from this template. default: default + type: str org_dn: description: - Org dn (distinguished name) default: org-root + type: str requirements: - ucsmsdk author: - David Soper (@dsoper2) - John McDonough (@movinalot) - CiscoUcs (@CiscoUcs) -version_added: '2.5' ''' EXAMPLES = r''' @@ -130,8 +142,8 @@ def main(): argument_spec = ucs_argument_spec.copy() argument_spec.update( org_dn=dict(type='str', default='org-root'), - name=dict(type='str'), - descr=dict(type='str'), + name=dict(type='str', required=True), + description=dict(type='str', aliases=['descr']), fabric=dict(type='str', default='A', choices=['A', 'B']), redundancy_type=dict(type='str', default='none', choices=['none', 'primary', 'secondary']), vsan=dict(type='str', default='default'), @@ -142,22 +154,11 @@ def main(): pin_group=dict(type='str'), stats_policy=dict(type='str', default='default'), state=dict(type='str', default='present', choices=['present', 'absent']), - vhba_template_list=dict(type='list'), ) - # Note that use of vhba_template_list is an experimental feature which allows multiple resource updates with a single UCSM connection. - # Support for vhba_template_list may change or be removed once persistent UCS connections are supported. - # Either vhba_template_list or name is required (user can specify either a list of single resource). - module = AnsibleModule( argument_spec, supports_check_mode=True, - required_one_of=[ - ['vhba_template_list', 'name'] - ], - mutually_exclusive=[ - ['vhba_template_list', 'name'] - ], ) ucs = UCSModule(module) @@ -168,15 +169,7 @@ def main(): changed = False try: - # Only documented use is a single resource, but to also support experimental - # feature allowing multiple updates all params are converted to a vhba_template_list below. - - if module.params['vhba_template_list']: - # directly use the list (single resource and list are mutually exclusive - vhba_template_list = module.params['vhba_template_list'] - else: - # single resource specified, create list from the current params - vhba_template_list = [module.params] + vhba_template_list = [module.params] for vhba_template in vhba_template_list: mo_exists = False props_match = False diff --git a/plugins/modules/ucs_vlan_find.py b/plugins/modules/ucs_vlan_find.py index fb14223..6823a27 100644 --- a/plugins/modules/ucs_vlan_find.py +++ b/plugins/modules/ucs_vlan_find.py @@ -45,7 +45,6 @@ - David Soper (@dsoper2) - John McDonough (@movinalot) - CiscoUcs (@CiscoUcs) -version_added: '2.9' ''' EXAMPLES = r''' diff --git a/plugins/modules/ucs_vlan_to_group.py b/plugins/modules/ucs_vlan_to_group.py index 5efdabb..fb6f4fd 100644 --- a/plugins/modules/ucs_vlan_to_group.py +++ b/plugins/modules/ucs_vlan_to_group.py @@ -24,6 +24,7 @@ - If C(absent), will verify VLANs are absent and will delete if needed. choices: [present, absent] default: present + type: str vlanname: description: - The name assigned to the VLAN. @@ -31,6 +32,7 @@ - This name can be between 1 and 32 alphanumeric characters. - "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)." required: yes + type: str vlangroup: description: - The name assigned to the VLAN Group. @@ -38,11 +40,11 @@ - This name can be between 1 and 32 alphanumeric characters. - "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)." required: yes + type: str requirements: - ucsmsdk author: -- Derrick Johnson @derricktj -version_added: '2.10' +- Derrick Johnson (@derricktj) ''' EXAMPLES = r''' diff --git a/plugins/modules/ucs_vlans.py b/plugins/modules/ucs_vlans.py index 6f3a93e..ff97405 100644 --- a/plugins/modules/ucs_vlans.py +++ b/plugins/modules/ucs_vlans.py @@ -24,6 +24,7 @@ - If C(absent), will verify VLANs are absent and will delete if needed. choices: [present, absent] default: present + type: str name: description: - The name assigned to the VLAN. @@ -32,11 +33,12 @@ - "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)." - You cannot change this name after the VLAN is created. required: yes + type: str multicast_policy: description: - The multicast policy associated with this VLAN. - This option is only valid if the Sharing Type field is set to None or Primary. - default: '' + type: str fabric: description: - "The fabric configuration of the VLAN. This can be one of the following:" @@ -46,6 +48,7 @@ - For upstream disjoint L2 networks, Cisco recommends that you choose common to create VLANs that apply to both fabrics. choices: [common, A, B] default: common + type: str id: description: - The unique string identifier assigned to the VLAN. @@ -54,7 +57,7 @@ - The VLAN IDs you specify must also be supported on the switch that you are using. - VLANs in the LAN cloud and FCoE VLANs in the SAN cloud must have different IDs. - Optional if state is absent. - required: yes + type: str sharing: description: - The Sharing Type field. @@ -65,17 +68,18 @@ - "community - This VLAN can communicate with other ports on the same community VLAN as well as the promiscuous port. This VLAN is a Community VLAN." choices: [none, primary, isolated, community] default: none + type: str native: description: - Designates the VLAN as a native VLAN. choices: ['yes', 'no'] default: 'no' + type: str requirements: - ucsmsdk author: - David Soper (@dsoper2) - CiscoUcs (@CiscoUcs) -version_added: '2.5' ''' EXAMPLES = r''' @@ -109,7 +113,7 @@ def main(): argument_spec = ucs_argument_spec.copy() argument_spec.update( name=dict(type='str', required=True), - multicast_policy=dict(type='str', default=''), + multicast_policy=dict(type='str'), fabric=dict(type='str', default='common', choices=['common', 'A', 'B']), id=dict(type='str'), sharing=dict(type='str', default='none', choices=['none', 'primary', 'isolated', 'community']), diff --git a/plugins/modules/ucs_vnic_template.py b/plugins/modules/ucs_vnic_template.py index 50f4828..4b73c22 100644 --- a/plugins/modules/ucs_vnic_template.py +++ b/plugins/modules/ucs_vnic_template.py @@ -24,6 +24,7 @@ - If C(absent), will verify vNIC templates are absent and will delete if needed. choices: [present, absent] default: present + type: str name: description: - The name of the vNIC template. @@ -31,6 +32,7 @@ - "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)." - You cannot change this name after the template is created. required: yes + type: str description: description: - A user-defined description of the vNIC template. @@ -38,6 +40,7 @@ - "You can use any characters or spaces except the following:" - "` (accent mark), \ (backslash), ^ (carat), \" (double quote), = (equal sign), > (greater than), < (less than), or ' (single quote)." aliases: [ descr ] + type: str fabric: description: - The Fabric ID field specifying the fabric interconnect associated with vNICs created from this template. @@ -49,6 +52,7 @@ - "- If you plan to associate one or more vNICs created from this template to a server with an adapter that does not support fabric failover." choices: [A, B, A-B, B-A] default: A + type: str redundancy_type: description: - The Redundancy Type used for vNIC redundancy pairs during fabric failover. @@ -58,6 +62,7 @@ - "none - Legacy vNIC template behavior. Select this option if you do not want to use redundancy." choices: [none, primary, secondary] default: none + type: str peer_redundancy_template: description: - The Peer Redundancy Template. @@ -66,6 +71,7 @@ - If the redundancy_type is secondary, the name of the primary template should be provided. - Secondary templates can only configure non-shared properties (name, description, and mac_pool). aliases: [ peer_redundancy_templ ] + type: str target: description: - The possible target for vNICs created from this template. @@ -73,7 +79,9 @@ - "This can be one of the following:" - "adapter — The vNICs apply to all adapters. No VM-FEX port profile is created if you choose this option." - "vm - The vNICs apply to all virtual machines. A VM-FEX port profile is created if you choose this option." + choices: [adapter, vm] default: adapter + type: str template_type: description: - The Template Type field. @@ -82,21 +90,30 @@ - "updating-template - vNICs created from this template are updated if the template changes." choices: [initial-template, updating-template] default: initial-template + type: str vlans_list: description: - List of VLANs used by the vNIC template. - - "Each list element has the following suboptions:" - - "= name" - - " The name of the VLAN (required)." - - "- native" - - " Designates the VLAN as a native VLAN. Only one VLAN in the list can be a native VLAN." - - " [choices: 'no', 'yes']" - - " [Default: 'no']" - - "- state" - - " If present, will verify VLAN is present on template." - - " If absent, will verify VLAN is absent on template." - - " choices: [present, absent]" - - " default: present" + type: list + elements: dict + suboptions: + name: + description: + - The name of the VLAN (required if state is present). + type: str + native: + description: + - Designates the VLAN as a native VLAN. Only one VLAN in the list can be a native VLAN. + choices: ['no', 'yes'] + default: 'no' + type: str + state: + description: + - If present, will verify VLAN is present on template. + - If absent, will verify VLAN is absent on template. + choices: [present, absent] + default: present + type: str cdn_source: description: - CDN Source field. @@ -105,9 +122,11 @@ - "user-defined - Uses a user-defined CDN name for the vNIC template. If this option is chosen, cdn_name must also be provided." choices: [vnic-name, user-defined] default: vnic-name + type: str cdn_name: description: - CDN Name used when cdn_source is set to user-defined. + type: str mtu: description: - The MTU field. @@ -115,33 +134,38 @@ - Enter a string between '1500' and '9000'. - If the vNIC template has an associated QoS policy, the MTU specified here must be equal to or less than the MTU specified in the QoS system class. default: '1500' + type: str mac_pool: description: - The MAC address pool that vNICs created from this vNIC template should use. + type: str qos_policy: description: - The quality of service (QoS) policy that vNICs created from this vNIC template should use. + type: str network_control_policy: description: - The network control policy that vNICs created from this vNIC template should use. + type: str pin_group: description: - The LAN pin group that vNICs created from this vNIC template should use. + type: str stats_policy: description: - The statistics collection policy that vNICs created from this vNIC template should use. - default: default + type: str org_dn: description: - Org dn (distinguished name) default: org-root + type: str requirements: - ucsmsdk author: - David Soper (@dsoper2) - John McDonough (@movinalot) - CiscoUcs (@CiscoUcs) -version_added: '2.5' ''' EXAMPLES = r''' @@ -206,25 +230,30 @@ def main(): + vlans_list = dict( + name=dict(type='str'), + native=dict(type='str', default='no', choices=['no', 'yes']), + state=dict(type='str', default='present', choices=['present', 'absent']), + ) argument_spec = ucs_argument_spec.copy() argument_spec.update( org_dn=dict(type='str', default='org-root'), name=dict(type='str', required=True), - description=dict(type='str', aliases=['descr'], default=''), + description=dict(type='str', aliases=['descr']), fabric=dict(type='str', default='A', choices=['A', 'B', 'A-B', 'B-A']), redundancy_type=dict(type='str', default='none', choices=['none', 'primary', 'secondary']), - peer_redundancy_template=dict(type='str', aliases=['peer_redundancy_templ'], default=''), + peer_redundancy_template=dict(type='str', aliases=['peer_redundancy_templ']), target=dict(type='str', default='adapter', choices=['adapter', 'vm']), template_type=dict(type='str', default='initial-template', choices=['initial-template', 'updating-template']), - vlans_list=dict(type='list'), + vlans_list=dict(type='list', elements='dict', options=vlans_list), cdn_source=dict(type='str', default='vnic-name', choices=['vnic-name', 'user-defined']), - cdn_name=dict(type='str', default=''), + cdn_name=dict(type='str'), mtu=dict(type='str', default='1500'), - mac_pool=dict(type='str', default=''), - qos_policy=dict(type='str', default=''), - network_control_policy=dict(type='str', default=''), - pin_group=dict(type='str', default=''), - stats_policy=dict(type='str', default='default'), + mac_pool=dict(type='str'), + qos_policy=dict(type='str'), + network_control_policy=dict(type='str'), + pin_group=dict(type='str'), + stats_policy=dict(type='str'), state=dict(type='str', default='present', choices=['present', 'absent']), ) diff --git a/plugins/modules/ucs_vsans.py b/plugins/modules/ucs_vsans.py index 9bc1878..f642dba 100644 --- a/plugins/modules/ucs_vsans.py +++ b/plugins/modules/ucs_vsans.py @@ -24,6 +24,7 @@ - If C(absent), will verify VSANs are absent and will delete if needed. choices: [present, absent] default: present + type: str name: description: - The name assigned to the VSAN. @@ -31,19 +32,20 @@ - "You cannot use spaces or any special characters other than - (hyphen), \"_\" (underscore), : (colon), and . (period)." - You cannot change this name after the VSAN is created. required: yes + type: str vsan_id: description: - The unique identifier assigned to the VSAN. - The ID can be a string between '1' and '4078', or between '4080' and '4093'. '4079' is a reserved VSAN ID. - In addition, if you plan to use FC end-host mode, the range between '3840' to '4079' is also a reserved VSAN ID range. - Optional if state is absent. - required: yes + type: str vlan_id: description: - The unique string identifier assigned to the VLAN used for Fibre Channel connections. - Note that Cisco UCS Manager uses VLAN '4048'. See the UCS Manager configuration guide if you want to assign '4048' to a VLAN. - Optional if state is absent. - required: yes + type: str fc_zoning: description: - Fibre Channel zoning configuration for the Cisco UCS domain. @@ -53,6 +55,7 @@ - If you enable Fibre Channel zoning, do not configure the upstream switch with any VSANs that are being used for Fibre Channel zoning. choices: [disabled, enabled] default: disabled + type: str fabric: description: - "The fabric configuration of the VSAN. This can be one of the following:" @@ -61,13 +64,13 @@ - "B - The VSAN maps to the a VSAN ID that exists only in fabric B." choices: [common, A, B] default: common + type: str requirements: - ucsmsdk author: - David Soper (@dsoper2) - John McDonough (@movinalot) - CiscoUcs (@CiscoUcs) -version_added: '2.5' ''' EXAMPLES = r''' @@ -101,28 +104,17 @@ def main(): argument_spec = ucs_argument_spec.copy() argument_spec.update( - name=dict(type='str'), + name=dict(type='str', required=True), vsan_id=dict(type='str'), vlan_id=dict(type='str'), fc_zoning=dict(type='str', default='disabled', choices=['disabled', 'enabled']), fabric=dict(type='str', default='common', choices=['common', 'A', 'B']), state=dict(type='str', default='present', choices=['present', 'absent']), - vsan_list=dict(type='list'), ) - # Note that use of vsan_list is an experimental feature which allows multiple resource updates with a single UCSM connection. - # Support for vsan_list may change or be removed once persistent UCS connections are supported. - # Either vsan_list or name/vsan_id/vlan_id is required (user can specify either a list or single resource). - module = AnsibleModule( argument_spec, supports_check_mode=True, - required_one_of=[ - ['vsan_list', 'name'] - ], - mutually_exclusive=[ - ['vsan_list', 'name'] - ], ) ucs = UCSModule(module) @@ -132,15 +124,8 @@ def main(): changed = False try: - # Only documented use is a single resource, but to also support experimental - # feature allowing multiple updates all params are converted to a vsan_list below. - - if module.params['vsan_list']: - # directly use the list (single resource and list are mutually exclusive - vsan_list = module.params['vsan_list'] - else: - # single resource specified, create list from the current params - vsan_list = [module.params] + # single resource specified, create list from the current params + vsan_list = [module.params] for vsan in vsan_list: mo_exists = False props_match = False diff --git a/plugins/modules/ucs_wwn_pool.py b/plugins/modules/ucs_wwn_pool.py index 4a1a3b3..d14f611 100644 --- a/plugins/modules/ucs_wwn_pool.py +++ b/plugins/modules/ucs_wwn_pool.py @@ -38,7 +38,6 @@ - Specify whether this is a node (WWNN) or port (WWPN) pool. - Optional if state is absent. choices: [node, port] - required: yes type: str description: description: @@ -81,7 +80,6 @@ - David Soper (@dsoper2) - John McDonough (@movinalot) - CiscoUcs (@CiscoUcs) -version_added: '2.5' ''' EXAMPLES = r''' @@ -131,29 +129,18 @@ def main(): argument_spec = ucs_argument_spec.copy() argument_spec.update( org_dn=dict(type='str', default='org-root'), - name=dict(type='str'), + name=dict(type='str', required=True), purpose=dict(type='str', choices=['node', 'port']), - descr=dict(type='str'), + description=dict(type='str', aliases=['descr']), order=dict(type='str', default='default', choices=['default', 'sequential']), first_addr=dict(type='str'), last_addr=dict(type='str'), state=dict(type='str', default='present', choices=['present', 'absent']), - wwn_list=dict(type='list'), ) - # Note that use of wwn_list is an experimental feature which allows multiple resource updates with a single UCSM connection. - # Support for wwn_list may change or be removed once persistent UCS connections are supported. - # Either wwn_list or name is required (user can specify either a list or single resource). - module = AnsibleModule( argument_spec, supports_check_mode=True, - required_one_of=[ - ['wwn_list', 'name'] - ], - mutually_exclusive=[ - ['wwn_list', 'name'] - ], ) ucs = UCSModule(module) @@ -164,15 +151,8 @@ def main(): changed = False try: - # Only documented use is a single resource, but to also support experimental - # feature allowing multiple updates all params are converted to a wwn_list below. - - if module.params['wwn_list']: - # directly use the list (single resource and list are mutually exclusive - wwn_list = module.params['wwn_list'] - else: - # single resource specified, create list from the current params - wwn_list = [module.params] + # single resource specified, create list from the current params + wwn_list = [module.params] for wwn in wwn_list: mo_exists = False props_match = False diff --git a/releases/cisco-ucs-1.11.0.tar.gz b/releases/cisco-ucs-1.11.0.tar.gz new file mode 100644 index 0000000..d624ae8 Binary files /dev/null and b/releases/cisco-ucs-1.11.0.tar.gz differ diff --git a/tests/config.yml b/tests/config.yml new file mode 100644 index 0000000..d90b5ef --- /dev/null +++ b/tests/config.yml @@ -0,0 +1,40 @@ +--- +# Intersight collection ansible-test configuration file. +# Support for this feature was first added in ansible-core 2.12. + +modules: + # Configuration for modules/module_utils. + # These settings do not apply to other content in the collection. + + python_requires: '>=3.7' + # Python versions supported by modules/module_utils. + # This setting is required. + # + # Possible values: + # + # - 'default' - All Python versions supported by Ansible. + # This is the default value if no configuration is provided. + # - 'controller' - All Python versions supported by the Ansible controller. + # This indicates the modules/module_utils can only run on the controller. + # Intended for use only with modules/module_utils that depend on ansible-connection, which only runs on the controller. + # Unit tests for modules/module_utils will be permitted to import any Ansible code, instead of only module_utils. + # - SpecifierSet - A PEP 440 specifier set indicating the supported Python versions. + # This is only needed when modules/module_utils do not support all Python versions supported by Ansible. + # It is not necessary to exclude versions which Ansible does not support, as this will be done automatically. + # + # What does this affect? + # + # - Unit tests will be skipped on any unsupported Python version. + # - Sanity tests that are Python version specific will be skipped on any unsupported Python version that is not supported by the controller. + # + # Sanity tests that are Python version specific will always be executed for Python versions supported by the controller, regardless of this setting. + # Reasons for this restriction include, but are not limited to: + # + # - AnsiballZ must be able to AST parse modules/module_utils on the controller, even though they may execute on a managed node. + # - ansible-doc must be able to AST parse modules/module_utils on the controller to display documentation. + # - ansible-test must be able to AST parse modules/module_utils to perform static analysis on them. + # - ansible-test must be able to execute portions of modules/module_utils to validate their argument specs. + # + # These settings only apply to modules/module_utils. + # It is not possible to declare supported Python versions for controller-only code. + # All Python versions supported by the controller must be supported by controller-only code.