mirror of
https://github.com/zahodi/ansible-mikrotik.git
synced 2025-08-05 02:24:40 +02:00
- check for lists in mt_common - move current radius module to a backup - radius use common class - move a radius and hotspot tests to tasks/
129 lines
3.2 KiB
YAML
129 lines
3.2 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 (change address)
|
|
mt_radius:
|
|
hostname: "{{ mt_hostname }}"
|
|
username: "{{ mt_user }}"
|
|
password: "{{ mt_pass }}"
|
|
state: "present"
|
|
parameter: radius
|
|
settings:
|
|
address: "192.168.12.19"
|
|
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 address back)
|
|
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 )
|
|
)
|
|
|
|
# incoming:
|
|
# accept: "true"
|
|
# port: "37988"
|