summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorAnsible Core Team <info@ansible.com>2020-03-09 09:40:34 +0000
committerAnsible Core Team <info@ansible.com>2020-03-09 09:40:34 +0000
commit0aff46f3fdbe407ca10e5133f3debac68d2ac375 (patch)
tree5ae480b8b60309a5c30ba6838e69d946487db588 /test/integration
parentad5be6f8fd604ad53c784af148965b20459884af (diff)
downloadansible-0aff46f3fdbe407ca10e5133f3debac68d2ac375.tar.gz
Migrated to cisco.asa
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/targets/asa_acl/defaults/main.yaml3
-rw-r--r--test/integration/targets/asa_acl/tasks/cli.yaml16
-rw-r--r--test/integration/targets/asa_acl/tasks/main.yaml2
-rw-r--r--test/integration/targets/asa_acl/tests/cli/basic.yaml41
-rw-r--r--test/integration/targets/asa_acl/tests/cli/full_name_match.yaml43
-rw-r--r--test/integration/targets/asa_acl/tests/cli/insert.yaml51
-rw-r--r--test/integration/targets/asa_command/defaults/main.yaml3
-rw-r--r--test/integration/targets/asa_command/tasks/cli.yaml15
-rw-r--r--test/integration/targets/asa_command/tasks/main.yaml2
-rw-r--r--test/integration/targets/asa_command/tests/cli/bad_operator.yaml20
-rw-r--r--test/integration/targets/asa_command/tests/cli/contains.yaml20
-rw-r--r--test/integration/targets/asa_command/tests/cli/invalid.yaml30
-rw-r--r--test/integration/targets/asa_command/tests/cli/output.yaml29
-rw-r--r--test/integration/targets/asa_command/tests/cli/timeout.yaml19
-rw-r--r--test/integration/targets/asa_config/defaults/main.yaml3
-rw-r--r--test/integration/targets/asa_config/tasks/cli.yaml15
-rw-r--r--test/integration/targets/asa_config/tasks/main.yaml2
-rw-r--r--test/integration/targets/asa_config/templates/basic/config.j23
-rw-r--r--test/integration/targets/asa_config/templates/defaults/config.j24
-rw-r--r--test/integration/targets/asa_config/tests/cli/backup.yaml53
-rw-r--r--test/integration/targets/asa_config/tests/cli/basic.yaml39
-rw-r--r--test/integration/targets/asa_config/tests/cli/defaults.yaml45
-rw-r--r--test/integration/targets/asa_config/tests/cli/force.yaml41
-rw-r--r--test/integration/targets/asa_config/tests/cli/more_system.yaml47
-rw-r--r--test/integration/targets/asa_config/tests/cli/removal_error.yaml46
-rw-r--r--test/integration/targets/asa_config/tests/cli/sublevel.yaml40
-rw-r--r--test/integration/targets/asa_config/tests/cli/sublevel_block.yaml64
-rw-r--r--test/integration/targets/asa_config/tests/cli/sublevel_exact.yaml64
-rw-r--r--test/integration/targets/asa_config/tests/cli/sublevel_strict.yaml61
-rw-r--r--test/integration/targets/asa_config/tests/cli/sublevel_strict_mul_parents.yaml66
-rw-r--r--test/integration/targets/asa_config/tests/cli/toplevel.yaml35
-rw-r--r--test/integration/targets/asa_config/tests/cli/toplevel_after.yaml42
-rw-r--r--test/integration/targets/asa_config/tests/cli/toplevel_before.yaml42
-rw-r--r--test/integration/targets/asa_config/tests/cli/toplevel_nonidempotent.yaml38
-rw-r--r--test/integration/targets/asa_og/defaults/main.yaml2
-rw-r--r--test/integration/targets/asa_og/tasks/cli.yaml22
-rw-r--r--test/integration/targets/asa_og/tasks/main.yaml2
-rw-r--r--test/integration/targets/asa_og/tests/cli/asa_og.yaml541
38 files changed, 0 insertions, 1611 deletions
diff --git a/test/integration/targets/asa_acl/defaults/main.yaml b/test/integration/targets/asa_acl/defaults/main.yaml
deleted file mode 100644
index 9ef5ba5165..0000000000
--- a/test/integration/targets/asa_acl/defaults/main.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-testcase: "*"
-test_items: []
diff --git a/test/integration/targets/asa_acl/tasks/cli.yaml b/test/integration/targets/asa_acl/tasks/cli.yaml
deleted file mode 100644
index 9a32dbe643..0000000000
--- a/test/integration/targets/asa_acl/tasks/cli.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
----
-- name: collect all cli test cases
- find:
- paths: "{{ role_path }}/tests/cli"
- patterns: "{{ testcase }}.yaml"
- register: test_cases
-
-
-- name: set test_items
- set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-
-- name: run test case
- include: "{{ test_case_to_run }}"
- with_items: "{{ test_items }}"
- loop_control:
- loop_var: test_case_to_run
diff --git a/test/integration/targets/asa_acl/tasks/main.yaml b/test/integration/targets/asa_acl/tasks/main.yaml
deleted file mode 100644
index 415c99d8b1..0000000000
--- a/test/integration/targets/asa_acl/tasks/main.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-- { include: cli.yaml, tags: ['cli'] }
diff --git a/test/integration/targets/asa_acl/tests/cli/basic.yaml b/test/integration/targets/asa_acl/tests/cli/basic.yaml
deleted file mode 100644
index f9b7541691..0000000000
--- a/test/integration/targets/asa_acl/tests/cli/basic.yaml
+++ /dev/null
@@ -1,41 +0,0 @@
----
-- debug: msg="START cli/basic.yaml"
-
-- name: setup
- asa_config:
- commands:
- - clear configure access-list ACL-BASIC
- provider: "{{ cli }}"
- ignore_errors: yes
-
-- name: Basic ACL
- asa_acl:
- provider: "{{ cli }}"
- lines:
- - access-list ACL-BASIC extended permit tcp any any eq www
- - access-list ACL-BASIC extended permit tcp any any eq https
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: Basic ACL idempotency
- asa_acl:
- provider: "{{ cli }}"
- lines:
- - access-list ACL-BASIC extended permit tcp any any eq www
- - access-list ACL-BASIC extended permit tcp any any eq https
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- asa_config:
- commands:
- - clear configure access-list ACL-BASIC
- provider: "{{ cli }}"
-
-- debug: msg="END cli/basic.yaml"
diff --git a/test/integration/targets/asa_acl/tests/cli/full_name_match.yaml b/test/integration/targets/asa_acl/tests/cli/full_name_match.yaml
deleted file mode 100644
index 0761aa53cf..0000000000
--- a/test/integration/targets/asa_acl/tests/cli/full_name_match.yaml
+++ /dev/null
@@ -1,43 +0,0 @@
----
-- debug: msg="START cli/full_name_match.yaml"
-
-- name: setup
- asa_config:
- commands:
- - clear configure access-list ACL-BASIC
- - clear configure access-list ACL-BASIC2
- provider: "{{ cli }}"
- ignore_errors: yes
-
-- name: Basic ACL
- asa_acl:
- provider: "{{ cli }}"
- lines:
- - access-list ACL-BASIC2 extended permit tcp any any eq www
- - access-list ACL-BASIC2 extended permit tcp any any eq https
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: Should not match for ACL-BASIC2
- asa_acl:
- provider: "{{ cli }}"
- lines:
- - access-list ACL-BASIC extended permit tcp any any eq www
- - access-list ACL-BASIC extended permit tcp any any eq https
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: teardown
- asa_config:
- commands:
- - clear configure access-list ACL-BASIC
- - clear configure access-list ACL-BASIC2
- provider: "{{ cli }}"
-
-- debug: msg="END cli/full_name_match.yaml"
diff --git a/test/integration/targets/asa_acl/tests/cli/insert.yaml b/test/integration/targets/asa_acl/tests/cli/insert.yaml
deleted file mode 100644
index 4ae7b54492..0000000000
--- a/test/integration/targets/asa_acl/tests/cli/insert.yaml
+++ /dev/null
@@ -1,51 +0,0 @@
----
-- debug: msg="START cli/insert.yaml"
-
-- name: setup
- asa_config:
- commands:
- - clear configure access-list ACL-INSERT
- provider: "{{ cli }}"
- ignore_errors: yes
-
-- name: Create ACL
- asa_acl:
- provider: "{{ cli }}"
- lines:
- - access-list ACL-INSERT extended permit tcp any any eq www
- - access-list ACL-INSERT extended permit tcp any any eq https
- register: result
-
-- name: Insert on first line
- asa_acl:
- provider: "{{ cli }}"
- lines:
- - access-list ACL-INSERT extended permit tcp any any eq www
- - access-list ACL-INSERT extended permit tcp any any eq https
- - access-list ACL-INSERT line 1 extended permit tcp any any eq ssh
- register: result
-
-- name: Show ACL
- asa_command:
- provider: "{{ cli }}"
- commands: "show run access-list ACL-INSERT"
- register: result
-
-- name: Show me
- debug:
- var: result
-
-- name:
- assert:
- that:
- - result.stdout_lines[0][0].rstrip() == 'access-list ACL-INSERT extended permit tcp any any eq ssh'
-
-
-
-- name: teardown
- asa_config:
- commands:
- - clear configure access-list ACL-INSERT
- provider: "{{ cli }}"
-
-- debug: msg="END cli/insert.yaml"
diff --git a/test/integration/targets/asa_command/defaults/main.yaml b/test/integration/targets/asa_command/defaults/main.yaml
deleted file mode 100644
index 9ef5ba5165..0000000000
--- a/test/integration/targets/asa_command/defaults/main.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-testcase: "*"
-test_items: []
diff --git a/test/integration/targets/asa_command/tasks/cli.yaml b/test/integration/targets/asa_command/tasks/cli.yaml
deleted file mode 100644
index d675462dd0..0000000000
--- a/test/integration/targets/asa_command/tasks/cli.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
----
-- name: collect all cli test cases
- find:
- paths: "{{ role_path }}/tests/cli"
- patterns: "{{ testcase }}.yaml"
- register: test_cases
-
-- name: set test_items
- set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-
-- name: run test case
- include: "{{ test_case_to_run }}"
- with_items: "{{ test_items }}"
- loop_control:
- loop_var: test_case_to_run
diff --git a/test/integration/targets/asa_command/tasks/main.yaml b/test/integration/targets/asa_command/tasks/main.yaml
deleted file mode 100644
index 415c99d8b1..0000000000
--- a/test/integration/targets/asa_command/tasks/main.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-- { include: cli.yaml, tags: ['cli'] }
diff --git a/test/integration/targets/asa_command/tests/cli/bad_operator.yaml b/test/integration/targets/asa_command/tests/cli/bad_operator.yaml
deleted file mode 100644
index bcbe8bb592..0000000000
--- a/test/integration/targets/asa_command/tests/cli/bad_operator.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
----
-- debug: msg="START cli/bad_operator.yaml"
-
-- name: test bad operator
- asa_command:
- commands:
- - show version
- - show interfaces GigabitEthernet 0/0
- wait_for:
- - result[0] contains 'Description: Foo'
- provider: "{{ cli }}"
- register: result
- ignore_errors: yes
-
-- assert:
- that:
- - "result.failed == true"
- - "result.msg is defined"
-
-- debug: msg="END cli/bad_operator.yaml"
diff --git a/test/integration/targets/asa_command/tests/cli/contains.yaml b/test/integration/targets/asa_command/tests/cli/contains.yaml
deleted file mode 100644
index c08d89c273..0000000000
--- a/test/integration/targets/asa_command/tests/cli/contains.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
----
-- debug: msg="START cli/contains.yaml"
-
-- name: test contains operator
- asa_command:
- commands:
- - show version
- - show interface
- wait_for:
- - "result[0] contains 'Cisco Adaptive Security Appliance Software Version'"
- - "result[1] contains 'Hardware'"
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == false"
- - "result.stdout is defined"
-
-- debug: msg="END cli/contains.yaml"
diff --git a/test/integration/targets/asa_command/tests/cli/invalid.yaml b/test/integration/targets/asa_command/tests/cli/invalid.yaml
deleted file mode 100644
index 67730968d4..0000000000
--- a/test/integration/targets/asa_command/tests/cli/invalid.yaml
+++ /dev/null
@@ -1,30 +0,0 @@
----
-- debug: msg="START cli/invalid.yaml"
-
-- name: run invalid command
- asa_command:
- commands: ['show foo']
- provider: "{{ cli }}"
- register: result
- ignore_errors: yes
-
-- assert:
- that:
- - "result.failed"
-
-- name: run commands that include invalid command
- asa_command:
- commands:
- - show version
- - show foo
- provider: "{{ cli }}"
- register: result
- ignore_errors: yes
-
-- assert:
- that:
- - "result.failed"
-# FIXME bug https://github.com/ansible/ansible-modules-extras/issues/3048
- ignore_errors: true
-
-- debug: msg="END cli/invalid.yaml"
diff --git a/test/integration/targets/asa_command/tests/cli/output.yaml b/test/integration/targets/asa_command/tests/cli/output.yaml
deleted file mode 100644
index ccfb75375f..0000000000
--- a/test/integration/targets/asa_command/tests/cli/output.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
----
-- debug: msg="START cli/output.yaml"
-
-- name: get output for single command
- asa_command:
- commands: ['show version']
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == false"
- - "result.stdout is defined"
-
-- name: get output for multiple commands
- asa_command:
- commands:
- - show version
- - show interface
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == false"
- - "result.stdout is defined"
- - "result.stdout | length == 2"
-
-- debug: msg="END cli/output.yaml"
diff --git a/test/integration/targets/asa_command/tests/cli/timeout.yaml b/test/integration/targets/asa_command/tests/cli/timeout.yaml
deleted file mode 100644
index 2387058a86..0000000000
--- a/test/integration/targets/asa_command/tests/cli/timeout.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
----
-- debug: msg="START cli/timeout.yaml"
-
-- name: test bad condition
- asa_command:
- commands:
- - show version
- wait_for:
- - "result[0] contains bad_value_string"
- provider: "{{ cli }}"
- register: result
- ignore_errors: yes
-
-- assert:
- that:
- - "result.failed == true"
- - "result.msg is defined"
-
-- debug: msg="END cli/timeout.yaml"
diff --git a/test/integration/targets/asa_config/defaults/main.yaml b/test/integration/targets/asa_config/defaults/main.yaml
deleted file mode 100644
index ebf6ffc903..0000000000
--- a/test/integration/targets/asa_config/defaults/main.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-testcase: "*"
-test_items: [] \ No newline at end of file
diff --git a/test/integration/targets/asa_config/tasks/cli.yaml b/test/integration/targets/asa_config/tasks/cli.yaml
deleted file mode 100644
index d675462dd0..0000000000
--- a/test/integration/targets/asa_config/tasks/cli.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
----
-- name: collect all cli test cases
- find:
- paths: "{{ role_path }}/tests/cli"
- patterns: "{{ testcase }}.yaml"
- register: test_cases
-
-- name: set test_items
- set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-
-- name: run test case
- include: "{{ test_case_to_run }}"
- with_items: "{{ test_items }}"
- loop_control:
- loop_var: test_case_to_run
diff --git a/test/integration/targets/asa_config/tasks/main.yaml b/test/integration/targets/asa_config/tasks/main.yaml
deleted file mode 100644
index 415c99d8b1..0000000000
--- a/test/integration/targets/asa_config/tasks/main.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-- { include: cli.yaml, tags: ['cli'] }
diff --git a/test/integration/targets/asa_config/templates/basic/config.j2 b/test/integration/targets/asa_config/templates/basic/config.j2
deleted file mode 100644
index 779b731e13..0000000000
--- a/test/integration/targets/asa_config/templates/basic/config.j2
+++ /dev/null
@@ -1,3 +0,0 @@
-object-group network OG-ANSIBLE-TEMPLATE
- description this is a test
- network-object host 192.168.99.12
diff --git a/test/integration/targets/asa_config/templates/defaults/config.j2 b/test/integration/targets/asa_config/templates/defaults/config.j2
deleted file mode 100644
index 762e73dea0..0000000000
--- a/test/integration/targets/asa_config/templates/defaults/config.j2
+++ /dev/null
@@ -1,4 +0,0 @@
-object-group network OG-ANSIBLE-TEMPLATE-DEFAULT
- description this is a test
- network-object 10.0.0.0 255.255.255.0
- network-object 10.1.0.0 255.255.255.0
diff --git a/test/integration/targets/asa_config/tests/cli/backup.yaml b/test/integration/targets/asa_config/tests/cli/backup.yaml
deleted file mode 100644
index 39f53d3b5c..0000000000
--- a/test/integration/targets/asa_config/tests/cli/backup.yaml
+++ /dev/null
@@ -1,53 +0,0 @@
----
-- debug: msg="START cli/backup.yaml"
-
-- name: setup
- asa_config:
- commands:
- - no object-group network OG-ANSIBLE-TEMPLATE
- provider: "{{ cli }}"
- ignore_errors: yes
-
-- name: collect any backup files
- find:
- paths: "{{ role_path }}/backup"
- pattern: "{{ inventory_hostname_short }}_config*"
- register: backup_files
- delegate_to: localhost
-
-- name: delete backup files
- file:
- path: "{{ item.path }}"
- state: absent
- with_items: "{{backup_files.files|default([])}}"
-
-- name: configure device with config
- asa_config:
- src: basic/config.j2
- backup: yes
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "result.updates is defined"
-
-- name: collect any backup files
- find:
- paths: "{{ role_path }}/backup"
- pattern: "{{ inventory_hostname_short }}_config*"
- register: backup_files
- delegate_to: localhost
-
-- assert:
- that:
- - "backup_files.files is defined"
-
-- name: teardown
- asa_config:
- commands:
- - no object-group network OG-ANSIBLE-TEMPLATE
- provider: "{{ cli }}"
-
-- debug: msg="END cli/backup.yaml"
diff --git a/test/integration/targets/asa_config/tests/cli/basic.yaml b/test/integration/targets/asa_config/tests/cli/basic.yaml
deleted file mode 100644
index 2c7450f3d2..0000000000
--- a/test/integration/targets/asa_config/tests/cli/basic.yaml
+++ /dev/null
@@ -1,39 +0,0 @@
----
-- debug: msg="START cli/basic.yaml"
-
-- name: setup
- asa_config:
- commands:
- - no object-group network OG-ANSIBLE-TEMPLATE
- provider: "{{ cli }}"
- ignore_errors: yes
-
-- name: configure device with config
- asa_config:
- src: basic/config.j2
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "result.updates is defined"
-
-- name: check device with config
- asa_config:
- src: basic/config.j2
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == false"
- - "result.updates is not defined"
-
-- name: teardown
- asa_config:
- commands:
- - no object-group network OG-ANSIBLE-TEMPLATE
- provider: "{{ cli }}"
-
-- debug: msg="END cli/basic.yaml"
diff --git a/test/integration/targets/asa_config/tests/cli/defaults.yaml b/test/integration/targets/asa_config/tests/cli/defaults.yaml
deleted file mode 100644
index 184c2c404b..0000000000
--- a/test/integration/targets/asa_config/tests/cli/defaults.yaml
+++ /dev/null
@@ -1,45 +0,0 @@
----
-- debug: msg="START cli/defaults.yaml"
-
-- name: setup
- asa_config:
- commands:
- - no object-group network OG-ANSIBLE-TEMPLATE-DEFAULT
- provider: "{{ cli }}"
- ignore_errors: yes
-
-- name: configure device with defaults included
- asa_config:
- src: defaults/config.j2
- defaults: yes
- provider: "{{ cli }}"
- register: result
-
-- debug: var=result
-
-- assert:
- that:
- - "result.changed == true"
- - "result.updates is defined"
-
-- name: check device with defaults included
- asa_config:
- src: defaults/config.j2
- defaults: yes
- provider: "{{ cli }}"
- register: result
-
-- debug: var=result
-
-- assert:
- that:
- - "result.changed == false"
- - "result.updates is not defined"
-
-- name: teardown
- asa_config:
- commands:
- - no object-group network OG-ANSIBLE-TEMPLATE-DEFAULT
- provider: "{{ cli }}"
-
-- debug: msg="END cli/defaults.yaml"
diff --git a/test/integration/targets/asa_config/tests/cli/force.yaml b/test/integration/targets/asa_config/tests/cli/force.yaml
deleted file mode 100644
index c151cb6a0c..0000000000
--- a/test/integration/targets/asa_config/tests/cli/force.yaml
+++ /dev/null
@@ -1,41 +0,0 @@
----
-- debug: msg="START cli/force.yaml"
-
-- name: setup
- asa_config:
- commands:
- - no object-group network OG-ANSIBLE-TEMPLATE-DEFAULT
- provider: "{{ cli }}"
- ignore_errors: yes
-
-- name: configure device with config
- asa_config:
- src: basic/config.j2
- provider: "{{ cli }}"
- match: none
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "result.updates is defined"
-
-- name: check device with config
- asa_config:
- src: basic/config.j2
- provider: "{{ cli }}"
- match: none
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "result.updates is defined"
-
-- name: teardown
- asa_config:
- commands:
- - no object-group network OG-ANSIBLE-TEMPLATE-DEFAULT
- provider: "{{ cli }}"
-
-- debug: msg="END cli/force.yaml"
diff --git a/test/integration/targets/asa_config/tests/cli/more_system.yaml b/test/integration/targets/asa_config/tests/cli/more_system.yaml
deleted file mode 100644
index 62a7b82a25..0000000000
--- a/test/integration/targets/asa_config/tests/cli/more_system.yaml
+++ /dev/null
@@ -1,47 +0,0 @@
----
-- debug: msg="START cli/more_system.yaml"
-
-- name: setup
- asa_config:
- lines:
- - "clear configure tunnel-group 192.0.2.1"
- provider: "{{ cli }}"
- ignore_errors: yes
-
-
-- name: Prepare tunnel-group
- asa_config:
- before: tunnel-group 192.0.2.1 type ipsec-l2l
- lines:
- - "tunnel-group 192.0.2.1 ipsec-attributes"
- provider: "{{ cli }}"
-
-- name: Setup tunnel-group
- asa_config:
- parents: tunnel-group 192.0.2.1 ipsec-attributes
- lines:
- - "ikev1 pre-shared-key abc123"
- passwords: yes
- provider: "{{ cli }}"
-
-- name: Test idempotency
- asa_config:
- parents: tunnel-group 192.0.2.1 ipsec-attributes
- lines:
- - "ikev1 pre-shared-key abc123"
- passwords: yes
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- asa_config:
- lines:
- - "clear configure tunnel-group 192.0.2.1"
- provider: "{{ cli }}"
-
-
-- debug: msg="END cli/more_system.yaml"
diff --git a/test/integration/targets/asa_config/tests/cli/removal_error.yaml b/test/integration/targets/asa_config/tests/cli/removal_error.yaml
deleted file mode 100644
index d931d336d7..0000000000
--- a/test/integration/targets/asa_config/tests/cli/removal_error.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
----
-- debug: msg="START cli/removal_error.yaml"
-
-- name: setup
- asa_config:
- commands:
- - clear configure access-list ANSIBLE-DNS
- - no object-group network OGA-GOOGLE-DNS
- provider: "{{ cli }}"
- ignore_errors: yes
-
-- name: configure test object-group
- asa_config:
- parents: object-group network OGA-GOOGLE-DNS
- lines: network-object host 8.8.8.8
- provider: "{{ cli }}"
- register: result
-
-
-- name: configure test access-list
- asa_config:
- lines: access-list ANSIBLE-DNS extended permit udp any object-group OGA-GOOGLE-DNS eq domain
- provider: "{{ cli }}"
-
-- name: try to remove object-group (should fail)
- asa_config:
- commands:
- - no object-group network OGA-GOOGLE-DNS
- provider: "{{ cli }}"
- ignore_errors: yes
- register: result
-
-
-- name: Last command should fail
- assert:
- that:
- - "result.failed == true"
-
-- name: teardown
- asa_config:
- commands:
- - clear configure access-list ANSIBLE-DNS
- - no object-group network OGA-GOOGLE-DNS
- provider: "{{ cli }}"
-
-- debug: msg="END cli/removal_error.yaml"
diff --git a/test/integration/targets/asa_config/tests/cli/sublevel.yaml b/test/integration/targets/asa_config/tests/cli/sublevel.yaml
deleted file mode 100644
index 2435d9f32c..0000000000
--- a/test/integration/targets/asa_config/tests/cli/sublevel.yaml
+++ /dev/null
@@ -1,40 +0,0 @@
----
-- debug: msg="START cli/sublevel.yaml"
-
-- name: setup test
- asa_config:
- lines:
- - 'no object-group network OG-ANSIBLE-SUBLEVEL'
- provider: "{{ cli }}"
-
-- name: configure sub level command
- asa_config:
- lines: ['network-object host 192.168.10.1']
- parents: ['object-group network OG-ANSIBLE-SUBLEVEL']
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'object-group network OG-ANSIBLE-SUBLEVEL' in result.updates"
- - "'network-object host 192.168.10.1' in result.updates"
-
-- name: configure sub level command idempotent check
- asa_config:
- lines: ['network-object host 192.168.10.1']
- parents: ['object-group network OG-ANSIBLE-SUBLEVEL']
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- asa_config:
- lines:
- - 'no object-group network OG-ANSIBLE-SUBLEVEL'
- provider: "{{ cli }}"
-
-- debug: msg="END cli/sublevel.yaml"
diff --git a/test/integration/targets/asa_config/tests/cli/sublevel_block.yaml b/test/integration/targets/asa_config/tests/cli/sublevel_block.yaml
deleted file mode 100644
index 303eb4abf1..0000000000
--- a/test/integration/targets/asa_config/tests/cli/sublevel_block.yaml
+++ /dev/null
@@ -1,64 +0,0 @@
----
-- debug: msg="START cli/sublevel_block.yaml"
-
-- name: setup
- asa_command:
- commands:
- - show run object-group
- provider: "{{ cli }}"
- register: object_group
-
-- name: setup
- asa_config:
- lines:
- - no object-group network OG-ANSIBLE
- match: none
- provider: "{{ cli }}"
- #when: "'object-group network OG-ANSIBLE\n' in {{ object_group.stdout }}"
-
-- name: configure sub level command using block replace
- asa_config:
- lines:
- - network-object 192.168.10.0 255.255.255.0
- - network-object 192.168.20.0 255.255.255.0
- - network-object 192.168.30.0 255.255.255.0
- - network-object 192.168.40.0 255.255.255.0
- parents: ['object-group network OG-ANSIBLE']
- replace: block
- after: ['exit']
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'object-group network OG-ANSIBLE' in result.updates"
- - "'network-object 192.168.10.0 255.255.255.0' in result.updates"
- - "'network-object 192.168.20.0 255.255.255.0' in result.updates"
- - "'network-object 192.168.30.0 255.255.255.0' in result.updates"
- - "'network-object 192.168.40.0 255.255.255.0' in result.updates"
-
-- name: check sub level command using block replace
- asa_config:
- lines:
- - network-object 192.168.10.0 255.255.255.0
- - network-object 192.168.20.0 255.255.255.0
- - network-object 192.168.30.0 255.255.255.0
- - network-object 192.168.40.0 255.255.255.0
- parents: ['object-group network OG-ANSIBLE']
- replace: block
- after: ['exit']
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- asa_config:
- lines:
- - no object-group network OG-ANSIBLE
- provider: "{{ cli }}"
-
-- debug: msg="END cli/sublevel_block.yaml"
diff --git a/test/integration/targets/asa_config/tests/cli/sublevel_exact.yaml b/test/integration/targets/asa_config/tests/cli/sublevel_exact.yaml
deleted file mode 100644
index c2748caf4c..0000000000
--- a/test/integration/targets/asa_config/tests/cli/sublevel_exact.yaml
+++ /dev/null
@@ -1,64 +0,0 @@
----
-- debug: msg="START cli/sublevel_exact.yaml"
-
-- name: setup
- asa_config:
- lines:
- - network-object 192.168.10.0 255.255.255.0
- - network-object 192.168.20.0 255.255.255.0
- - network-object 192.168.30.0 255.255.255.0
- - network-object 192.168.40.0 255.255.255.0
- - network-object 192.168.50.0 255.255.255.0
- parents: ['object-group network OG-ANSIBLE-EXACT']
- before: ['no object-group network OG-ANSIBLE-EXACT']
- after: ['exit']
- provider: "{{ cli }}"
-
-- name: configure sub level command using exact match
- asa_config:
- lines:
- - network-object 192.168.10.0 255.255.255.0
- - network-object 192.168.20.0 255.255.255.0
- - network-object 192.168.30.0 255.255.255.0
- - network-object 192.168.40.0 255.255.255.0
- parents: ['object-group network OG-ANSIBLE-EXACT']
- after: ['exit']
- match: exact
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'object-group network OG-ANSIBLE-EXACT' in result.updates"
- - "'network-object 192.168.10.0 255.255.255.0' in result.updates"
- - "'network-object 192.168.20.0 255.255.255.0' in result.updates"
- - "'network-object 192.168.30.0 255.255.255.0' in result.updates"
- - "'network-object 192.168.40.0 255.255.255.0' in result.updates"
- - "'network-object 192.168.50.0 255.255.255.0' not in result.updates"
-
-- name: check sub level command using exact match
- asa_config:
- lines:
- - network-object 192.168.10.0 255.255.255.0
- - network-object 192.168.20.0 255.255.255.0
- - network-object 192.168.30.0 255.255.255.0
- - network-object 192.168.40.0 255.255.255.0
- - network-object 192.168.50.0 255.255.255.0
- parents: ['object-group network OG-ANSIBLE-EXACT']
- after: ['exit']
- match: exact
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- asa_config:
- lines:
- - no object-group network OG-ANSIBLE-EXACT
- provider: "{{ cli }}"
-
-- debug: msg="END cli/sublevel_exact.yaml"
diff --git a/test/integration/targets/asa_config/tests/cli/sublevel_strict.yaml b/test/integration/targets/asa_config/tests/cli/sublevel_strict.yaml
deleted file mode 100644
index 44ea7f8c2a..0000000000
--- a/test/integration/targets/asa_config/tests/cli/sublevel_strict.yaml
+++ /dev/null
@@ -1,61 +0,0 @@
----
-- debug: msg="START cli/sublevel_strict.yaml"
-
-- name: setup
- asa_config:
- lines:
- - network-object 192.168.10.0 255.255.255.0
- - network-object 192.168.20.0 255.255.255.0
- - network-object 192.168.30.0 255.255.255.0
- - network-object 192.168.40.0 255.255.255.0
- - network-object 192.168.50.0 255.255.255.0
- parents: ['object-group network OG-ANSIBLE-STRICT']
- before: ['no object-group network OG-ANSIBLE-STRICT']
- after: ['exit']
- provider: "{{ cli }}"
-
-- name: configure sub level command using strict match
- asa_config:
- lines:
- - network-object 192.168.10.0 255.255.255.0
- - network-object 192.168.20.0 255.255.255.0
- - network-object 192.168.30.0 255.255.255.0
- - network-object 192.168.40.0 255.255.255.0
- parents: ['object-group network OG-ANSIBLE-STRICT']
- match: strict
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: check sub level command using strict match
- asa_config:
- lines:
- - network-object 192.168.10.0 255.255.255.0
- - network-object 192.168.30.0 255.255.255.0
- - network-object 192.168.30.0 255.255.255.0
- parents: ['object-group network OG-ANSIBLE-STRICT']
- after: ['exit']
- match: strict
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'object-group network OG-ANSIBLE-STRICT' in result.updates"
- - "'network-object 192.168.10.0 255.255.255.0' not in result.updates"
- - "'network-object 192.168.30.0 255.255.255.0' in result.updates"
- - "'network-object 192.168.30.0 255.255.255.0' in result.updates"
- - "'network-object 192.168.40.0 255.255.255.0' not in result.updates"
- - "'network-object 192.168.50.0 255.255.255.0' not in result.updates"
-
-- name: teardown
- asa_config:
- lines:
- - no object-group network OG-ANSIBLE-STRICT
- provider: "{{ cli }}"
-
-- debug: msg="END cli/sublevel_strict.yaml"
diff --git a/test/integration/targets/asa_config/tests/cli/sublevel_strict_mul_parents.yaml b/test/integration/targets/asa_config/tests/cli/sublevel_strict_mul_parents.yaml
deleted file mode 100644
index 7ded013219..0000000000
--- a/test/integration/targets/asa_config/tests/cli/sublevel_strict_mul_parents.yaml
+++ /dev/null
@@ -1,66 +0,0 @@
----
-- debug: msg="START cli/sublevel_strict_mul_parents.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- asa_config:
- lines:
- - class-map c1
- - match default-inspection-traffic
- - policy-map p1
- - class c1
- before: ['no policy-map p1', 'no class-map c1']
- match: none
-
-- name: configure sub level command using strict match
- asa_config:
- lines:
- - inspect ftp
- - inspect tftp
- parents: ['policy-map p1', 'class c1']
- match: strict
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'inspect ftp' in result.updates"
- - "'inspect tftp' in result.updates"
-
-- name: change sub level command order and config with strict match
- asa_config:
- lines:
- - inspect tftp
- - inspect ftp
- parents: ['policy-map p1', 'class c1']
- match: strict
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'inspect ftp' in result.updates"
- - "'inspect tftp' in result.updates"
-
-- name: Config sub level command with strict match (Idempotency)
- asa_config:
- lines:
-#ASA does not change order of class action if reconfigured
-#so we have to use old order for Idempotency
- - inspect ftp
- - inspect tftp
- parents: ['policy-map p1', 'class c1']
- match: strict
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- asa_config:
- lines:
- - no policy-map p1
- - no class-map c1
- match: strict
-
-- debug: msg="END cli/sublevel_strict_mul_parents.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/asa_config/tests/cli/toplevel.yaml b/test/integration/targets/asa_config/tests/cli/toplevel.yaml
deleted file mode 100644
index c590bc781b..0000000000
--- a/test/integration/targets/asa_config/tests/cli/toplevel.yaml
+++ /dev/null
@@ -1,35 +0,0 @@
----
-- debug: msg="START cli/toplevel.yaml"
-
-- name: setup
- asa_config:
- lines: ['hostname firewall']
- provider: "{{ cli }}"
-
-- name: configure top level command
- asa_config:
- lines: ['hostname foo']
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'hostname foo' in result.updates"
-
-- name: configure top level command idempotent check
- asa_config:
- lines: ['hostname foo']
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- asa_config:
- lines: ['hostname {{ inventory_hostname_short }}']
- provider: "{{ cli }}"
-
-- debug: msg="END cli/toplevel.yaml"
diff --git a/test/integration/targets/asa_config/tests/cli/toplevel_after.yaml b/test/integration/targets/asa_config/tests/cli/toplevel_after.yaml
deleted file mode 100644
index 3bf0a35170..0000000000
--- a/test/integration/targets/asa_config/tests/cli/toplevel_after.yaml
+++ /dev/null
@@ -1,42 +0,0 @@
----
-- debug: msg="START cli/toplevel_after.yaml"
-
-- name: setup
- asa_config:
- lines:
- - "snmp-server contact ansible"
- - "hostname firewall"
- provider: "{{ cli }}"
-
-- name: configure top level command with before
- asa_config:
- lines: ['hostname foo']
- after: ['snmp-server contact bar']
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'hostname foo' in result.updates"
- - "'snmp-server contact bar' in result.updates"
-
-- name: configure top level command with before idempotent check
- asa_config:
- lines: ['hostname foo']
- after: ['snmp-server contact foo']
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- asa_config:
- lines:
- - "no snmp-server contact"
- - "hostname {{ inventory_hostname_short }}"
- provider: "{{ cli }}"
-
-- debug: msg="END cli/toplevel_after.yaml"
diff --git a/test/integration/targets/asa_config/tests/cli/toplevel_before.yaml b/test/integration/targets/asa_config/tests/cli/toplevel_before.yaml
deleted file mode 100644
index 4624e0df98..0000000000
--- a/test/integration/targets/asa_config/tests/cli/toplevel_before.yaml
+++ /dev/null
@@ -1,42 +0,0 @@
----
-- debug: msg="START cli/toplevel_before.yaml"
-
-- name: setup
- asa_config:
- lines:
- - "snmp-server contact ansible"
- - "hostname firewall"
- provider: "{{ cli }}"
-
-- name: configure top level command with before
- asa_config:
- lines: ['hostname foo']
- before: ['snmp-server contact bar']
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'hostname foo' in result.updates"
- - "'snmp-server contact bar' in result.updates"
-
-- name: configure top level command with before idempotent check
- asa_config:
- lines: ['hostname foo']
- before: ['snmp-server contact foo']
- provider: "{{ cli }}"
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- asa_config:
- lines:
- - "no snmp-server contact"
- - "hostname {{ inventory_hostname_short }}"
- provider: "{{ cli }}"
-
-- debug: msg="END cli/toplevel_before.yaml"
diff --git a/test/integration/targets/asa_config/tests/cli/toplevel_nonidempotent.yaml b/test/integration/targets/asa_config/tests/cli/toplevel_nonidempotent.yaml
deleted file mode 100644
index 314ef44164..0000000000
--- a/test/integration/targets/asa_config/tests/cli/toplevel_nonidempotent.yaml
+++ /dev/null
@@ -1,38 +0,0 @@
----
-- debug: msg="START cli/toplevel_nonidempotent.yaml"
-
-- name: setup
- asa_config:
- backup: true
- # lines: ['hostname firewall']
- provider: "{{ cli }}"
-
-- name: configure top level command
- asa_config:
- lines: ['hostname foo']
- provider: "{{ cli }}"
- match: strict
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'hostname foo' in result.updates"
-
-- name: configure top level command idempotent check
- asa_config:
- lines: ['hostname foo']
- provider: "{{ cli }}"
- match: strict
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: teardown
- asa_config:
- lines: ['hostname {{ inventory_hostname_short }}']
- provider: "{{ cli }}"
-
-- debug: msg="END cli/toplevel_nonidempotent.yaml"
diff --git a/test/integration/targets/asa_og/defaults/main.yaml b/test/integration/targets/asa_og/defaults/main.yaml
deleted file mode 100644
index 5f709c5aac..0000000000
--- a/test/integration/targets/asa_og/defaults/main.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-testcase: "*"
diff --git a/test/integration/targets/asa_og/tasks/cli.yaml b/test/integration/targets/asa_og/tasks/cli.yaml
deleted file mode 100644
index 303af40762..0000000000
--- a/test/integration/targets/asa_og/tasks/cli.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
----
-- name: collect all cli test cases
- find:
- paths: "{{ role_path }}/tests/cli"
- patterns: "{{ testcase }}.yaml"
- register: test_cases
- delegate_to: localhost
-
-- name: set test_items
- set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-
-- name: run test cases (connection=network_cli)
- include: "{{ test_case_to_run }}"
- with_items: "{{ test_items }}"
- loop_control:
- loop_var: test_case_to_run
-
-- name: run test case (connection=local)
- include: "{{ test_case_to_run }} ansible_connection=local"
- with_first_found: "{{ test_items }}"
- loop_control:
- loop_var: test_case_to_run
diff --git a/test/integration/targets/asa_og/tasks/main.yaml b/test/integration/targets/asa_og/tasks/main.yaml
deleted file mode 100644
index 415c99d8b1..0000000000
--- a/test/integration/targets/asa_og/tasks/main.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-- { include: cli.yaml, tags: ['cli'] }
diff --git a/test/integration/targets/asa_og/tests/cli/asa_og.yaml b/test/integration/targets/asa_og/tests/cli/asa_og.yaml
deleted file mode 100644
index f34edcbd50..0000000000
--- a/test/integration/targets/asa_og/tests/cli/asa_og.yaml
+++ /dev/null
@@ -1,541 +0,0 @@
----
-- name: remove test config if any
- asa_config:
- lines:
- - no object-group network ansible_test_0
- - no object-group network ansible_test_1
- - no object-group network ansible_test_2
- - no object-group service ansible_test_3 tcp-udp
- - no object-group service ansible_test_4
- - no object-group service ansible_test_5
- ignore_errors: true
-
-- block:
-
- - set_fact:
- name: ansible_test_0
- host_ip:
- - 8.8.8.8
- - 8.8.4.4
- address:
- - 10.0.0.0 255.0.0.0
- - 192.168.0.0 255.255.0.0
- - 172.16.0.0 255.255.0.0
- description: th1s_IS-a_D3scrIPt10n_3xaMple-
- group_object:
- - aws_commonservices_eu_ie_pci_prv
- - aws_commonservices_eu_ie_pci_elb_prv
-
- - name: STAGE 0
- asa_og: &config
- name: "{{ name }}"
- group_type: network-object
- state: present
- host_ip: "{{ host_ip }}"
- ip_mask: "{{ address }}"
- description: "{{ description }}"
- group_object: "{{ group_object }}"
- register: result
-
- - assert: &true
- that:
- - "result.changed == true"
-
- - name: idempotence check
- asa_og: *config
- register: result
-
- - assert: &false
- that:
- - "result.changed == false"
-
- - set_fact:
- name: ansible_test_0
- host_ip:
- - 8.8.9.9
- address:
- - 8.8.8.0 255.255.255.0
- group_object:
- - test_network_object_1
-
- - name: STAGE 1
- asa_og: &config1
- name: "{{ name }}"
- group_type: network-object
- state: present
- host_ip: "{{ host_ip }}"
- ip_mask: "{{ address }}"
- group_object: "{{ group_object }}"
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config1
- register: result
-
- - assert: *false
-
- - name: STAGE 1/B
- asa_og:
- name: "{{ name }}"
- group_type: network-object
- state: present
- register: result
-
- - assert: *false
-
- - set_fact:
- name: ansible_test_1
- host_ip:
- - 8.8.9.9
- address:
- - 8.8.8.0 255.255.255.0
- group_object:
- - test_network_object_1
-
- - name: STAGE 2
- asa_og: &config2
- name: "{{ name }}"
- group_type: network-object
- state: present
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config2
- register: result
-
- - assert: *false
-
- - name: STAGE 2b
- asa_og: &config2b
- name: "{{ name }}"
- group_type: network-object
- state: present
- host_ip: "{{ host_ip }}"
- ip_mask: "{{ address }}"
- group_object: "{{ group_object }}"
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config2b
- register: result
-
- - assert: *false
-
- - set_fact:
- name: ansible_test_0
- host_ip:
- - 8.8.8.8
- - 8.8.4.4
- address:
- - 10.0.0.0 255.0.0.0
- - 192.168.0.0 255.255.0.0
- - 172.16.0.0 255.255.0.0
- description: th1s_IS-a_D3scrIPt10n_3xaMple-
- group_object:
- - aws_commonservices_eu_ie_pci_prv
- - aws_commonservices_eu_ie_pci_elb_prv
-
- - name: STAGE 3
- asa_og: &config3
- name: "{{ name }}"
- group_type: network-object
- state: absent
- host_ip: "{{ host_ip }}"
- ip_mask: "{{ address }}"
- description: "{{ description }}"
- group_object: "{{ group_object }}"
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config3
- register: result
-
- - assert: *false
-
- - set_fact:
- name: ansible_test_2
- host_ip:
- - 8.8.8.8
- - 8.8.4.4
- address:
- - 10.0.0.0 255.0.0.0
- - 192.168.0.0 255.255.0.0
- - 172.16.0.0 255.255.0.0
- description: th1s_IS-a_D3scrIPt10n_3xaMple-
- group_object:
- - aws_commonservices_eu_ie_pci_prv
- - aws_commonservices_eu_ie_pci_elb_prv
-
- - name: STAGE 4
- asa_og: &config4
- name: "{{ name }}"
- group_type: network-object
- state: replace
- host_ip: "{{ host_ip }}"
- ip_mask: "{{ address }}"
- description: "{{ description }}"
- group_object: "{{ group_object }}"
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config4
- register: result
-
- - assert: *false
-
- - set_fact:
- name: ansible_test_2
- host_ip:
- - 8.8.8.8
- address:
- - 10.0.0.0 255.0.0.0
- - 1.0.0.0 255.255.0.0
- description: th1s_IS-a_D3scrIPt10n_3xaMple-
- group_object:
- - aws_commonservices_eu_ie_pci_prv
-
- - name: STAGE 5
- asa_og: &config5
- name: "{{ name }}"
- group_type: network-object
- state: replace
- host_ip: "{{ host_ip }}"
- ip_mask: "{{ address }}"
- description: "{{ description }}"
- group_object: "{{ group_object }}"
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config5
- register: result
-
- - assert: *false
-
- - set_fact:
- name: ansible_test_2
- host_ip:
- - 9.9.9.9
- - 8.8.8.8
- description: th1s_IS-a_D3scrIPt10n_3xaMple-
- group_object:
- - test_network_object_1
-
- - name: STAGE 6
- asa_og: &config6
- name: "{{ name }}"
- group_type: network-object
- state: replace
- host_ip: "{{ host_ip }}"
- ip_mask: "{{ address }}"
- description: "{{ description }}"
- group_object: "{{ group_object }}"
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config6
- register: result
-
- - assert: *false
-
- - set_fact:
- name: ansible_test_3
- port_eq:
- - www
- - '1024'
- description: th1s_IS-a_D3scrIPt10n_3xaMple-
- port_range:
- - '1024 10024'
-
- - name: STAGE 7
- asa_og: &config7
- name: "{{ name }}"
- protocol: tcp-udp
- port_eq: "{{ port_eq }}"
- port_range: "{{ port_range }}"
- group_type: port-object
- state: present
- description: "{{ description }}"
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config7
- register: result
-
- - assert: *false
-
- - set_fact:
- name: ansible_test_3
- port_eq:
- - talk
- - '65535'
- description: th1s_IS-a_D3scrIPt10n_3xaMple-
- port_range:
- - '1 100'
-
- - name: STAGE 8
- asa_og: &config8
- name: "{{ name }}"
- protocol: tcp-udp
- port_eq: "{{ port_eq }}"
- port_range: "{{ port_range }}"
- group_type: port-object
- state: present
- description: "{{ description }}"
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config8
- register: result
-
- - assert: *false
-
-
- - name: STAGE 9
- asa_og: &config9
- name: "{{ name }}"
- protocol: tcp-udp
- port_eq: "{{ port_eq }}"
- port_range: "{{ port_range }}"
- group_type: port-object
- state: absent
- description: "{{ description }}"
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config9
- register: result
-
- - assert: *false
-
- - set_fact:
- name: ansible_test_3
- port_eq:
- - talk
- - '65535'
- description: th1s_IS-a_D3scrIPt10n_3xaMple-
- port_range:
- - '1 100'
-
- - name: STAGE 10
- asa_og: &config10
- name: "{{ name }}"
- protocol: tcp-udp
- port_eq: "{{ port_eq }}"
- port_range: "{{ port_range }}"
- group_type: port-object
- state: replace
- description: "{{ description }}"
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config10
- register: result
-
- - assert: *false
-
- - set_fact:
- name: ansible_test_3
- port_eq:
- - talk
- - www
- - kerberos
- description: th1s_ISWhatitIS
- port_range:
- - '1024 1234'
-
- - name: STAGE 11
- asa_og: &config11
- name: "{{ name }}"
- protocol: tcp-udp
- port_eq: "{{ port_eq }}"
- port_range: "{{ port_range }}"
- group_type: port-object
- state: replace
- description: "{{ description }}"
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config11
- register: result
-
- - assert: *false
-
- - set_fact:
- name: ansible_test_4
- service_cfg:
- - tcp destination eq 8080
- - tcp destination eq www
- description: th1s_ISWhatitIS
-
- - name: STAGE 12
- asa_og: &config12
- name: "{{ name }}"
- service_cfg: "{{ service_cfg }}"
- group_type: service-object
- state: present
- description: "{{ description }}"
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config12
- register: result
-
- - assert: *false
-
- - set_fact:
- name: ansible_test_4
- service_cfg:
- - tcp destination range 1234 5678
- - tcp destination range 5678 6789
- description: th1s_ISWhatitIS
-
- - name: STAGE 13
- asa_og: &config13
- name: "{{ name }}"
- service_cfg: "{{ service_cfg }}"
- group_type: service-object
- state: present
- description: "{{ description }}"
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config13
- register: result
-
- - assert: *false
-
- - set_fact:
- name: ansible_test_4
- service_cfg:
- - tcp destination range 1234 5678
- - tcp destination range 5678 6789
- description: th1s_ISWhatitIS
-
- - name: STAGE 14
- asa_og: &config14
- name: "{{ name }}"
- service_cfg: "{{ service_cfg }}"
- group_type: service-object
- state: absent
- description: "{{ description }}"
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config14
- register: result
-
- - assert: *false
-
- - set_fact:
- name: ansible_test_5
- service_cfg:
- - tcp destination range 1234 5678
- - tcp destination range 5678 6789
- description: th1s_ISWhatitIS
-
- - name: STAGE 15
- asa_og: &config15
- name: "{{ name }}"
- service_cfg: "{{ service_cfg }}"
- group_type: service-object
- state: replace
- description: "{{ description }}"
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config15
- register: result
-
- - assert: *false
-
- - set_fact:
- name: ansible_test_5
- service_cfg:
- - tcp destination range 1234 5678
- - tcp destination range 5678 6789
- - tcp destination eq www
- description: th1s_ISWhatitIS
-
- - name: STAGE 16
- asa_og: &config16
- name: "{{ name }}"
- service_cfg: "{{ service_cfg }}"
- group_type: service-object
- state: replace
- description: "{{ description }}"
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config16
- register: result
-
- - assert: *false
-
- - set_fact:
- name: ansible_test_5
- service_cfg:
- - tcp destination eq 8080
- description: th1s_ISWhatitIS
-
- - name: STAGE 17
- asa_og: &config17
- name: "{{ name }}"
- service_cfg: "{{ service_cfg }}"
- group_type: service-object
- state: replace
- description: "{{ description }}"
- register: result
-
- - assert: *true
-
- - name: idempotence check
- asa_og: *config17
- register: result
-
- - assert: *false
-
- always:
- - name: remove test config if any
- asa_config:
- lines:
- - no object-group network ansible_test_0
- - no object-group network ansible_test_1
- - no object-group network ansible_test_2
- - no object-group service ansible_test_3 tcp-udp
- - no object-group service ansible_test_4
- - no object-group service ansible_test_5
- ignore_errors: true