finish migration

This commit is contained in:
Valentin Gurmeza 2018-01-24 15:25:43 -08:00
parent 86e8e6c295
commit 87630ba6f5
3 changed files with 42 additions and 45 deletions

View file

@ -30,6 +30,7 @@ options:
options: options:
- ethernet - ethernet
- vlan - vlan
- ovpn-client
settings: settings:
description: description:
- All Mikrotik compatible parameters for this particular endpoint. - All Mikrotik compatible parameters for this particular endpoint.

View file

@ -22,35 +22,21 @@ options:
description: description:
- password used for authentication to mikrotik router - password used for authentication to mikrotik router
required: True required: True
parameter:
description:
- sub endpoint for mikrotik system
required: True
options:
- scheduler
settings:
description:
- All Mikrotik compatible parameters for this particular endpoint.
Any yes/no values must be enclosed in double quotes
required: True
state: state:
description: description:
- scheduler task present or absent - absent or present
required: True required: True
choices:
- present
- absent
comment:
description:
- task comment
interval:
description:
- interval between two script executions, if time interval is set to zero, the script is only executed at its start time, otherwise it is executed repeatedly at the time interval is specified
name:
description:
- name of the task
required: True
on_event:
description:
- name of the script to execute.
start_date:
description:
- date of the first script execution
start_time:
description:
- time of the first script execution
policy:
description:
- policy
''' '''
EXAMPLES = ''' EXAMPLES = '''
@ -59,9 +45,10 @@ EXAMPLES = '''
username: "{{ mt_user }}" username: "{{ mt_user }}"
password: "{{ mt_pass }}" password: "{{ mt_pass }}"
state: present state: present
name: test_by_ansible parameter: scheduler
comment: ansible_test name: test_by_ansible
on_event: put "hello" comment: ansible_test
on_event: put "hello"
''' '''
from ansible.module_utils.mt_common import clean_params, MikrotikIdempotent from ansible.module_utils.mt_common import clean_params, MikrotikIdempotent
@ -81,7 +68,7 @@ def main():
type = 'str' type = 'str'
), ),
state = dict( state = dict(
required = False, required = True,
choices = ['present', 'absent'], choices = ['present', 'absent'],
type = 'str' type = 'str'
) )

View file

@ -18,19 +18,22 @@
username: "{{ mt_user }}" username: "{{ mt_user }}"
password: "{{ mt_pass }}" password: "{{ mt_pass }}"
state: present state: present
name: ansible_test parameter: scheduler
on_event: 'put "test"' settings:
interval: 5s name: ansible_test
policy: on_event: 'put "test"'
- password interval: 5s
- sniff policy:
- write - password
- sniff
- write
register: scheduler_mod register: scheduler_mod
failed_when: ( failed_when: (
not ansible_check_mode not ansible_check_mode
) and ( ) and (
not ( scheduler_mod | changed ) not ( scheduler_mod | changed )
) )
tags: test1
- name: NEVER_CHANGES add duplicate scheduler - name: NEVER_CHANGES add duplicate scheduler
mt_system_scheduler: mt_system_scheduler:
@ -38,19 +41,22 @@
username: "{{ mt_user }}" username: "{{ mt_user }}"
password: "{{ mt_pass }}" password: "{{ mt_pass }}"
state: present state: present
name: ansible_test parameter: scheduler
on_event: 'put "test"' settings:
interval: 5s name: ansible_test
policy: on_event: 'put "test"'
- password interval: 5s
- sniff policy:
- write - password
- sniff
- write
register: scheduler_dup register: scheduler_dup
failed_when: ( failed_when: (
not ansible_check_mode not ansible_check_mode
) and ( ) and (
( scheduler_dup | changed ) ( scheduler_dup | changed )
) )
tags: test1
- name: ALWAYS_CHANGES remove duplicate scheduler - name: ALWAYS_CHANGES remove duplicate scheduler
mt_system_scheduler: mt_system_scheduler:
@ -58,10 +64,13 @@
username: "{{ mt_user }}" username: "{{ mt_user }}"
password: "{{ mt_pass }}" password: "{{ mt_pass }}"
state: absent state: absent
name: ansible_test parameter: scheduler
settings:
name: ansible_test
register: scheduler_rem register: scheduler_rem
failed_when: ( failed_when: (
not ansible_check_mode not ansible_check_mode
) and ( ) and (
not ( scheduler_rem | changed ) not ( scheduler_rem | changed )
) )
tags: test1