Skip to content

IMC Access policy should allow you to create a single policy that supports both in-band and out-of-band as GUI/REST API does #177

@asharma1304

Description

@asharma1304

Background: IMC Access Policy - ansible module for this policy allows you to create a policy using inband or out-of-band BUT not both.

Requested Fix: IMC Access policy allows you to define both so should the ansible module.

WORKS: IN-BAND ONLY

- name: Configure IMC Access Policy - InBand
      cisco.intersight.intersight_imc_access_policy:
        <<: *api_info
        name: "{{ name_of_imc_access_policy }}"
        description: "{{ description_of_imc_access_policy }}"
        organization: "{{ org_name }}"
        tags: [{Key: "Provisioned by:", Value: "Intersight-Ansible"},{Key: "Project:", Value: "{{ prefix }}"}]
        out_of_band: false
        vlan_id: "{{ ib_vlan_for_cimc_access }}"
        ip_pool: "{{ ib_management_ip_pool.api_response.Name }}"
        state: present
      register: ib_imc_access_policy

WORKS: OOB ONLY

- name: Configure IMC Access Policy - Out-of-Band
  cisco.intersight.intersight_imc_access_policy:
    <<: *api_info
    name: "{{ name_of_imc_access_policy }}"
    description: "{{ description_of_imc_access_policy }}"
    organization: "{{ org_name }}"
    tags: [{Key: "Provisioned by:", Value: "Intersight-Ansible"},{Key: "Project:", Value: "{{ prefix }}"}]
    out_of_band: true
    ip_pool: "{{ oob_management_ip_pool.api_response.Name }}"
    state: present
  register: oob_imc_access_policy

WORKS: InBand and Out-of-band both work using REST API (or from GUI)

    - name: Configure IMC Access Policy (REST API)
      cisco.intersight.intersight_rest_api:
        <<: *api_info
        resource_path: /access/Policies
        query_params:
          $filter: "Name eq '{{ name_of_imc_access_policy }}'"
        api_body: {
            "Name": "{{ name_of_imc_access_policy }}",
            "Description": "{{ description_of_imc_access_policy }}",
            "InbandVlan": "{{ ib_vlan_for_cimc_access }}",
            "InbandIpPool": "{{ ib_management_ip_pool.api_response.Moid }}",
            "AddressType": {
              "EnableIpV4": true,
              "EnableIpV6": false
              },
            "OutOfBandIpPool": "{{ oob_management_ip_pool.api_response.Moid }}",
            "ConfigurationType": {
              "ConfigureInband": true,
              "ConfigureOutOfBand": true
              },
            "Organization": {
              "Moid": "{{ intersight_org.api_response.Moid }}"
            },
            Tags: [{Key: "Provisioned by:", Value: "Intersight-Ansible"},{Key: "Project:", Value: "{{ prefix }}"}]
          }
        state: present
      register: imc_access_policy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions