mirror of
https://github.com/zahodi/ansible-mikrotik.git
synced 2025-08-02 09:04:34 +02:00
73 lines
1.8 KiB
YAML
73 lines
1.8 KiB
YAML
---
|
|
- name: Test adding a firewall address-list
|
|
mt_ip:
|
|
hostname: "{{ mt_hostname }}"
|
|
username: "{{ mt_user }}"
|
|
password: "{{ mt_pass }}"
|
|
state: "present"
|
|
parameter: 'firewall/address-list'
|
|
settings: "{{ item }}"
|
|
with_items:
|
|
- address: 192.168.1.2
|
|
comment: dns1
|
|
list: test_list
|
|
- address: 192.168.1.3
|
|
comment: dns2
|
|
list: test_list
|
|
- address: 192.168.1.6
|
|
comment: test_comment3
|
|
list: test_list
|
|
|
|
- name: ALWAYS_CHANGES Test editing a firewall address-list
|
|
mt_ip:
|
|
hostname: "{{ mt_hostname }}"
|
|
username: "{{ mt_user }}"
|
|
password: "{{ mt_pass }}"
|
|
state: "present"
|
|
parameter: 'firewall/address-list'
|
|
settings:
|
|
address: 192.168.1.2
|
|
comment: dns1
|
|
list: test_list2
|
|
register: address_list_edit_1
|
|
failed_when: (
|
|
not ansible_check_mode
|
|
) and (
|
|
not ( address_list_edit_1 | changed )
|
|
)
|
|
|
|
- name: NEVER_CHANGES Test adding a duplicate address-list
|
|
mt_ip:
|
|
hostname: "{{ mt_hostname }}"
|
|
username: "{{ mt_user }}"
|
|
password: "{{ mt_pass }}"
|
|
state: "present"
|
|
parameter: 'firewall/address-list'
|
|
settings:
|
|
address: 192.168.1.3
|
|
comment: dns2
|
|
list: test_list
|
|
register: add_address_list_add_dup_1
|
|
failed_when: (
|
|
not ansible_check_mode
|
|
) and (
|
|
( add_address_list_add_dup_1 | changed )
|
|
)
|
|
|
|
- name: ALWAYS_CHANGES Test removing a firewall address-list
|
|
mt_ip:
|
|
hostname: "{{ mt_hostname }}"
|
|
username: "{{ mt_user }}"
|
|
password: "{{ mt_pass }}"
|
|
state: "absent"
|
|
parameter: 'firewall/address-list'
|
|
settings:
|
|
address: 192.168.1.2
|
|
comment: dns1
|
|
list: test_list
|
|
register: address_list_rem_1
|
|
failed_when: (
|
|
not ansible_check_mode
|
|
) and (
|
|
not ( address_list_rem_1 | changed )
|
|
)
|