Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/tool/e-mail "tls" parameter cannot be set #179

Closed
derdeagle opened this issue Jun 12, 2023 · 0 comments · Fixed by #180
Closed

/tool/e-mail "tls" parameter cannot be set #179

derdeagle opened this issue Jun 12, 2023 · 0 comments · Fixed by #180

Comments

@derdeagle
Copy link
Contributor

SUMMARY

For the /tool/e-mail command the parameter tls is not accepted although is is mentioned in the fine manual. I don't know exactly when it was changed. start-tls was removed and tls was added.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.routeros.api_modify

ANSIBLE VERSION
ansible [core 2.15.0]
  config file = /home/username/ansible-mikrotik/ansible.cfg
  configured module search path = ['/home/username/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.11/site-packages/ansible
  ansible collection location = /home/username/.ansible/collections:/usr/share/ansible/collections
  executable location = /sbin/ansible
  python version = 3.11.3 (main, Apr  5 2023, 15:52:25) [GCC 12.2.1 20230201] (/usr/bin/python)
  jinja version = 3.1.2
  libyaml = True

COLLECTION VERSION
# /home/username/.ansible/collections/ansible_collections
Collection         Version
------------------ -------
community.routeros 2.8.0  

# /usr/lib/python3.11/site-packages/ansible_collections
Collection         Version
------------------ -------
community.routeros 2.8.0  

CONFIGURATION
CONFIG_FILE() = /home/username/ansible-mikrotik/ansible.cfg
DEFAULT_HOST_LIST(/home/username/ansible-mikrotik/ansible.cfg) = ['/home/username/ansible-mikrotik/hosts']
OS / ENVIRONMENT

I don't think this is relevant.

STEPS TO REPRODUCE

Playbook

---
- hosts: "mikrotik_devices"
  connection: "local"
  gather_facts: "no"
  tasks:
  - name: "Manage /tool/e-mail"
    community.routeros.api_modify:
      hostname: '{{ hostvars[inventory_hostname]["api_hostname"]|default(inventory_hostname) }}'
      username: '{{ hostvars[inventory_hostname]["api_username"] }}'
      password: '{{ hostvars[inventory_hostname]["api_password"] }}'
      tls: True
      validate_certs: False
      encoding: "UTF-8"
      handle_entries_content: "remove_as_much_as_possible"
      path: "tool e-mail"
      data: '{{ hostvars[inventory_hostname]["tool"]["e-mail"]["data"]|default([]) }}'

Data

tool:
  e-mail:
    data:
    - address: "mail.example.com"
      from: "router@example.com"
      password: "asdf123"
      port: 587
      tls: "starttls"
      user: "username"
EXPECTED RESULTS

I expect the email settings to be applied.

ACTUAL RESULTS
FAILED! => {"changed": false, "msg": "Unknown key \"tls\"."}
derdeagle added a commit to derdeagle/community.routeros that referenced this issue Jun 12, 2023
In the
[documentation](https://help.mikrotik.com/docs/display/ROS/E-mail#Email-Properties) the parameter "tls" is mentioned but it cannot be used. The old "start-tls" parameter is not mentioned there (only on the [old documentation](https://wiki.mikrotik.com/wiki/Manual:Tools/email#Properties)).
Trying to use the paramter "tls" lead to the erro message `FAILED! => {"changed": false, "msg": "Unknown key \"tls\"."}`.
felixfontein added a commit that referenced this issue Jun 19, 2023
* Fixes #179: Add missing /tool/e-mail parameter "tls"

In the
[documentation](https://help.mikrotik.com/docs/display/ROS/E-mail#Email-Properties) the parameter "tls" is mentioned but it cannot be used. The old "start-tls" parameter is not mentioned there (only on the [old documentation](https://wiki.mikrotik.com/wiki/Manual:Tools/email#Properties)).
Trying to use the paramter "tls" lead to the erro message `FAILED! => {"changed": false, "msg": "Unknown key \"tls\"."}`.

* Add changelog fragment

* Update changelogs/fragments/180-fix-tls-in-tool-email.yml

As suggested by felixfontein

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Johannes Münch <git@washiza.eu>
Co-authored-by: Felix Fontein <felix@fontein.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant