fortinet-solutions-cse / 40ansible

Ansible modules and examples for Fortinet products using the REST API
https://fndn.fortinet.net
Apache License 2.0
79 stars 44 forks source link

fortiosconfig - using "log.memory setting"? #31

Closed tohillm closed 5 years ago

tohillm commented 5 years ago

Working with @JonTheNiceGuy on Fortigate Playbooks:

I have built a FortiGate NGFW - Single VM on Azure using the marketplace and selecting the "BYOL 6.0.3" model.

I then execute the following playbook: `

RESTful API to Azure

Global Vars declaration

vars:

  host1: "<removed>:8443" 
  username: "<removed>"
  password: "<removed>"
  vdom: "root"
  https: "true"

tasks:

This module was developed by Fortinet to configure all aspects of all aspects of fortinet pro$

https://github.com/fortinet-solutions-cse/40ansible

Here, it configures the local memory and local disk logging of the firewallit similar to exis$

# #

fatal: [localhost]: FAILED! => { "changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/tohillm/.ansible/tmp/ansible-tmp-1549365329.73-215581636446446/AnsiballZ_fortiosconfig.py\", line 113, in \n _ansiballz_main()\n File \"/home/tohillm/.ansible/tmp/ansible-tmp-1549365329.73-215581636446446/AnsiballZ_fortiosconfig.py\", line 105, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/tohillm/.ansible/tmp/ansible-tmp-1549365329.73-215581636446446/AnsiballZ_fortiosconfig.py\", line 48, in invoke_module\n imp.load_module('main', mod, module, MOD_DESC)\n File \"/tmp/ansible_fortiosconfig_payload_CUwU8c/main.py\", line 859, in \n File \"/tmp/ansible_fortiosconfig_payload_CUwU8c/main.py\", line 847, in main\n File \"/tmp/ansible_fortiosconfig_payload_CUwU8c/main.py\", line 519, in fortigate_config_set\n File \"/tmp/ansible_fortiosconfig_payload_CUwU8c/main.py\", line 469, in login\n File \"/usr/lib/python2.7/site-packages/fortiosapi/fortiosapi.py\", line 118, in login\n data='username=' + username + '&secretkey=' + password + \"&ajax=1\")\n File \"/usr/lib/python2.7/site-packages/requests/sessions.py\", line 507, in post\n return self.request('POST', url, data=data, json=json, kwargs)\n File \"/usr/lib/python2.7/site-packages/requests/sessions.py\", line 464, in request\n resp = self.send(prep, send_kwargs)\n File \"/usr/lib/python2.7/site-packages/requests/sessions.py\", line 576, in send\n r = adapter.send(request, **kwargs)\n File \"/usr/lib/python2.7/site-packages/requests/adapters.py\", line 415, in send\n raise ConnectionError(err, request=request)\nrequests.exceptions.ConnectionError: ('Connection aborted.', error(101, 'Network is unreachable'))\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1 } to retry, use: --limit @/home/tohillm/playbooks/AF-1137-FW-locallog-Mgmt/AF-1137-FW-locallog-Mgmt-part1.retry

PLAY RECAP ** localhost : ok=1 changed=0 unreachable=0 failed=1 `

Can anyone give me advice as to what I am doing wrong? Thanks, Mark

tohillm commented 5 years ago

Apologies for the poor formatting of this issue creation. I am a newbie at this. Mark

thomnico commented 5 years ago

Hello, According to your error msg the host running your ansible can not connect to your fortigate.

You must be able to run https calls on your fortigate from the host you run Ansible. That mean inside same Vnet and Foritgate corresponding interface set for admin access on https://

tohillm commented 5 years ago

Nicholas, You were correct. Apologies for this.

Mark