mirror of
https://github.com/zahodi/ansible-mikrotik.git
synced 2025-08-03 17:45:09 +02:00
167 lines
4.1 KiB
YAML
167 lines
4.1 KiB
YAML
- name: Test adding a radius item
|
|
mt_radius:
|
|
hostname: "{{ mt_hostname }}"
|
|
username: "{{ mt_user }}"
|
|
password: "{{ mt_pass }}"
|
|
state: "present"
|
|
parameter: radius
|
|
settings:
|
|
address: "192.168.12.2"
|
|
comment: 'Ansible - radius test 1'
|
|
secret: 'password'
|
|
service:
|
|
- login
|
|
- hotspot
|
|
- wireless
|
|
timeout: '2s500ms'
|
|
|
|
- name: ALWAYS_CHANGES Test editing an existing radius item (edit service item)
|
|
mt_radius:
|
|
hostname: "{{ mt_hostname }}"
|
|
username: "{{ mt_user }}"
|
|
password: "{{ mt_pass }}"
|
|
state: "present"
|
|
parameter: radius
|
|
settings:
|
|
address: "192.168.12.2"
|
|
comment: 'Ansible - radius test 1'
|
|
secret: 'password'
|
|
service:
|
|
- login
|
|
- hotspot
|
|
- wireless
|
|
- dhcp
|
|
timeout: '2s500ms'
|
|
register: radius_test_1_edit
|
|
failed_when: (
|
|
not ansible_check_mode
|
|
) and (
|
|
not ( radius_test_1_edit | changed )
|
|
)
|
|
|
|
- name: ALWAYS_CHANGES Test editing an existing radius item (change service list)
|
|
mt_radius:
|
|
hostname: "{{ mt_hostname }}"
|
|
username: "{{ mt_user }}"
|
|
password: "{{ mt_pass }}"
|
|
state: "present"
|
|
parameter: radius
|
|
settings:
|
|
address: "192.168.12.2"
|
|
comment: 'Ansible - radius test 1'
|
|
secret: 'password'
|
|
service:
|
|
- login
|
|
- hotspot
|
|
- wireless
|
|
timeout: '2s500ms'
|
|
register: radius_test_1_edit
|
|
failed_when: (
|
|
not ansible_check_mode
|
|
) and (
|
|
not ( radius_test_1_edit | changed )
|
|
)
|
|
|
|
- name: Test adding a duplicate of the first radius item
|
|
mt_radius:
|
|
hostname: "{{ mt_hostname }}"
|
|
username: "{{ mt_user }}"
|
|
password: "{{ mt_pass }}"
|
|
state: "present"
|
|
parameter: radius
|
|
settings:
|
|
address: "192.168.12.2"
|
|
comment: 'Ansible - radius test 1'
|
|
secret: 'password'
|
|
service:
|
|
- login
|
|
- hotspot
|
|
- wireless
|
|
timeout: '2s500ms'
|
|
register: radius_test_1_duplicate
|
|
failed_when: (
|
|
not ansible_check_mode
|
|
) and (
|
|
( radius_test_1_duplicate|changed )
|
|
)
|
|
|
|
- name: ALWAYS_CHANGES Test adding another radius item to later remove
|
|
mt_radius:
|
|
hostname: "{{ mt_hostname }}"
|
|
username: "{{ mt_user }}"
|
|
password: "{{ mt_pass }}"
|
|
state: "present"
|
|
parameter: radius
|
|
settings:
|
|
address: "192.168.12.2"
|
|
comment: 'Ansible - radius test 2'
|
|
secret: 'password'
|
|
service:
|
|
- login
|
|
- hotspot
|
|
- wireless
|
|
timeout: '2s500ms'
|
|
register: radius_test_2
|
|
failed_when: (
|
|
not ansible_check_mode
|
|
) and (
|
|
not ( radius_test_2 | changed )
|
|
)
|
|
|
|
- name: ALWAYS_CHANGES Test removing a radius item
|
|
mt_radius:
|
|
hostname: "{{ mt_hostname }}"
|
|
username: "{{ mt_user }}"
|
|
password: "{{ mt_pass }}"
|
|
state: "absent"
|
|
parameter: radius
|
|
settings:
|
|
comment: 'Ansible - radius test 2'
|
|
register: radius_test_2_rem
|
|
failed_when: (
|
|
not ansible_check_mode
|
|
) and (
|
|
not ( radius_test_2_rem | changed )
|
|
)
|
|
|
|
- name: Change incoming settings
|
|
mt_radius:
|
|
hostname: "{{ mt_hostname }}"
|
|
username: "{{ mt_user }}"
|
|
password: "{{ mt_pass }}"
|
|
parameter: incoming
|
|
settings:
|
|
accept: "true"
|
|
port: "37988"
|
|
|
|
- name: ALWAYS_CHANGES Change incoming settings
|
|
mt_radius:
|
|
hostname: "{{ mt_hostname }}"
|
|
username: "{{ mt_user }}"
|
|
password: "{{ mt_pass }}"
|
|
parameter: incoming
|
|
settings:
|
|
accept: "true"
|
|
port: "37955"
|
|
register: change_incoming
|
|
failed_when: (
|
|
not ansible_check_mode
|
|
) and (
|
|
not ( change_incoming | changed )
|
|
)
|
|
|
|
- name: NEVER_CHANGES check idempotency of incoming settings
|
|
mt_radius:
|
|
hostname: "{{ mt_hostname }}"
|
|
username: "{{ mt_user }}"
|
|
password: "{{ mt_pass }}"
|
|
parameter: incoming
|
|
settings:
|
|
accept: "true"
|
|
port: "37955"
|
|
register: idem_incoming
|
|
failed_when: (
|
|
not ansible_check_mode
|
|
) and (
|
|
( idem_incoming | changed )
|
|
)
|