Skip to content

Commit

Permalink
Final review pending
Browse files Browse the repository at this point in the history
  • Loading branch information
shrsr committed Jun 27, 2020
1 parent 28aa90d commit e1a8959
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion plugins/modules/mso_tenant_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def main():
sites = [(s.get('siteId')) for s in mso.query_objs('tenants')[tenant_idx]['siteAssociations']]

if site_id not in sites:
mso.existing = {}
pass
else:
site_idx = sites.index((site_id))
mso.existing = mso.query_objs('tenants')[tenant_idx]['siteAssociations'][site_idx]
Expand Down
70 changes: 35 additions & 35 deletions tests/integration/targets/mso_tenant_site/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
state: absent
loop:
- '{{ mso_site | default("ansible_test") }}'
- '{{ mso_site | default("aws_ansible_test") }}'
- '{{ mso_site | default("azure_ansible_test") }}'
- 'aws_{{ mso_site | default("ansible_test") }}'
- 'azure_{{ mso_site | default("ansible_test") }}'
ignore_errors: true

- name: Remove tenant ansible_test
Expand All @@ -66,7 +66,7 @@
- name: Ensure azure site exists
mso_site:
<<: *mso_info
site: '{{ mso_site | default("azure_ansible_test") }}'
site: 'azure_{{ mso_site | default("ansible_test") }}'
apic_username: '{{ azure_apic_username }}'
apic_password: '{{ azure_apic_password }}'
apic_site_id: '{{ azure_site_id }}'
Expand All @@ -77,7 +77,7 @@
- name: Ensure aws site exists
mso_site:
<<: *mso_info
site: '{{ mso_site | default("aws_ansible_test") }}'
site: 'aws_{{ mso_site | default("ansible_test") }}'
apic_username: '{{ aws_apic_username }}'
apic_password: '{{ aws_apic_password }}'
apic_site_id: '{{ aws_site_id }}'
Expand All @@ -97,7 +97,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: ansible_test
site: '{{ mso_site | default("ansible_test") }}'
state: present
check_mode: yes
register: ncs_cm
Expand All @@ -111,7 +111,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: ansible_test
site: '{{ mso_site | default("ansible_test") }}'
state: present
register: ncs_nm

Expand All @@ -124,7 +124,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: ansible_test
site: '{{ mso_site | default("ansible_test") }}'
state: present
register: ncs_nm_again

