Open jungekim opened 1 year ago
Although there is an authentication-related error, the event logs from FortiOS show that the login was successful;
Date 2023/06/07 Time 12:49:30 Duration 1202s Virtual Domain root Log Description Admin logout successful
Hi @jungekim ,
Thank you for raising this issue, I can reproduce it, have reported it to the development team for further investigation.
Thanks, Maxx
the same issue applies to FortiOS 6.0.17. Like @jungekim i can see successful logins in the event logs.
community.fortios 1.0.0
fortinet.fortimanager 2.1.5
fortinet.fortios 2.1.5
fortinet.fortios 2.3.0
2) fortios : v6.2.10 build1263 3) ansible's version [ansible@a9ea04030839 test-ansible]$ ansible-galaxy --version ansible-galaxy [core 2.12.5] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.9/site-packages/ansible ansible collection location = /home/ansible/.ansible/collections:/usr/share/ansible/collections executable location = /usr/local/bin/ansible-galaxy python version = 3.9.6 (default, Aug 25 2021, 16:22:38) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)] jinja version = 3.1.1 libyaml = True
ansible-playbook code 1) config_backup_fortios.yml
tasks:
name: Gather date_time from localhost delegate_to: localhost run_once: yes setup: gather_subset:
name: Register current date as a variable delegate_to: localhost run_once: yes set_fact: current_date: "{{ ansible_date_time.date }}"
name: Backup configuration for FortiOS fortinet.fortios.fortios_monitor_fact: selector: 'system_config_backup' vdom: 'root' params: scope: 'root' register: fortios_backup_result when: inventory_hostname in groups['fortios']
name: Print fortios backup result delegate_to: localhost copy: content: "{{ fortios_backup_result.stdout }}" dest: "{{ backup_dir }}/{{ current_date }}/{{ inventory_hostname }}" when: inventory_hostname in groups['fortios']
2) /etc/ansible/hosts fortios: vars: ansible_network_os: fortinet.fortios.fortios ansible_httpapi_use_ssl: yes ansible_httpapi_validate_certs: False ansible_httpapi_port: 8080 ansible_connection: httpapi hosts: FGVPNA: FGVPNS: connection: httpapi collections: fortinet.fortios
when i run ; ansible-playbook -l FGVPNS config_backup_fortios.yml -vvvv TASK [Backup configuration for FortiOS] ***** task path: /home/ansible/test-ansible/config_backup_fortios.yml:25 redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi Loading collection ansible.netcommon from /home/ansible/.ansible/collections/ansible_collections/ansible/netcommon Loading collection ansible.utils from /home/ansible/.ansible/collections/ansible_collections/ansible/utils