diff --git a/demos/networking/dmvpn/ios_hub.j2 b/demos/networking/dmvpn/ios_hub.j2 index e931b769f..36a081e4b 100644 --- a/demos/networking/dmvpn/ios_hub.j2 +++ b/demos/networking/dmvpn/ios_hub.j2 @@ -13,13 +13,13 @@ crypto ipsec transform-set {{ dmvpn_transform_set | default('xform')}} esp-aes 2 mode transport ! router ospf 1 - network {{ dmvpn_network | ipaddr('network')}} 0.0.0.255 area 1 + network {{ dmvpn_network | ansible.netcommon.ipaddr('network')}} 0.0.0.255 area 1 ! crypto ipsec profile {{ dmvpn_ipsec_profile | default('ipsec-prof')}} set transform-set {{ dmvpn_transform_set | default('xform')}} ! interface Tunnel2 - ip address {{ dmvpn_network | ipaddr(254) | ipaddr('address') }} {{ dmvpn_network | ipaddr('netmask') }} + ip address {{ dmvpn_network | ansible.netcommon.ipaddr(254) | ansible.netcommon.ipaddr('address') }} {{ dmvpn_network | ansible.netcommon.ipaddr('netmask') }} no ip redirects ip mtu 1400 ip ospf network broadcast diff --git a/provisioner/tests/security_verify.yml b/provisioner/tests/security_verify.yml index 1a1694fb5..f7d853117 100644 --- a/provisioner/tests/security_verify.yml +++ b/provisioner/tests/security_verify.yml @@ -40,12 +40,12 @@ - name: Fail if eth0 is not in 172.16. or eth1 is not in 172.17. fail: msg: "IP address setup on ethX is not right on {{ inventory_hostname }}." - when: (((hostvars[inventory_hostname]['ansible_eth0']['ipv4']['address'] | ipaddr('172.16.0.0/16') | string) is not search('172')) or ((hostvars[inventory_hostname]['ansible_eth1']['ipv4']['address'] | ipaddr('172.17.0.0/16') | string) is not search('172'))) + when: (((hostvars[inventory_hostname]['ansible_eth0']['ipv4']['address'] | ansible.netcommon.ipaddr('172.16.0.0/16') | string) is not search('172')) or ((hostvars[inventory_hostname]['ansible_eth1']['ipv4']['address'] | ansible.netcommon.ipaddr('172.17.0.0/16') | string) is not search('172'))) - name: Fail if private_ip is not in 172.16. or private_ip2 is not in 172.17. fail: msg: "IP address setup on ethX is not right on {{ inventory_hostname }}." - when: (((hostvars[inventory_hostname]['private_ip'] | ipaddr('172.16.0.0/16') | string) is not search('172')) or ((hostvars[inventory_hostname]['private_ip2'] | ipaddr('172.17.0.0/16') | string) is not search('172'))) + when: (((hostvars[inventory_hostname]['private_ip'] | ansible.netcommon.ipaddr('172.16.0.0/16') | string) is not search('172')) or ((hostvars[inventory_hostname]['private_ip2'] | ansible.netcommon.ipaddr('172.17.0.0/16') | string) is not search('172'))) when: '"attack" in inventory_hostname' @@ -63,12 +63,12 @@ - name: Fail if eth0 is not in 172.16. or eth1 is not in 172.17. fail: msg: "IP address setup on ethX is not right on {{ inventory_hostname }}." - when: (((hostvars[inventory_hostname]['ansible_eth0']['ipv4']['address'] | ipaddr('172.16.0.0/16') | string) is not search('172')) or ((hostvars[inventory_hostname]['ansible_eth1']['ipv4']['address'] | ipaddr('172.17.0.0/16') | string) is not search('172'))) + when: (((hostvars[inventory_hostname]['ansible_eth0']['ipv4']['address'] | ansible.netcommon.ipaddr('172.16.0.0/16') | string) is not search('172')) or ((hostvars[inventory_hostname]['ansible_eth1']['ipv4']['address'] | ansible.netcommon.ipaddr('172.17.0.0/16') | string) is not search('172'))) - name: Fail if private_ip is not in 172.16. or private_ip2 is not in 172.17. fail: msg: "IP address setup on ethX is not right on {{ inventory_hostname }}." - when: (((hostvars[inventory_hostname]['private_ip'] | ipaddr('172.16.0.0/16') | string) is not search('172')) or ((hostvars[inventory_hostname]['private_ip2'] | ipaddr('172.17.0.0/16') | string) is not search('172'))) + when: (((hostvars[inventory_hostname]['private_ip'] | ansible.netcommon.ipaddr('172.16.0.0/16') | string) is not search('172')) or ((hostvars[inventory_hostname]['private_ip2'] | ansible.netcommon.ipaddr('172.17.0.0/16') | string) is not search('172'))) when: '"snort" in inventory_hostname' - name: Check Point - Windows part diff --git a/roles/manage_ec2_instances/tasks/inventory/addhost_security.yml b/roles/manage_ec2_instances/tasks/inventory/addhost_security.yml index ed994c86d..e845a60df 100644 --- a/roles/manage_ec2_instances/tasks/inventory/addhost_security.yml +++ b/roles/manage_ec2_instances/tasks/inventory/addhost_security.yml @@ -76,8 +76,8 @@ ansible_user: "{{ item.tags.username }}" ansible_port: "{{ ssh_port }}" ansible_ssh_private_key_file: "{{ playbook_dir }}/{{ec2_name_prefix}}/{{ec2_name_prefix}}-private.pem" - private_ip: "{{ item['network_interfaces']|map(attribute='private_ip_address')|list|ipaddr('172.16.0.0/16')|first }}" - private_ip2: "{{ item['network_interfaces']|map(attribute='private_ip_address')|list|ipaddr('172.17.0.0/16')|first }}" + private_ip: "{{ item['network_interfaces']|map(attribute='private_ip_address')|list|ansible.netcommon.ipaddr('172.16.0.0/16')|first }}" + private_ip2: "{{ item['network_interfaces']|map(attribute='private_ip_address')|list|ansible.netcommon.ipaddr('172.17.0.0/16')|first }}" groups: - security - security_connection_check @@ -111,8 +111,8 @@ ansible_user: "{{ item.tags.username }}" ansible_port: "{{ ssh_port }}" ansible_ssh_private_key_file: "{{ playbook_dir }}/{{ec2_name_prefix}}/{{ec2_name_prefix}}-private.pem" - private_ip: "{{ item['network_interfaces']|map(attribute='private_ip_address')|list|ipaddr('172.16.0.0/16')|first }}" - private_ip2: "{{ item['network_interfaces']|map(attribute='private_ip_address')|list|ipaddr('172.17.0.0/16')|first }}" + private_ip: "{{ item['network_interfaces']|map(attribute='private_ip_address')|list|ansible.netcommon.ipaddr('172.16.0.0/16')|first }}" + private_ip2: "{{ item['network_interfaces']|map(attribute='private_ip_address')|list|ansible.netcommon.ipaddr('172.17.0.0/16')|first }}" groups: - security - security_connection_check @@ -164,8 +164,8 @@ ansible_user: "{{ item.tags.username }}" ansible_port: "{{ ssh_port }}" ansible_ssh_private_key_file: "{{ playbook_dir }}/{{ec2_name_prefix}}/{{ec2_name_prefix}}-private.pem" - private_ip: "{{ item['network_interfaces']|map(attribute='private_ip_address')|list|ipaddr('172.16.0.0/16')|first }}" - private_ip2: "{{ item['network_interfaces']|map(attribute='private_ip_address')|list|ipaddr('172.17.0.0/16')|first }}" + private_ip: "{{ item['network_interfaces']|map(attribute='private_ip_address')|list|ansible.netcommon.ipaddr('172.16.0.0/16')|first }}" + private_ip2: "{{ item['network_interfaces']|map(attribute='private_ip_address')|list|ansible.netcommon.ipaddr('172.17.0.0/16')|first }}" groups: - security - checkpoint