summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorAnsible Core Team <info@ansible.com>2020-03-09 10:40:35 +0100
committerMatt Martz <matt@sivel.net>2020-03-23 17:14:21 +0100
commitae8fb5e371f4ced37237176bc28a6a5c998f319d (patch)
tree0dd2d950fd7aa778fd90dd36b77effafe23a9dc9 /test/integration
parentMigrated to cisco.meraki (diff)
downloadansible-ae8fb5e371f4ced37237176bc28a6a5c998f319d.tar.xz
ansible-ae8fb5e371f4ced37237176bc28a6a5c998f319d.zip
Migrated to cisco.mso
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/targets/mso_label/aliases2
-rw-r--r--test/integration/targets/mso_label/tasks/main.yml283
-rw-r--r--test/integration/targets/mso_role/aliases2
-rw-r--r--test/integration/targets/mso_role/tasks/main.yml289
-rw-r--r--test/integration/targets/mso_site/aliases2
-rw-r--r--test/integration/targets/mso_site/tasks/main.yml283
-rw-r--r--test/integration/targets/mso_tenant/aliases2
-rw-r--r--test/integration/targets/mso_tenant/tasks/main.yml289
-rw-r--r--test/integration/targets/mso_user/aliases2
-rw-r--r--test/integration/targets/mso_user/tasks/main.yml292
10 files changed, 0 insertions, 1446 deletions
diff --git a/test/integration/targets/mso_label/aliases b/test/integration/targets/mso_label/aliases
deleted file mode 100644
index cd28d3c362..0000000000
--- a/test/integration/targets/mso_label/aliases
+++ /dev/null
@@ -1,2 +0,0 @@
-# No ACI MultiSite infrastructure, so not enabled
-unsupported
diff --git a/test/integration/targets/mso_label/tasks/main.yml b/test/integration/targets/mso_label/tasks/main.yml
deleted file mode 100644
index 9246ce1fba..0000000000
--- a/test/integration/targets/mso_label/tasks/main.yml
+++ /dev/null
@@ -1,283 +0,0 @@
-# Test code for the MSO modules
-# Copyright: (c) 2018, Dag Wieers (@dagwieers) <dag@wieers.com>
-
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
-
-- name: Test that we have an ACI MultiSite host, username and password
- fail:
- msg: 'Please define the following variables: mso_hostname, mso_username and mso_password.'
- when: mso_hostname is not defined or mso_username is not defined or mso_password is not defined
-
-
-# CLEAN ENVIRONMENT
-- name: Remove label ansible_test2
- mso_label: &label_absent
- host: '{{ mso_hostname }}'
- username: '{{ mso_username }}'
- password: '{{ mso_password }}'
- validate_certs: '{{ mso_validate_certs | default(false) }}'
- use_ssl: '{{ mso_use_ssl | default(true) }}'
- use_proxy: '{{ mso_use_proxy | default(true) }}'
- output_level: '{{ mso_output_level | default("info") }}'
- label: ansible_test2
- state: absent
-
-- name: Remove label ansible_test
- mso_label:
- <<: *label_absent
- label: ansible_test
- register: cm_remove_label
-
-
-# ADD LABEL
-- name: Add label (check_mode)
- mso_label: &label_present
- host: '{{ mso_hostname }}'
- username: '{{ mso_username }}'
- password: '{{ mso_password }}'
- validate_certs: '{{ mso_validate_certs | default(false) }}'
- use_ssl: '{{ mso_use_ssl | default(true) }}'
- use_proxy: '{{ mso_use_proxy | default(true) }}'
- output_level: '{{ mso_output_level | default("info") }}'
- label: ansible_test
- state: present
- check_mode: yes
- register: cm_add_label
-
-- name: Verify cm_add_label
- assert:
- that:
- - cm_add_label is changed
- - cm_add_label.previous == {}
- - cm_add_label.current.displayName == 'ansible_test'
- - cm_add_label.current.id is not defined
- - cm_add_label.current.type == 'site'
-
-- name: Add label (normal mode)
- mso_label: *label_present
- register: nm_add_label
-
-- name: nm_Verify add_label
- assert:
- that:
- - nm_add_label is changed
- - nm_add_label.previous == {}
- - nm_add_label.current.displayName == 'ansible_test'
- - nm_add_label.current.id is defined
- - nm_add_label.current.type == 'site'
-
-- name: Add label again (check_mode)
- mso_label: *label_present
- check_mode: yes
- register: cm_add_label_again
-
-- name: Verify cm_add_label_again
- assert:
- that:
- - cm_add_label_again is not changed
- - cm_add_label_again.previous.displayName == 'ansible_test'
- - cm_add_label_again.previous.type == 'site'
- - cm_add_label_again.current.displayName == 'ansible_test'
- - cm_add_label_again.current.id == nm_add_label.current.id
- - cm_add_label_again.current.type == 'site'
-
-- name: Add label again (normal mode)
- mso_label: *label_present
- register: nm_add_label_again
-
-- name: Verify nm_add_label_again
- assert:
- that:
- - nm_add_label_again is not changed
- - nm_add_label_again.previous.displayName == 'ansible_test'
- - nm_add_label_again.previous.type == 'site'
- - nm_add_label_again.current.displayName == 'ansible_test'
- - nm_add_label_again.current.id == nm_add_label.current.id
- - nm_add_label_again.current.type == 'site'
-
-
-# CHANGE LABEL
-- name: Change label (check_mode)
- mso_label:
- <<: *label_present
- label_id: '{{ nm_add_label.current.id }}'
- label: ansible_test2
- check_mode: yes
- register: cm_change_label
-
-- name: Verify cm_change_label
- assert:
- that:
- - cm_change_label is changed
- - cm_change_label.current.displayName == 'ansible_test2'
- - cm_change_label.current.id == nm_add_label.current.id
- - cm_change_label.current.type == 'site'
-
-- name: Change label (normal mode)
- mso_label:
- <<: *label_present
- label_id: '{{ nm_add_label.current.id }}'
- label: ansible_test2
- output_level: debug
- register: nm_change_label
-
-- name: Verify nm_change_label
- assert:
- that:
- - nm_change_label is changed
- - cm_change_label.current.displayName == 'ansible_test2'
- - nm_change_label.current.id == nm_add_label.current.id
- - nm_change_label.current.type == 'site'
-
-- name: Change label again (check_mode)
- mso_label:
- <<: *label_present
- label_id: '{{ nm_add_label.current.id }}'
- label: ansible_test2
- check_mode: yes
- register: cm_change_label_again
-
-- name: Verify cm_change_label_again
- assert:
- that:
- - cm_change_label_again is not changed
- - cm_change_label_again.current.displayName == 'ansible_test2'
- - cm_change_label_again.current.id == nm_add_label.current.id
- - cm_change_label_again.current.type == 'site'
-
-- name: Change label again (normal mode)
- mso_label:
- <<: *label_present
- label_id: '{{ nm_add_label.current.id }}'
- label: ansible_test2
- register: nm_change_label_again
-
-- name: Verify nm_change_label_again
- assert:
- that:
- - nm_change_label_again is not changed
- - nm_change_label_again.current.displayName == 'ansible_test2'
- - nm_change_label_again.current.id == nm_add_label.current.id
- - nm_change_label_again.current.type == 'site'
-
-
-# QUERY ALL LABELS
-- name: Query all labels (check_mode)
- mso_label: &label_query
- host: '{{ mso_hostname }}'
- username: '{{ mso_username }}'
- password: '{{ mso_password }}'
- validate_certs: '{{ mso_validate_certs | default(false) }}'
- use_ssl: '{{ mso_use_ssl | default(true) }}'
- use_proxy: '{{ mso_use_proxy | default(true) }}'
- output_level: '{{ mso_output_level | default("info") }}'
- state: query
- check_mode: yes
- register: cm_query_all_labels
-
-- name: Query all labels (normal mode)
- mso_label: *label_query
- register: nm_query_all_labels
-
-- name: Verify query_all_labels
- assert:
- that:
- - cm_query_all_labels is not changed
- - nm_query_all_labels is not changed
- # NOTE: Order of labels is not stable between calls
- #- cm_query_all_labels == nm_query_all_labels
-
-
-# QUERY A LABEL
-- name: Query our label
- mso_label:
- <<: *label_query
- label: ansible_test2
- check_mode: yes
- register: cm_query_label
-
-- name: Query our label
- mso_label:
- <<: *label_query
- label: ansible_test2
- register: nm_query_label
-
-- name: Verify query_label
- assert:
- that:
- - cm_query_label is not changed
- - cm_query_label.current.displayName == 'ansible_test2'
- - cm_query_label.current.id == nm_add_label.current.id
- - cm_query_label.current.type == 'site'
- - nm_query_label is not changed
- - nm_query_label.current.displayName == 'ansible_test2'
- - nm_query_label.current.id == nm_add_label.current.id
- - nm_query_label.current.type == 'site'
- - cm_query_label == nm_query_label
-
-
-# REMOVE LABEL
-- name: Remove label (check_mode)
- mso_label: *label_absent
- check_mode: yes
- register: cm_remove_label
-
-- name: Verify cm_remove_label
- assert:
- that:
- - cm_remove_label is changed
- - cm_remove_label.current == {}
-
-- name: Remove label (normal mode)
- mso_label: *label_absent
- register: nm_remove_label
-
-- name: Verify nm_remove_label
- assert:
- that:
- - nm_remove_label is changed
- - nm_remove_label.current == {}
-
-- name: Remove label again (check_mode)
- mso_label: *label_absent
- check_mode: yes
- register: cm_remove_label_again
-
-- name: Verify cm_remove_label_again
- assert:
- that:
- - cm_remove_label_again is not changed
- - cm_remove_label_again.current == {}
-
-- name: Remove label again (normal mode)
- mso_label: *label_absent
- register: nm_remove_label_again
-
-- name: Verify nm_remove_label_again
- assert:
- that:
- - nm_remove_label_again is not changed
- - nm_remove_label_again.current == {}
-
-
-# QUERY NON-EXISTING LABEL
-- name: Query non-existing label (check_mode)
- mso_label:
- <<: *label_query
- label: ansible_test
- check_mode: yes
- register: cm_query_non_label
-
-- name: Query non-existing label (normal mode)
- mso_label:
- <<: *label_query
- label: ansible_test
- register: nm_query_non_label
-
-# TODO: Implement more tests
-- name: Verify query_non_label
- assert:
- that:
- - cm_query_non_label is not changed
- - nm_query_non_label is not changed
- - cm_query_non_label == nm_query_non_label
diff --git a/test/integration/targets/mso_role/aliases b/test/integration/targets/mso_role/aliases
deleted file mode 100644
index cd28d3c362..0000000000
--- a/test/integration/targets/mso_role/aliases
+++ /dev/null
@@ -1,2 +0,0 @@
-# No ACI MultiSite infrastructure, so not enabled
-unsupported
diff --git a/test/integration/targets/mso_role/tasks/main.yml b/test/integration/targets/mso_role/tasks/main.yml
deleted file mode 100644
index 6f4ed2b0bd..0000000000
--- a/test/integration/targets/mso_role/tasks/main.yml
+++ /dev/null
@@ -1,289 +0,0 @@
-# Test code for the MSO modules
-# Copyright: (c) 2018, Dag Wieers (@dagwieers) <dag@wieers.com>
-
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
-
-- name: Test that we have an ACI MultiSite host, username and password
- fail:
- msg: 'Please define the following variables: mso_hostname, mso_username and mso_password.'
- when: mso_hostname is not defined or mso_username is not defined or mso_password is not defined
-
-
-# CLEAN ENVIRONMENT
-- name: Remove role ansible_test2
- mso_role: &role_absent
- host: '{{ mso_hostname }}'
- username: '{{ mso_username }}'
- password: '{{ mso_password }}'
- validate_certs: '{{ mso_validate_certs | default(false) }}'
- use_ssl: '{{ mso_use_ssl | default(true) }}'
- use_proxy: '{{ mso_use_proxy | default(true) }}'
- output_level: '{{ mso_output_level | default("info") }}'
- role: ansible_test2
- state: absent
-
-- name: Remove role ansible_test
- mso_role:
- <<: *role_absent
- role: ansible_test
- register: cm_remove_role
-
-
-# ADD ROLE
-- name: Add role (check_mode)
- mso_role: &role_present
- host: '{{ mso_hostname }}'
- username: '{{ mso_username }}'
- password: '{{ mso_password }}'
- validate_certs: '{{ mso_validate_certs | default(false) }}'
- use_ssl: '{{ mso_use_ssl | default(true) }}'
- use_proxy: '{{ mso_use_proxy | default(true) }}'
- output_level: '{{ mso_output_level | default("info") }}'
- role: ansible_test
- description: Ansible test role
- permissions: view-sites
- state: present
- check_mode: yes
- register: cm_add_role
-
-- name: Verify cm_add_role
- assert:
- that:
- - cm_add_role is changed
- - cm_add_role.previous == {}
- - cm_add_role.current.description == 'Ansible test role'
- - cm_add_role.current.displayName == 'ansible_test'
- - cm_add_role.current.id is not defined
-
-- name: Add role (normal mode)
- mso_role: *role_present
- register: nm_add_role
-
-- name: nm_Verify add_role
- assert:
- that:
- - nm_add_role is changed
- - nm_add_role.previous == {}
- - nm_add_role.current.description == 'Ansible test role'
- - nm_add_role.current.displayName == 'ansible_test'
- - nm_add_role.current.id is defined
-
-- name: Add role again (check_mode)
- mso_role: *role_present
- check_mode: yes
- register: cm_add_role_again
-
-- name: Verify cm_add_role_again
- assert:
- that:
- - cm_add_role_again is not changed
- - cm_add_role_again.previous.description == 'Ansible test role'
- - cm_add_role_again.previous.displayName == 'ansible_test'
- - cm_add_role_again.current.description == 'Ansible test role'
- - cm_add_role_again.current.displayName == 'ansible_test'
- - cm_add_role_again.current.id == nm_add_role.current.id
-
-- name: Add role again (normal mode)
- mso_role: *role_present
- register: nm_add_role_again
-
-- name: Verify nm_add_role_again
- assert:
- that:
- - nm_add_role_again is not changed
- - nm_add_role_again.previous.description == 'Ansible test role'
- - nm_add_role_again.previous.displayName == 'ansible_test'
- - nm_add_role_again.current.description == 'Ansible test role'
- - nm_add_role_again.current.displayName == 'ansible_test'
- - nm_add_role_again.current.id == nm_add_role.current.id
-
-
-# CHANGE ROLE
-- name: Change role (check_mode)
- mso_role:
- <<: *role_present
- role_id: '{{ nm_add_role.current.id }}'
- role: ansible_test2
- description: Ansible test role 2
- check_mode: yes
- register: cm_change_role
-
-- name: Verify cm_change_role
- assert:
- that:
- - cm_change_role is changed
- - cm_change_role.current.description == 'Ansible test role 2'
- - cm_change_role.current.displayName == 'ansible_test2'
- - cm_change_role.current.id == nm_add_role.current.id
-
-- name: Change role (normal mode)
- mso_role:
- <<: *role_present
- role_id: '{{ nm_add_role.current.id }}'
- role: ansible_test2
- description: Ansible test role 2
- output_level: debug
- register: nm_change_role
-
-- name: Verify nm_change_role
- assert:
- that:
- - nm_change_role is changed
- - nm_change_role.current.description == 'Ansible test role 2'
- - nm_change_role.current.displayName == 'ansible_test2'
- - nm_change_role.current.id == nm_add_role.current.id
-
-- name: Change role again (check_mode)
- mso_role:
- <<: *role_present
- role_id: '{{ nm_add_role.current.id }}'
- role: ansible_test2
- description: Ansible test role 2
- check_mode: yes
- register: cm_change_role_again
-
-- name: Verify cm_change_role_again
- assert:
- that:
- - cm_change_role_again is not changed
- - cm_change_role_again.current.description == 'Ansible test role 2'
- - cm_change_role_again.current.displayName == 'ansible_test2'
- - cm_change_role_again.current.id == nm_add_role.current.id
-
-- name: Change role again (normal mode)
- mso_role:
- <<: *role_present
- role_id: '{{ nm_add_role.current.id }}'
- role: ansible_test2
- description: Ansible test role 2
- register: nm_change_role_again
-
-- name: Verify nm_change_role_again
- assert:
- that:
- - nm_change_role_again is not changed
- - nm_change_role_again.current.description == 'Ansible test role 2'
- - nm_change_role_again.current.displayName == 'ansible_test2'
- - nm_change_role_again.current.id == nm_add_role.current.id
-
-
-# QUERY ALL ROLES
-- name: Query all roles (check_mode)
- mso_role: &role_query
- host: '{{ mso_hostname }}'
- username: '{{ mso_username }}'
- password: '{{ mso_password }}'
- validate_certs: '{{ mso_validate_certs | default(false) }}'
- use_ssl: '{{ mso_use_ssl | default(true) }}'
- use_proxy: '{{ mso_use_proxy | default(true) }}'
- output_level: '{{ mso_output_level | default("info") }}'
- state: query
- check_mode: yes
- register: cm_query_all_roles
-
-- name: Query all roles (normal mode)
- mso_role: *role_query
- register: nm_query_all_roles
-
-- name: Verify query_all_roles
- assert:
- that:
- - cm_query_all_roles is not changed
- - nm_query_all_roles is not changed
- # NOTE: Order of roles is not stable between calls
- #- cm_query_all_roles == nm_query_all_roles
-
-
-# QUERY A ROLE
-- name: Query our role
- mso_role:
- <<: *role_query
- role: ansible_test2
- check_mode: yes
- register: cm_query_role
-
-- name: Query our role
- mso_role:
- <<: *role_query
- role: ansible_test2
- register: nm_query_role
-
-- name: Verify query_role
- assert:
- that:
- - cm_query_role is not changed
- - cm_query_role.current.description == 'Ansible test role 2'
- - cm_query_role.current.displayName == 'ansible_test2'
- - cm_query_role.current.id == nm_add_role.current.id
- - nm_query_role is not changed
- - nm_query_role.current.description == 'Ansible test role 2'
- - nm_query_role.current.displayName == 'ansible_test2'
- - nm_query_role.current.id == nm_add_role.current.id
- - cm_query_role == nm_query_role
-
-
-# REMOVE ROLE
-- name: Remove role (check_mode)
- mso_role: *role_absent
- check_mode: yes
- register: cm_remove_role
-
-- name: Verify cm_remove_role
- assert:
- that:
- - cm_remove_role is changed
- - cm_remove_role.current == {}
-
-- name: Remove role (normal mode)
- mso_role: *role_absent
- register: nm_remove_role
-
-- name: Verify nm_remove_role
- assert:
- that:
- - nm_remove_role is changed
- - nm_remove_role.current == {}
-
-- name: Remove role again (check_mode)
- mso_role: *role_absent
- check_mode: yes
- register: cm_remove_role_again
-
-- name: Verify cm_remove_role_again
- assert:
- that:
- - cm_remove_role_again is not changed
- - cm_remove_role_again.current == {}
-
-- name: Remove role again (normal mode)
- mso_role: *role_absent
- register: nm_remove_role_again
-
-- name: Verify nm_remove_role_again
- assert:
- that:
- - nm_remove_role_again is not changed
- - nm_remove_role_again.current == {}
-
-
-# QUERY NON-EXISTING ROLE
-- name: Query non-existing role (check_mode)
- mso_role:
- <<: *role_query
- role: ansible_test
- check_mode: yes
- register: cm_query_non_role
-
-- name: Query non-existing role (normal mode)
- mso_role:
- <<: *role_query
- role: ansible_test
- register: nm_query_non_role
-
-# TODO: Implement more tests
-- name: Verify query_non_role
- assert:
- that:
- - cm_query_non_role is not changed
- - nm_query_non_role is not changed
- - cm_query_non_role == nm_query_non_role
diff --git a/test/integration/targets/mso_site/aliases b/test/integration/targets/mso_site/aliases
deleted file mode 100644
index cd28d3c362..0000000000
--- a/test/integration/targets/mso_site/aliases
+++ /dev/null
@@ -1,2 +0,0 @@
-# No ACI MultiSite infrastructure, so not enabled
-unsupported
diff --git a/test/integration/targets/mso_site/tasks/main.yml b/test/integration/targets/mso_site/tasks/main.yml
deleted file mode 100644
index 2c0092edfe..0000000000
--- a/test/integration/targets/mso_site/tasks/main.yml
+++ /dev/null
@@ -1,283 +0,0 @@
-# Test code for the MSO modules
-# Copyright: (c) 2018, Dag Wieers (@dagwieers) <dag@wieers.com>
-
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
-
-- name: Test that we have an ACI MultiSite host, username and password
- fail:
- msg: 'Please define the following variables: mso_hostname, mso_username and mso_password.'
- when: mso_hostname is not defined or mso_username is not defined or mso_password is not defined
-
-
-# CLEAN ENVIRONMENT
-- name: Remove site 2
- mso_site: &site_absent
- host: '{{ mso_hostname }}'
- username: '{{ mso_username }}'
- password: '{{ mso_password }}'
- validate_certs: '{{ mso_validate_certs | default(false) }}'
- use_ssl: '{{ mso_use_ssl | default(true) }}'
- use_proxy: '{{ mso_use_proxy | default(true) }}'
- output_level: '{{ mso_output_level | default("info") }}'
- site: '{{ mso_site | default("ansible_test") }}_2'
- state: absent
-
-- name: Remove site
- mso_site:
- <<: *site_absent
- site: '{{ mso_site | default("ansible_test") }}'
- register: cm_remove_site
-
-
-# ADD SITE
-- name: Add site (check_mode)
- mso_site: &site_present
- host: '{{ mso_hostname }}'
- username: '{{ mso_username }}'
- password: '{{ mso_password }}'
- validate_certs: '{{ mso_validate_certs | default(false) }}'
- use_ssl: '{{ mso_use_ssl | default(true) }}'
- use_proxy: '{{ mso_use_proxy | default(true) }}'
- output_level: '{{ mso_output_level | default("info") }}'
- site: '{{ mso_site | default("ansible_test") }}'
- apic_username: admin
- apic_password: '{{ apic_password }}'
- apic_site_id: 101
- urls:
- - https://{{ apic_hostname }}
- location:
- latitude: 50.887318
- longitude: 4.447084
- labels:
- - Diegem
- - EMEA
- - POD51
- state: present
- check_mode: yes
- register: cm_add_site
-
-- name: Verify cm_add_site
- assert:
- that:
- - cm_add_site is changed
- - cm_add_site.previous == {}
- - cm_add_site.current.id is not defined
- - cm_add_site.current.name == mso_site|default("ansible_test")
-
-- name: Add site (normal mode)
- mso_site: *site_present
- register: nm_add_site
-
-- name: nm_Verify add_site
- assert:
- that:
- - nm_add_site is changed
- - nm_add_site.previous == {}
- - nm_add_site.current.id is defined
- - nm_add_site.current.name == mso_site|default("ansible_test")
-
-- name: Add site again (check_mode)
- mso_site: *site_present
- check_mode: yes
- register: cm_add_site_again
-
-- name: Verify cm_add_site_again
- assert:
- that:
- - cm_add_site_again is not changed
- - cm_add_site_again.previous.name == mso_site|default("ansible_test")
- - cm_add_site_again.current.id == nm_add_site.current.id
- - cm_add_site_again.current.name == mso_site|default("ansible_test")
-
-- name: Add site again (normal mode)
- mso_site: *site_present
- register: nm_add_site_again
-
-- name: Verify nm_add_site_again
- assert:
- that:
- - nm_add_site_again is not changed
- - nm_add_site_again.previous.name == mso_site|default("ansible_test")
- - nm_add_site_again.current.id == nm_add_site.current.id
- - nm_add_site_again.current.name == mso_site|default("ansible_test")
-
-
-# CHANGE SITE
-- name: Change site (check_mode)
- mso_site:
- <<: *site_present
- site_id: '{{ nm_add_site.current.id }}'
- site: '{{ mso_site | default("ansible_test") }}_2'
- check_mode: yes
- register: cm_change_site
-
-- name: Verify cm_change_site
- assert:
- that:
- - cm_change_site is changed
- - cm_change_site.current.id == nm_add_site.current.id
- - cm_change_site.current.name == '{{ mso_site | default("ansible_test") }}_2'
-
-- name: Change site (normal mode)
- mso_site:
- <<: *site_present
- site_id: '{{ nm_add_site.current.id }}'
- site: '{{ mso_site | default("ansible_test") }}_2'
- output_level: debug
- register: nm_change_site
-
-- name: Verify nm_change_site
- assert:
- that:
- - nm_change_site is changed
- - nm_change_site.current.id == nm_add_site.current.id
- - nm_change_site.current.name == '{{ mso_site | default("ansible_test") }}_2'
-
-- name: Change site again (check_mode)
- mso_site:
- <<: *site_present
- site_id: '{{ nm_add_site.current.id }}'
- site: '{{ mso_site | default("ansible_test") }}_2'
- check_mode: yes
- register: cm_change_site_again
-
-- name: Verify cm_change_site_again
- assert:
- that:
- - cm_change_site_again is not changed
- - cm_change_site_again.current.id == nm_add_site.current.id
- - cm_change_site_again.current.name == '{{ mso_site | default("ansible_test") }}_2'
-
-- name: Change site again (normal mode)
- mso_site:
- <<: *site_present
- site_id: '{{ nm_add_site.current.id }}'
- site: '{{ mso_site | default("ansible_test") }}_2'
- register: nm_change_site_again
-
-- name: Verify nm_change_site_again
- assert:
- that:
- - nm_change_site_again is not changed
- - nm_change_site_again.current.id == nm_add_site.current.id
- - nm_change_site_again.current.name == '{{ mso_site | default("ansible_test") }}_2'
-
-
-# QUERY ALL SITES
-- name: Query all sites (check_mode)
- mso_site: &site_query
- host: '{{ mso_hostname }}'
- username: '{{ mso_username }}'
- password: '{{ mso_password }}'
- validate_certs: '{{ mso_validate_certs | default(false) }}'
- use_ssl: '{{ mso_use_ssl | default(true) }}'
- use_proxy: '{{ mso_use_proxy | default(true) }}'
- output_level: '{{ mso_output_level | default("info") }}'
- state: query
- check_mode: yes
- register: cm_query_all_sites
-
-- name: Query all sites (normal mode)
- mso_site: *site_query
- register: nm_query_all_sites
-
-- name: Verify query_all_sites
- assert:
- that:
- - cm_query_all_sites is not changed
- - nm_query_all_sites is not changed
- # NOTE: Order of sites is not stable between calls
- #- cm_query_all_sites == nm_query_all_sites
-
-
-# QUERY A SITE
-- name: Query our site
- mso_site:
- <<: *site_query
- site: '{{ mso_site | default("ansible_test") }}_2'
- check_mode: yes
- register: cm_query_site
-
-- name: Query our site
- mso_site:
- <<: *site_query
- site: '{{ mso_site | default("ansible_test") }}_2'
- register: nm_query_site
-
-- name: Verify query_site
- assert:
- that:
- - cm_query_site is not changed
- - cm_query_site.current.id == nm_add_site.current.id
- - cm_query_site.current.name == '{{ mso_site | default("ansible_test") }}_2'
- - nm_query_site is not changed
- - nm_query_site.current.id == nm_add_site.current.id
- - nm_query_site.current.name == '{{ mso_site | default("ansible_test") }}_2'
- - cm_query_site == nm_query_site
-
-
-# REMOVE SITE
-- name: Remove site (check_mode)
- mso_site: *site_absent
- check_mode: yes
- register: cm_remove_site
-
-- name: Verify cm_remove_site
- assert:
- that:
- - cm_remove_site is changed
- - cm_remove_site.current == {}
-
-- name: Remove site (normal mode)
- mso_site: *site_absent
- register: nm_remove_site
-
-- name: Verify nm_remove_site
- assert:
- that:
- - nm_remove_site is changed
- - nm_remove_site.current == {}
-
-- name: Remove site again (check_mode)
- mso_site: *site_absent
- check_mode: yes
- register: cm_remove_site_again
-
-- name: Verify cm_remove_site_again
- assert:
- that:
- - cm_remove_site_again is not changed
- - cm_remove_site_again.current == {}
-
-- name: Remove site again (normal mode)
- mso_site: *site_absent
- register: nm_remove_site_again
-
-- name: Verify nm_remove_site_again
- assert:
- that:
- - nm_remove_site_again is not changed
- - nm_remove_site_again.current == {}
-
-
-# QUERY NON-EXISTING SITE
-- name: Query non-existing site (check_mode)
- mso_site:
- <<: *site_query
- site: '{{ mso_site | default("ansible_test") }}'
- check_mode: yes
- register: cm_query_non_site
-
-- name: Query non-existing site (normal mode)
- mso_site:
- <<: *site_query
- site: '{{ mso_site | default("ansible_test") }}'
- register: nm_query_non_site
-
-# TODO: Implement more tests
-- name: Verify query_non_site
- assert:
- that:
- - cm_query_non_site is not changed
- - nm_query_non_site is not changed
- - cm_query_non_site == nm_query_non_site
diff --git a/test/integration/targets/mso_tenant/aliases b/test/integration/targets/mso_tenant/aliases
deleted file mode 100644
index cd28d3c362..0000000000
--- a/test/integration/targets/mso_tenant/aliases
+++ /dev/null
@@ -1,2 +0,0 @@
-# No ACI MultiSite infrastructure, so not enabled
-unsupported
diff --git a/test/integration/targets/mso_tenant/tasks/main.yml b/test/integration/targets/mso_tenant/tasks/main.yml
deleted file mode 100644
index fb6be21a15..0000000000
--- a/test/integration/targets/mso_tenant/tasks/main.yml
+++ /dev/null
@@ -1,289 +0,0 @@
-# Test code for the MSO modules
-# Copyright: (c) 2018, Dag Wieers (@dagwieers) <dag@wieers.com>
-
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
-
-- name: Test that we have an ACI MultiSite host, username and password
- fail:
- msg: 'Please define the following variables: mso_hostname, mso_username and mso_password.'
- when: mso_hostname is not defined or mso_username is not defined or mso_password is not defined
-
-
-# CLEAN ENVIRONMENT
-- name: Remove tenant ansible_test2
- mso_tenant: &tenant_absent
- host: '{{ mso_hostname }}'
- username: '{{ mso_username }}'
- password: '{{ mso_password }}'
- validate_certs: '{{ mso_validate_certs | default(false) }}'
- use_ssl: '{{ mso_use_ssl | default(true) }}'
- use_proxy: '{{ mso_use_proxy | default(true) }}'
- output_level: '{{ mso_output_level | default("info") }}'
- tenant: ansible_test2
- state: absent
-
-- name: Remove tenant ansible_test
- mso_tenant:
- <<: *tenant_absent
- tenant: ansible_test
- register: cm_remove_tenant
-
-
-# ADD TENANT
-- name: Add tenant (check_mode)
- mso_tenant: &tenant_present
- host: '{{ mso_hostname }}'
- username: '{{ mso_username }}'
- password: '{{ mso_password }}'
- validate_certs: '{{ mso_validate_certs | default(false) }}'
- use_ssl: '{{ mso_use_ssl | default(true) }}'
- use_proxy: '{{ mso_use_proxy | default(true) }}'
- output_level: '{{ mso_output_level | default("info") }}'
- tenant: ansible_test
- display_name: Ansible test title
- description: Ansible test tenant
- state: present
- check_mode: yes
- register: cm_add_tenant
-
-- name: Verify cm_add_tenant
- assert:
- that:
- - cm_add_tenant is changed
- - cm_add_tenant.previous == {}
- - cm_add_tenant.current.id is not defined
- - cm_add_tenant.current.name == 'ansible_test'
- - cm_add_tenant.current.description == 'Ansible test tenant'
-
-- name: Add tenant (normal mode)
- mso_tenant: *tenant_present
- register: nm_add_tenant
-
-- name: nm_Verify add_tenant
- assert:
- that:
- - nm_add_tenant is changed
- - nm_add_tenant.previous == {}
- - nm_add_tenant.current.id is defined
- - nm_add_tenant.current.name == 'ansible_test'
- - nm_add_tenant.current.description == 'Ansible test tenant'
-
-- name: Add tenant again (check_mode)
- mso_tenant: *tenant_present
- check_mode: yes
- register: cm_add_tenant_again
-
-- name: Verify cm_add_tenant_again
- assert:
- that:
- - cm_add_tenant_again is not changed
- - cm_add_tenant_again.previous.name == 'ansible_test'
- - cm_add_tenant_again.previous.description == 'Ansible test tenant'
- - cm_add_tenant_again.current.id == nm_add_tenant.current.id
- - cm_add_tenant_again.current.name == 'ansible_test'
- - cm_add_tenant_again.current.description == 'Ansible test tenant'
-
-- name: Add tenant again (normal mode)
- mso_tenant: *tenant_present
- register: nm_add_tenant_again
-
-- name: Verify nm_add_tenant_again
- assert:
- that:
- - nm_add_tenant_again is not changed
- - nm_add_tenant_again.previous.name == 'ansible_test'
- - nm_add_tenant_again.previous.description == 'Ansible test tenant'
- - nm_add_tenant_again.current.id == nm_add_tenant.current.id
- - nm_add_tenant_again.current.name == 'ansible_test'
- - nm_add_tenant_again.current.description == 'Ansible test tenant'
-
-
-# CHANGE TENANT
-- name: Change tenant (check_mode)
- mso_tenant:
- <<: *tenant_present
- tenant_id: '{{ nm_add_tenant.current.id }}'
- tenant: ansible_test2
- description: Ansible test tenant 2
- check_mode: yes
- register: cm_change_tenant
-
-- name: Verify cm_change_tenant
- assert:
- that:
- - cm_change_tenant is changed
- - cm_change_tenant.current.id == nm_add_tenant.current.id
- - cm_change_tenant.current.name == 'ansible_test2'
- - cm_change_tenant.current.description == 'Ansible test tenant 2'
-
-- name: Change tenant (normal mode)
- mso_tenant:
- <<: *tenant_present
- tenant_id: '{{ nm_add_tenant.current.id }}'
- tenant: ansible_test2
- description: Ansible test tenant 2
- output_level: debug
- register: nm_change_tenant
-
-- name: Verify nm_change_tenant
- assert:
- that:
- - nm_change_tenant is changed
- - nm_change_tenant.current.id == nm_add_tenant.current.id
- - nm_change_tenant.current.name == 'ansible_test2'
- - nm_change_tenant.current.description == 'Ansible test tenant 2'
-
-- name: Change tenant again (check_mode)
- mso_tenant:
- <<: *tenant_present
- tenant_id: '{{ nm_add_tenant.current.id }}'
- tenant: ansible_test2
- description: Ansible test tenant 2
- check_mode: yes
- register: cm_change_tenant_again
-
-- name: Verify cm_change_tenant_again
- assert:
- that:
- - cm_change_tenant_again is not changed
- - cm_change_tenant_again.current.id == nm_add_tenant.current.id
- - cm_change_tenant_again.current.name == 'ansible_test2'
- - cm_change_tenant_again.current.description == 'Ansible test tenant 2'
-
-- name: Change tenant again (normal mode)
- mso_tenant:
- <<: *tenant_present
- tenant_id: '{{ nm_add_tenant.current.id }}'
- tenant: ansible_test2
- description: Ansible test tenant 2
- register: nm_change_tenant_again
-
-- name: Verify nm_change_tenant_again
- assert:
- that:
- - nm_change_tenant_again is not changed
- - nm_change_tenant_again.current.id == nm_add_tenant.current.id
- - nm_change_tenant_again.current.name == 'ansible_test2'
- - nm_change_tenant_again.current.description == 'Ansible test tenant 2'
-
-
-# QUERY ALL TENANTS
-- name: Query all tenants (check_mode)
- mso_tenant: &tenant_query
- host: '{{ mso_hostname }}'
- username: '{{ mso_username }}'
- password: '{{ mso_password }}'
- validate_certs: '{{ mso_validate_certs | default(false) }}'
- use_ssl: '{{ mso_use_ssl | default(true) }}'
- use_proxy: '{{ mso_use_proxy | default(true) }}'
- output_level: '{{ mso_output_level | default("info") }}'
- state: query
- check_mode: yes
- register: cm_query_all_tenants
-
-- name: Query all tenants (normal mode)
- mso_tenant: *tenant_query
- register: nm_query_all_tenants
-
-- name: Verify query_all_tenants
- assert:
- that:
- - cm_query_all_tenants is not changed
- - nm_query_all_tenants is not changed
- # NOTE: Order of tenants is not stable between calls
- #- cm_query_all_tenants == nm_query_all_tenants
-
-
-# QUERY A TENANT
-- name: Query our tenant
- mso_tenant:
- <<: *tenant_query
- tenant: ansible_test2
- check_mode: yes
- register: cm_query_tenant
-
-- name: Query our tenant
- mso_tenant:
- <<: *tenant_query
- tenant: ansible_test2
- register: nm_query_tenant
-
-- name: Verify query_tenant
- assert:
- that:
- - cm_query_tenant is not changed
- - cm_query_tenant.current.id == nm_add_tenant.current.id
- - cm_query_tenant.current.name == 'ansible_test2'
- - cm_query_tenant.current.description == 'Ansible test tenant 2'
- - nm_query_tenant is not changed
- - nm_query_tenant.current.id == nm_add_tenant.current.id
- - nm_query_tenant.current.name == 'ansible_test2'
- - nm_query_tenant.current.description == 'Ansible test tenant 2'
- - cm_query_tenant == nm_query_tenant
-
-
-# REMOVE TENANT
-- name: Remove tenant (check_mode)
- mso_tenant: *tenant_absent
- check_mode: yes
- register: cm_remove_tenant
-
-- name: Verify cm_remove_tenant
- assert:
- that:
- - cm_remove_tenant is changed
- - cm_remove_tenant.current == {}
-
-- name: Remove tenant (normal mode)
- mso_tenant: *tenant_absent
- register: nm_remove_tenant
-
-- name: Verify nm_remove_tenant
- assert:
- that:
- - nm_remove_tenant is changed
- - nm_remove_tenant.current == {}
-
-- name: Remove tenant again (check_mode)
- mso_tenant: *tenant_absent
- check_mode: yes
- register: cm_remove_tenant_again
-
-- name: Verify cm_remove_tenant_again
- assert:
- that:
- - cm_remove_tenant_again is not changed
- - cm_remove_tenant_again.current == {}
-
-- name: Remove tenant again (normal mode)
- mso_tenant: *tenant_absent
- register: nm_remove_tenant_again
-
-- name: Verify nm_remove_tenant_again
- assert:
- that:
- - nm_remove_tenant_again is not changed
- - nm_remove_tenant_again.current == {}
-
-
-# QUERY NON-EXISTING TENANT
-- name: Query non-existing tenant (check_mode)
- mso_tenant:
- <<: *tenant_query
- tenant: ansible_test
- check_mode: yes
- register: cm_query_non_tenant
-
-- name: Query non-existing tenant (normal mode)
- mso_tenant:
- <<: *tenant_query
- tenant: ansible_test
- register: nm_query_non_tenant
-
-# TODO: Implement more tests
-- name: Verify query_non_tenant
- assert:
- that:
- - cm_query_non_tenant is not changed
- - nm_query_non_tenant is not changed
- - cm_query_non_tenant == nm_query_non_tenant
diff --git a/test/integration/targets/mso_user/aliases b/test/integration/targets/mso_user/aliases
deleted file mode 100644
index cd28d3c362..0000000000
--- a/test/integration/targets/mso_user/aliases
+++ /dev/null
@@ -1,2 +0,0 @@
-# No ACI MultiSite infrastructure, so not enabled
-unsupported
diff --git a/test/integration/targets/mso_user/tasks/main.yml b/test/integration/targets/mso_user/tasks/main.yml
deleted file mode 100644
index 2bddd7ac34..0000000000
--- a/test/integration/targets/mso_user/tasks/main.yml
+++ /dev/null
@@ -1,292 +0,0 @@
-# Test code for the MSO modules
-# Copyright: (c) 2018, Dag Wieers (@dagwieers) <dag@wieers.com>
-
-# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
-
-- name: Test that we have an ACI MultiSite host, username and password
- fail:
- msg: 'Please define the following variables: mso_hostname, mso_username and mso_password.'
- when: mso_hostname is not defined or mso_username is not defined or mso_password is not defined
-
-
-# CLEAN ENVIRONMENT
-- name: Remove user ansible_test2
- mso_user: &user_absent
- host: '{{ mso_hostname }}'
- username: '{{ mso_username }}'
- password: '{{ mso_password }}'
- validate_certs: '{{ mso_validate_certs | default(false) }}'
- use_ssl: '{{ mso_use_ssl | default(true) }}'
- use_proxy: '{{ mso_use_proxy | default(true) }}'
- output_level: '{{ mso_output_level | default("info") }}'
- user_name: ansible_test2
- state: absent
-
-- name: Remove user ansible_test
- mso_user:
- <<: *user_absent
- user_name: ansible_test
- register: cm_remove_user
-
-
-# ADD USER
-- name: Add user (check_mode)
- mso_user: &user_present
- host: '{{ mso_hostname }}'
- username: '{{ mso_username }}'
- password: '{{ mso_password }}'
- validate_certs: '{{ mso_validate_certs | default(false) }}'
- use_ssl: '{{ mso_use_ssl | default(true) }}'
- use_proxy: '{{ mso_use_proxy | default(true) }}'
- output_level: '{{ mso_output_level | default("info") }}'
- user_name: ansible_test
- user_password: 'S0m3!1n1t14l!p455w0rd'
- # NOTE: First name, last name, phone and email are mandatory on creation
- first_name: Ansible
- last_name: Test
- email: msc@cisco.com
- phone: +32 478 436 299
- account_status: active
- roles:
- - powerUser
- domain: Local
-
- state: present
- check_mode: yes
- register: cm_add_user
-
-- name: Verify cm_add_user
- assert:
- that:
- - cm_add_user is changed
- - cm_add_user.previous == {}
- - cm_add_user.current.id is not defined
- - cm_add_user.current.username == 'ansible_test'
-
-- name: Add user (normal mode)
- mso_user: *user_present
- register: nm_add_user
-
-- name: nm_Verify add_user
- assert:
- that:
- - nm_add_user is changed
- - nm_add_user.previous == {}
- - nm_add_user.current.id is defined
- - nm_add_user.current.username == 'ansible_test'
-
-- name: Add user again (check_mode)
- mso_user:
- <<: *user_present
- # NOTE: We need to modify the password for a new user
- user_password: 'S0m3!n3w!p455w0rd'
- check_mode: yes
- register: cm_add_user_again
-
-- name: Verify cm_add_user_again
- assert:
- that:
- - cm_add_user_again is changed
- - cm_add_user_again.previous.username == 'ansible_test'
- - cm_add_user_again.current.id == nm_add_user.current.id
- - cm_add_user_again.current.username == 'ansible_test'
-
-- name: Add user again (normal mode)
- mso_user:
- <<: *user_present
- # NOTE: We need to modify the password for a new user
- user_password: 'S0m3!n3w!p455w0rd'
- register: nm_add_user_again
-
-- name: Verify nm_add_user_again
- assert:
- that:
- - nm_add_user_again is changed
- - nm_add_user_again.previous.username == 'ansible_test'
- - nm_add_user_again.current.id == nm_add_user.current.id
- - nm_add_user_again.current.username == 'ansible_test'
-
-
-# CHANGE USER
-- name: Change user (check_mode)
- mso_user:
- <<: *user_present
- user_id: '{{ nm_add_user.current.id }}'
- user_name: ansible_test2
- user_password: null
- check_mode: yes
- register: cm_change_user
-
-- name: Verify cm_change_user
- assert:
- that:
- - cm_change_user is changed
- - cm_change_user.current.id == nm_add_user.current.id
- - cm_change_user.current.username == 'ansible_test2'
-
-- name: Change user (normal mode)
- mso_user:
- <<: *user_present
- user_id: '{{ nm_add_user.current.id }}'
- user_name: ansible_test2
- user_password: null
- output_level: debug
- register: nm_change_user
-
-- name: Verify nm_change_user
- assert:
- that:
- - nm_change_user is changed
- - nm_change_user.current.id == nm_add_user.current.id
- - nm_change_user.current.username == 'ansible_test2'
-
-- name: Change user again (check_mode)
- mso_user:
- <<: *user_present
- user_id: '{{ nm_add_user.current.id }}'
- user_name: ansible_test2
- user_password: null
- check_mode: yes
- register: cm_change_user_again
-
-- name: Verify cm_change_user_again
- assert:
- that:
- - cm_change_user_again is not changed
- - cm_change_user_again.current.id == nm_add_user.current.id
- - cm_change_user_again.current.username == 'ansible_test2'
-
-- name: Change user again (normal mode)
- mso_user:
- <<: *user_present
- user_id: '{{ nm_add_user.current.id }}'
- user_name: ansible_test2
- user_password: null
- register: nm_change_user_again
-
-- name: Verify nm_change_user_again
- assert:
- that:
- - nm_change_user_again is not changed
- - nm_change_user_again.current.id == nm_add_user.current.id
- - nm_change_user_again.current.username == 'ansible_test2'
-
-
-# QUERY ALL USERS
-- name: Query all users (check_mode)
- mso_user: &user_query
- host: '{{ mso_hostname }}'
- username: '{{ mso_username }}'
- password: '{{ mso_password }}'
- validate_certs: '{{ mso_validate_certs | default(false) }}'
- use_ssl: '{{ mso_use_ssl | default(true) }}'
- use_proxy: '{{ mso_use_proxy | default(true) }}'
- output_level: '{{ mso_output_level | default("info") }}'
- state: query
- check_mode: yes
- register: cm_query_all_users
-
-- name: Query all users (normal mode)
- mso_user: *user_query
- register: nm_query_all_users
-
-- name: Verify query_all_users
- assert:
- that:
- - cm_query_all_users is not changed
- - nm_query_all_users is not changed
- # NOTE: Order of users is not stable between calls
- #- cm_query_all_users == nm_query_all_users
-
-
-# QUERY A USER
-- name: Query our user
- mso_user:
- <<: *user_query
- user_name: ansible_test2
- check_mode: yes
- register: cm_query_user
-
-- name: Query our user
- mso_user:
- <<: *user_query
- user_name: ansible_test2
- register: nm_query_user
-
-- name: Verify query_user
- assert:
- that:
- - cm_query_user is not changed
- - cm_query_user.current.id == nm_add_user.current.id
- - cm_query_user.current.username == 'ansible_test2'
- - nm_query_user is not changed
- - nm_query_user.current.id == nm_add_user.current.id
- - nm_query_user.current.username == 'ansible_test2'
- - cm_query_user == nm_query_user
-
-
-# REMOVE USER
-- name: Remove user (check_mode)
- mso_user: *user_absent
- check_mode: yes
- register: cm_remove_user
-
-- name: Verify cm_remove_user
- assert:
- that:
- - cm_remove_user is changed
- - cm_remove_user.current == {}
-
-- name: Remove user (normal mode)
- mso_user: *user_absent
- register: nm_remove_user
-
-- name: Verify nm_remove_user
- assert:
- that:
- - nm_remove_user is changed
- - nm_remove_user.current == {}
-
-- name: Remove user again (check_mode)
- mso_user: *user_absent
- check_mode: yes
- register: cm_remove_user_again
-
-- name: Verify cm_remove_user_again
- assert:
- that:
- - cm_remove_user_again is not changed
- - cm_remove_user_again.current == {}
-
-- name: Remove user again (normal mode)
- mso_user: *user_absent
- register: nm_remove_user_again
-
-- name: Verify nm_remove_user_again
- assert:
- that:
- - nm_remove_user_again is not changed
- - nm_remove_user_again.current == {}
-
-
-# QUERY NON-EXISTING USER
-- name: Query non-existing user (check_mode)
- mso_user:
- <<: *user_query
- user_name: ansible_test
- check_mode: yes
- register: cm_query_non_user
-
-- name: Query non-existing user (normal mode)
- mso_user:
- <<: *user_query
- user_name: ansible_test
- register: nm_query_non_user
-
-# TODO: Implement more tests
-- name: Verify query_non_user
- assert:
- that:
- - cm_query_non_user is not changed
- - nm_query_non_user is not changed
- - cm_query_non_user == nm_query_non_user