diff --git a/tests/integration/targets/cs_firewall/aliases b/tests/integration/targets/cs_firewall/aliases deleted file mode 100644 index c89c86d..0000000 --- a/tests/integration/targets/cs_firewall/aliases +++ /dev/null @@ -1,2 +0,0 @@ -cloud/cs -shippable/cs/group1 diff --git a/tests/integration/targets/firewall/aliases b/tests/integration/targets/firewall/aliases new file mode 100644 index 0000000..2ce8657 --- /dev/null +++ b/tests/integration/targets/firewall/aliases @@ -0,0 +1,3 @@ +cloud/cs +cs/group1 +cs/group3 diff --git a/tests/integration/targets/cs_firewall/defaults/main.yml b/tests/integration/targets/firewall/defaults/main.yml similarity index 100% rename from tests/integration/targets/cs_firewall/defaults/main.yml rename to tests/integration/targets/firewall/defaults/main.yml diff --git a/tests/integration/targets/cs_firewall/meta/main.yml b/tests/integration/targets/firewall/meta/main.yml similarity index 100% rename from tests/integration/targets/cs_firewall/meta/main.yml rename to tests/integration/targets/firewall/meta/main.yml diff --git a/tests/integration/targets/cs_firewall/tasks/main.yml b/tests/integration/targets/firewall/tasks/main.yml similarity index 60% rename from tests/integration/targets/cs_firewall/tasks/main.yml rename to tests/integration/targets/firewall/tasks/main.yml index 923e6c2..8d0c0fc 100644 --- a/tests/integration/targets/cs_firewall/tasks/main.yml +++ b/tests/integration/targets/firewall/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: network setup - cs_network: + ngine_io.cloudstack.network: name: "{{ cs_firewall_network }}" network_offering: DefaultIsolatedNetworkOfferingWithSourceNatService network_domain: example.com @@ -8,7 +8,7 @@ register: net - name: setup instance to get network in implementation state - cs_instance: + ngine_io.cloudstack.instance: name: "{{ cs_resource_prefix }}-vm-cs-firewall" template: "{{ cs_common_template }}" service_offering: "{{ cs_common_service_offering }}" @@ -22,43 +22,43 @@ - name: verify instance setup assert: that: - - instance is successful + - instance is successful - name: public ip address setup - cs_ip_address: + ngine_io.cloudstack.ip_address: network: ansible test zone: "{{ cs_common_zone_adv }}" register: ip_address - name: verify public ip address setup assert: that: - - ip_address is successful + - ip_address is successful - name: set ip address as fact set_fact: - cs_firewall_ip_address: "{{ ip_address.ip_address }}" + ngine_io.cloudstack.firewall_ip_address: "{{ ip_address.ip_address }}" - name: setup 80 - cs_firewall: + ngine_io.cloudstack.firewall: port: 80 ip_address: "{{ cs_firewall_ip_address }}" zone: "{{ cs_common_zone_adv }}" state: absent - name: setup 5300 - cs_firewall: + ngine_io.cloudstack.firewall: ip_address: "{{ cs_firewall_ip_address }}" protocol: udp start_port: 5300 end_port: 5333 cidrs: - - 1.2.3.0/24 - - 4.5.6.0/24 + - 1.2.3.0/24 + - 4.5.6.0/24 zone: "{{ cs_common_zone_adv }}" state: absent - name: setup all - cs_firewall: + ngine_io.cloudstack.firewall: network: "{{ cs_firewall_network }}" protocol: all type: egress @@ -66,18 +66,18 @@ state: absent - name: test fail if missing params - cs_firewall: + ngine_io.cloudstack.firewall: register: fw ignore_errors: true - name: verify results of fail if missing params assert: that: - - fw is failed - - "fw.msg == 'missing required arguments: zone'" + - fw is failed + - "fw.msg == 'missing required arguments: zone'" - name: test fail if missing params - cs_firewall: + ngine_io.cloudstack.firewall: zone: "{{ cs_common_zone_adv }}" register: fw ignore_errors: true @@ -85,11 +85,11 @@ - name: verify results of fail if missing params assert: that: - - fw is failed - - "fw.msg == 'one of the following is required: ip_address, network'" + - fw is failed + - "fw.msg == 'one of the following is required: ip_address, network'" - name: test fail if missing params - cs_firewall: + ngine_io.cloudstack.firewall: ip_address: "{{ cs_firewall_ip_address }}" zone: "{{ cs_common_zone_adv }}" register: fw @@ -97,11 +97,11 @@ - name: verify results of fail if missing params assert: that: - - fw is failed - - "fw.msg == \"missing required argument for protocol 'tcp': start_port or end_port\"" + - fw is failed + - 'fw.msg == "missing required argument for protocol ''tcp'': start_port or end_port"' - name: test fail if missing params network egress - cs_firewall: + ngine_io.cloudstack.firewall: type: egress zone: "{{ cs_common_zone_adv }}" register: fw @@ -109,11 +109,11 @@ - name: verify results of fail if missing params ip_address assert: that: - - fw is failed - - "fw.msg == 'one of the following is required: ip_address, network'" + - fw is failed + - "fw.msg == 'one of the following is required: ip_address, network'" - name: test present firewall rule ingress 80 in check mode - cs_firewall: + ngine_io.cloudstack.firewall: port: 80 ip_address: "{{ cs_firewall_ip_address }}" zone: "{{ cs_common_zone_adv }}" @@ -122,10 +122,10 @@ - name: verify results of present firewall rule ingress 80 in check mode assert: that: - - fw is changed + - fw is changed - name: test present firewall rule ingress 80 - cs_firewall: + ngine_io.cloudstack.firewall: port: 80 ip_address: "{{ cs_firewall_ip_address }}" zone: "{{ cs_common_zone_adv }}" @@ -133,17 +133,17 @@ - name: verify results of present firewall rule ingress 80 assert: that: - - fw is changed - - fw.cidr == "0.0.0.0/0" - - fw.cidrs == [ '0.0.0.0/0' ] - - fw.ip_address == "{{ cs_firewall_ip_address }}" - - fw.protocol == "tcp" - - fw.start_port == 80 - - fw.end_port == 80 - - fw.type == "ingress" + - fw is changed + - fw.cidr == "0.0.0.0/0" + - fw.cidrs == [ '0.0.0.0/0' ] + - fw.ip_address == cs_firewall_ip_address + - fw.protocol == "tcp" + - fw.start_port == 80 + - fw.end_port == 80 + - fw.type == "ingress" - name: test present firewall rule ingress 80 idempotence - cs_firewall: + ngine_io.cloudstack.firewall: port: 80 ip_address: "{{ cs_firewall_ip_address }}" zone: "{{ cs_common_zone_adv }}" @@ -151,80 +151,80 @@ - name: verify results of present firewall rule ingress 80 idempotence assert: that: - - fw is not changed - - fw.cidr == "0.0.0.0/0" - - fw.cidrs == [ '0.0.0.0/0' ] - - fw.ip_address == "{{ cs_firewall_ip_address }}" - - fw.protocol == "tcp" - - fw.start_port == 80 - - fw.end_port == 80 - - fw.type == "ingress" + - fw is not changed + - fw.cidr == "0.0.0.0/0" + - fw.cidrs == [ '0.0.0.0/0' ] + - fw.ip_address == cs_firewall_ip_address + - fw.protocol == "tcp" + - fw.start_port == 80 + - fw.end_port == 80 + - fw.type == "ingress" - name: test present firewall rule ingress 5300 in check mode - cs_firewall: + ngine_io.cloudstack.firewall: ip_address: "{{ cs_firewall_ip_address }}" protocol: udp start_port: 5300 end_port: 5333 cidrs: - - 1.2.3.0/24 - - 4.5.6.0/24 + - 1.2.3.0/24 + - 4.5.6.0/24 zone: "{{ cs_common_zone_adv }}" register: fw check_mode: true - name: verify results of present firewall rule ingress 5300 in check mode assert: that: - - fw is changed + - fw is changed - name: test present firewall rule ingress 5300 - cs_firewall: + ngine_io.cloudstack.firewall: ip_address: "{{ cs_firewall_ip_address }}" protocol: udp start_port: 5300 end_port: 5333 cidrs: - - 1.2.3.0/24 - - 4.5.6.0/24 + - 1.2.3.0/24 + - 4.5.6.0/24 zone: "{{ cs_common_zone_adv }}" register: fw - name: verify results of present firewall rule ingress 5300 assert: that: - - fw is changed - - fw.cidr == "1.2.3.0/24,4.5.6.0/24" - - fw.cidrs == [ '1.2.3.0/24', '4.5.6.0/24' ] - - fw.ip_address == "{{ cs_firewall_ip_address }}" - - fw.protocol == "udp" - - fw.start_port == 5300 - - fw.end_port == 5333 - - fw.type == "ingress" + - fw is changed + - fw.cidr == "1.2.3.0/24,4.5.6.0/24" + - fw.cidrs == [ '1.2.3.0/24', '4.5.6.0/24' ] + - fw.ip_address == cs_firewall_ip_address + - fw.protocol == "udp" + - fw.start_port == 5300 + - fw.end_port == 5333 + - fw.type == "ingress" - name: test present firewall rule ingress 5300 idempotence - cs_firewall: + ngine_io.cloudstack.firewall: ip_address: "{{ cs_firewall_ip_address }}" protocol: udp start_port: 5300 end_port: 5333 cidrs: - - 1.2.3.0/24 - - 4.5.6.0/24 + - 1.2.3.0/24 + - 4.5.6.0/24 zone: "{{ cs_common_zone_adv }}" register: fw - name: verify results of present firewall rule ingress 5300 idempotence assert: that: - - fw is not changed - - fw.cidr == "1.2.3.0/24,4.5.6.0/24" - - fw.cidrs == [ '1.2.3.0/24', '4.5.6.0/24' ] - - fw.ip_address == "{{ cs_firewall_ip_address }}" - - fw.protocol == "udp" - - fw.start_port == 5300 - - fw.end_port == 5333 - - fw.type == "ingress" + - fw is not changed + - fw.cidr == "1.2.3.0/24,4.5.6.0/24" + - fw.cidrs == [ '1.2.3.0/24', '4.5.6.0/24' ] + - fw.ip_address == cs_firewall_ip_address + - fw.protocol == "udp" + - fw.start_port == 5300 + - fw.end_port == 5333 + - fw.type == "ingress" - name: test present firewall rule egress all in check mode - cs_firewall: + ngine_io.cloudstack.firewall: network: "{{ cs_firewall_network }}" protocol: all type: egress @@ -234,10 +234,10 @@ - name: verify results of present firewall rule egress all in check mode assert: that: - - fw is changed + - fw is changed - name: test present firewall rule egress all - cs_firewall: + ngine_io.cloudstack.firewall: network: "{{ cs_firewall_network }}" protocol: all type: egress @@ -246,15 +246,15 @@ - name: verify results of present firewall rule egress all assert: that: - - fw is changed - - fw.cidr == "0.0.0.0/0" or fw.cidr == "10.1.1.0/24" - - fw.cidrs == [ '0.0.0.0/0' ] or fw.cidrs == [ '10.1.1.0/24' ] - - fw.network == "{{ cs_firewall_network }}" - - fw.protocol == "all" - - fw.type == "egress" + - fw is changed + - fw.cidr == "0.0.0.0/0" or fw.cidr == "10.1.1.0/24" + - fw.cidrs == [ '0.0.0.0/0' ] or fw.cidrs == [ '10.1.1.0/24' ] + - fw.network == cs_firewall_network + - fw.protocol == "all" + - fw.type == "egress" - name: test present firewall rule egress all idempotence - cs_firewall: + ngine_io.cloudstack.firewall: network: "{{ cs_firewall_network }}" protocol: all type: egress @@ -263,15 +263,15 @@ - name: verify results of present firewall rule egress all idempotence assert: that: - - fw is not changed - - fw.cidr == "0.0.0.0/0" or fw.cidr == "10.1.1.0/24" - - fw.cidrs == [ '0.0.0.0/0' ] or fw.cidrs == [ '10.1.1.0/24' ] - - fw.network == "{{ cs_firewall_network }}" - - fw.protocol == "all" - - fw.type == "egress" + - fw is not changed + - fw.cidr == "0.0.0.0/0" or fw.cidr == "10.1.1.0/24" + - fw.cidrs == [ '0.0.0.0/0' ] or fw.cidrs == [ '10.1.1.0/24' ] + - fw.network == cs_firewall_network + - fw.protocol == "all" + - fw.type == "egress" - name: test absent firewall rule ingress 80 in check mode - cs_firewall: + ngine_io.cloudstack.firewall: port: 80 ip_address: "{{ cs_firewall_ip_address }}" zone: "{{ cs_common_zone_adv }}" @@ -281,17 +281,17 @@ - name: verify results of absent firewall rule ingress 80 in check mode assert: that: - - fw is changed - - fw.cidr == "0.0.0.0/0" - - fw.cidrs == [ '0.0.0.0/0' ] - - fw.ip_address == "{{ cs_firewall_ip_address }}" - - fw.protocol == "tcp" - - fw.start_port == 80 - - fw.end_port == 80 - - fw.type == "ingress" + - fw is changed + - fw.cidr == "0.0.0.0/0" + - fw.cidrs == [ '0.0.0.0/0' ] + - fw.ip_address == cs_firewall_ip_address + - fw.protocol == "tcp" + - fw.start_port == 80 + - fw.end_port == 80 + - fw.type == "ingress" - name: test absent firewall rule ingress 80 - cs_firewall: + ngine_io.cloudstack.firewall: port: 80 ip_address: "{{ cs_firewall_ip_address }}" zone: "{{ cs_common_zone_adv }}" @@ -300,17 +300,17 @@ - name: verify results of absent firewall rule ingress 80 assert: that: - - fw is changed - - fw.cidr == "0.0.0.0/0" - - fw.cidrs == [ '0.0.0.0/0' ] - - fw.ip_address == "{{ cs_firewall_ip_address }}" - - fw.protocol == "tcp" - - fw.start_port == 80 - - fw.end_port == 80 - - fw.type == "ingress" + - fw is changed + - fw.cidr == "0.0.0.0/0" + - fw.cidrs == [ '0.0.0.0/0' ] + - fw.ip_address == cs_firewall_ip_address + - fw.protocol == "tcp" + - fw.start_port == 80 + - fw.end_port == 80 + - fw.type == "ingress" - name: test absent firewall rule ingress 80 idempotence - cs_firewall: + ngine_io.cloudstack.firewall: port: 80 ip_address: "{{ cs_firewall_ip_address }}" zone: "{{ cs_common_zone_adv }}" @@ -319,17 +319,17 @@ - name: verify results of absent firewall rule ingress 80 idempotence assert: that: - - fw is not changed + - fw is not changed - name: test absent firewall rule ingress 5300 in check mode - cs_firewall: + ngine_io.cloudstack.firewall: ip_address: "{{ cs_firewall_ip_address }}" protocol: udp start_port: 5300 end_port: 5333 cidrs: - - 1.2.3.0/24 - - 4.5.6.0/24 + - 1.2.3.0/24 + - 4.5.6.0/24 zone: "{{ cs_common_zone_adv }}" state: absent register: fw @@ -337,58 +337,58 @@ - name: verify results of absent firewall rule ingress 5300 in check mode assert: that: - - fw is changed - - fw.cidr == "1.2.3.0/24,4.5.6.0/24" - - fw.cidrs == [ '1.2.3.0/24', '4.5.6.0/24' ] - - fw.ip_address == "{{ cs_firewall_ip_address }}" - - fw.protocol == "udp" - - fw.start_port == 5300 - - fw.end_port == 5333 - - fw.type == "ingress" + - fw is changed + - fw.cidr == "1.2.3.0/24,4.5.6.0/24" + - fw.cidrs == [ '1.2.3.0/24', '4.5.6.0/24' ] + - fw.ip_address == cs_firewall_ip_address + - fw.protocol == "udp" + - fw.start_port == 5300 + - fw.end_port == 5333 + - fw.type == "ingress" - name: test absent firewall rule ingress 5300 - cs_firewall: + ngine_io.cloudstack.firewall: ip_address: "{{ cs_firewall_ip_address }}" protocol: udp start_port: 5300 end_port: 5333 cidrs: - - 1.2.3.0/24 - - 4.5.6.0/24 + - 1.2.3.0/24 + - 4.5.6.0/24 zone: "{{ cs_common_zone_adv }}" state: absent register: fw - name: verify results of absent firewall rule ingress 5300 assert: that: - - fw is changed - - fw.cidr == "1.2.3.0/24,4.5.6.0/24" - - fw.cidrs == [ '1.2.3.0/24', '4.5.6.0/24' ] - - fw.ip_address == "{{ cs_firewall_ip_address }}" - - fw.protocol == "udp" - - fw.start_port == 5300 - - fw.end_port == 5333 - - fw.type == "ingress" + - fw is changed + - fw.cidr == "1.2.3.0/24,4.5.6.0/24" + - fw.cidrs == [ '1.2.3.0/24', '4.5.6.0/24' ] + - fw.ip_address == cs_firewall_ip_address + - fw.protocol == "udp" + - fw.start_port == 5300 + - fw.end_port == 5333 + - fw.type == "ingress" - name: test absent firewall rule ingress 5300 idempotence - cs_firewall: + ngine_io.cloudstack.firewall: ip_address: "{{ cs_firewall_ip_address }}" protocol: udp start_port: 5300 end_port: 5333 cidrs: - - 1.2.3.0/24 - - 4.5.6.0/24 + - 1.2.3.0/24 + - 4.5.6.0/24 zone: "{{ cs_common_zone_adv }}" state: absent register: fw - name: verify results of absent firewall rule ingress 5300 idempotence assert: that: - - fw is not changed + - fw is not changed - name: test absent firewall rule egress all in check mode - cs_firewall: + ngine_io.cloudstack.firewall: network: "{{ cs_firewall_network }}" protocol: all type: egress @@ -399,15 +399,15 @@ - name: verify results of absent firewall rule egress all in check mode assert: that: - - fw is changed - - fw.cidr == "0.0.0.0/0" or fw.cidr == "10.1.1.0/24" - - fw.cidrs == [ '0.0.0.0/0' ] or fw.cidrs == [ '10.1.1.0/24' ] - - fw.network == "{{ cs_firewall_network }}" - - fw.protocol == "all" - - fw.type == "egress" + - fw is changed + - fw.cidr == "0.0.0.0/0" or fw.cidr == "10.1.1.0/24" + - fw.cidrs == [ '0.0.0.0/0' ] or fw.cidrs == [ '10.1.1.0/24' ] + - fw.network == cs_firewall_network + - fw.protocol == "all" + - fw.type == "egress" - name: test absent firewall rule egress all - cs_firewall: + ngine_io.cloudstack.firewall: network: "{{ cs_firewall_network }}" protocol: all type: egress @@ -417,15 +417,15 @@ - name: verify results of absent firewall rule egress all assert: that: - - fw is changed - - fw.cidr == "0.0.0.0/0" or fw.cidr == "10.1.1.0/24" - - fw.cidrs == [ '0.0.0.0/0' ] or fw.cidrs == [ '10.1.1.0/24' ] - - fw.network == "{{ cs_firewall_network }}" - - fw.protocol == "all" - - fw.type == "egress" + - fw is changed + - fw.cidr == "0.0.0.0/0" or fw.cidr == "10.1.1.0/24" + - fw.cidrs == [ '0.0.0.0/0' ] or fw.cidrs == [ '10.1.1.0/24' ] + - fw.network == cs_firewall_network + - fw.protocol == "all" + - fw.type == "egress" - name: test absent firewall rule egress all idempotence - cs_firewall: + ngine_io.cloudstack.firewall: network: "{{ cs_firewall_network }}" protocol: all type: egress @@ -435,10 +435,10 @@ - name: verify results of absent firewall rule egress all idempotence assert: that: - - fw is not changed + - fw is not changed - name: cleanup instance - cs_instance: + ngine_io.cloudstack.instance: name: "{{ cs_resource_prefix }}-vm-cs-firewall" zone: "{{ cs_common_zone_adv }}" state: expunged @@ -446,10 +446,10 @@ - name: verify instance cleanup assert: that: - - instance is successful + - instance is successful - name: network cleanup - cs_network: + ngine_io.cloudstack.network: name: "{{ cs_firewall_network }}" zone: "{{ cs_common_zone_adv }}" state: absent @@ -457,4 +457,4 @@ - name: verify network cleanup assert: that: - - net is successful + - net is successful