Closed Jacob-Tate closed 7 months ago
Hi @Jacob-Tate ,
Thank you for raising this issue, I find there is no such an argument email_body
in FOS 7.4.1, could you help me check if that exists in your environment through CLI? if so, is that possible to provide your FOS version for me to debug. However, I find message
argument that would be functional as "email_body", and Ansible doesn't contain that argument, I provide the generic API as a workaround solution. Let me know if that doesn't solve your question. Sorry for the inconvenience, The development team has acknowledged this issue, waiting for a better solution.
- name: fortios_system_automation_action
fortios_json_generic:
vdom: '{{ vdom }}'
# access_token: xrxHkbhjz1nphsyyzfGnx1b
json_generic:
method: PUT
path: /api/v2/cmdb/system/automation-action/action_generic2
jsonbody: '{
"name": "action_generic2",
"action-type": "email",
"email-to": [
{
"name": "test1@fortinet.com"
}
],
"email-from": "test2@fortinet.com",
"email-subject": "suject",
"message": "body"
}
'
register: info
- name: display vars
debug: msg="{{info}}"
Thanks, Maxx
Hi @Jacob-Tate
Please install the latest version 2.3.6 and try this module again. The parameter email_boday is supported in the old fortiOS versions (6.2.0 - 6.2.7), please use 'fos_message' if your device fortiOS firmware version is higher than v6.2.7 . I'll close this ticket at the moment because the issue is fixed in this version already. Feel free to reopen it if you still experience the same issue.
tasks:
- name: Configuration Changed_email
fortios_system_automation_action:
state: "present"
enable_log: True
system_automation_action:
name: "Ansible_1"
action_type: "email"
fos_message: "Ansible Test"
Thanks, Jie
With a configuration like this no matter what you input into the email_body nothing will change on the fortigate and it will continue saying ok.