Expand All @@ -137,7 +137,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("aws_ansible_test") }}'
site: 'aws_{{ mso_site | default("ansible_test") }}'
cloud_account: "000000000000"
aws_trusted: false
aws_access_key: "1"
Expand All @@ -159,7 +159,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("aws_ansible_test") }}'
site: 'aws_{{ mso_site | default("ansible_test") }}'
cloud_account: "000000000000"
aws_trusted: false
aws_access_key: "1"
Expand All @@ -180,7 +180,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("aws_ansible_test") }}'
site: 'aws_{{ mso_site | default("ansible_test") }}'
cloud_account: "000000000000"
aws_trusted: false
aws_access_key: "1"
Expand All @@ -197,7 +197,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("aws_ansible_test") }}'
site: 'aws_{{ mso_site | default("ansible_test") }}'
cloud_account: "000000000000"
aws_trusted: false
secret_key: "0"
Expand All @@ -214,7 +214,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("aws_ansible_test") }}'
site: 'aws_{{ mso_site | default("ansible_test") }}'
cloud_account: "000000000000"
aws_trusted: false
aws_access_key: "1"
Expand All @@ -231,7 +231,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("aws_ansible_test") }}'
site: 'aws_{{ mso_site | default("ansible_test") }}'
aws_account_org: true
cloud_account: "000000000000"
secret_key: "0"
Expand All @@ -249,7 +249,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("azure_ansible_test") }}'
site: 'azure_{{ mso_site | default("ansible_test") }}'
cloud_account: uni/tn-ansible_test/act-[100]-vendor-azure
state: present
register: aazure_shared_nm
Expand All @@ -263,7 +263,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("azure_ansible_test") }}'
site: 'azure_{{ mso_site | default("ansible_test") }}'
cloud_account: uni/tn-ansible_test/act-[100]-vendor-azure
azure_access_type: shared
state: present
Expand All @@ -278,7 +278,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("azure_ansible_test") }}'
site: 'azure_{{ mso_site | default("ansible_test") }}'
azure_subscription_id: "9"
cloud_account: uni/tn-ansible_test/act-[9]-vendor-azure
azure_access_type: managed
Expand All @@ -295,7 +295,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("azure_ansible_test") }}'
site: 'azure_{{ mso_site | default("ansible_test") }}'
azure_application_id: "100"
cloud_account: uni/tn-ansible_test/act-[9]-vendor-azure
azure_access_type: managed
Expand All @@ -312,7 +312,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("azure_ansible_test") }}'
site: 'azure_{{ mso_site | default("ansible_test") }}'
azure_subscription_id: "9"
azure_application_id: "100"
cloud_account: uni/tn-ansible_test/act-[9]-vendor-azure
Expand All @@ -335,7 +335,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("azure_ansible_test") }}'
site: 'azure_{{ mso_site | default("ansible_test") }}'
azure_application_id: "100"
azure_credential_name: cApicApp
secret_key: iins
Expand All @@ -356,7 +356,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("azure_ansible_test") }}'
site: 'azure_{{ mso_site | default("ansible_test") }}'
azure_subscription_id: "9"
azure_credential_name: cApicApp
secret_key: iins
Expand All @@ -377,7 +377,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("azure_ansible_test") }}'
site: 'azure_{{ mso_site | default("ansible_test") }}'
azure_subscription_id: "9"
azure_credential_name: cApicApp
azure_active_directory_id: "32"
Expand All @@ -398,7 +398,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("azure_ansible_test") }}'
site: 'azure_{{ mso_site | default("ansible_test") }}'
azure_subscription_id: "9"
azure_credential_name: cApicApp
azure_active_directory_name: CiscoINSBUAd
Expand All @@ -419,7 +419,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("azure_ansible_test") }}'
site: 'azure_{{ mso_site | default("ansible_test") }}'
azure_subscription_id: "9"
azure_credential_name: cApicApp
secret_key: iins
Expand All @@ -440,7 +440,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("azure_ansible_test") }}'
site: 'azure_{{ mso_site | default("ansible_test") }}'
azure_subscription_id: "9"
secret_key: iins
azure_active_directory_name: CiscoINSBUAd
Expand All @@ -461,7 +461,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("azure_ansible_test") }}'
site: 'azure_{{ mso_site | default("ansible_test") }}'
azure_subscription_id: "9"
azure_application_id: "100"
azure_credential_name: cApicApp
Expand Down Expand Up @@ -490,7 +490,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("azure_ansible_test") }}'
site: 'azure_{{ mso_site | default("ansible_test") }}'
azure_subscription_id: "9"
azure_application_id: "100"
azure_credential_name: cApicApp
Expand All @@ -511,7 +511,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: ansible_test
site: '{{ mso_site | default("ansible_test") }}'
state: query
register: anc_query

Expand All @@ -524,7 +524,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("azure_ansible_test") }}'
site: 'azure_{{ mso_site | default("ansible_test") }}'
azure_subscription_id: "9"
azure_application_id: "100"
azure_credential_name: cApicApp
Expand All @@ -545,7 +545,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("aws_ansible_test") }}'
site: 'aws_{{ mso_site | default("ansible_test") }}'
state: query
register: aaws_query

Expand All @@ -570,7 +570,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: ansible_test
site: '{{ mso_site | default("ansible_test") }}'
state: absent
register: dnc

Expand All @@ -583,7 +583,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: ansible_test
site: '{{ mso_site | default("ansible_test") }}'
state: query
ignore_errors: true
register: dnc_query
Expand All @@ -597,7 +597,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("azure_ansible_test") }}'
site: 'azure_{{ mso_site | default("ansible_test") }}'
state: absent
register: dazure

Expand All @@ -610,7 +610,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("azure_ansible_test") }}'
site: 'azure_{{ mso_site | default("ansible_test") }}'
state: query
ignore_errors: true
register: dazure_query
Expand All @@ -624,7 +624,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("aws_ansible_test") }}'
site: 'aws_{{ mso_site | default("ansible_test") }}'
state: absent
register: daaws

Expand All @@ -637,7 +637,7 @@
mso_tenant_site:
<<: *mso_info
tenant: ansible_test
site: '{{ mso_site | default("aws_ansible_test") }}'
site: 'aws_{{ mso_site | default("ansible_test") }}'
state: query
ignore_errors: true
register: daaws_query
Expand Down

0 comments on commit e1a8959

Please sign in to comment.