fortinet-ansible-dev / ansible-galaxy-fortios-collection

GNU General Public License v3.0
84 stars 48 forks source link

Error in Repo #230

Closed mattpainter701 closed 1 year ago

mattpainter701 commented 1 year ago

Backup job, cant figure out why it always shows 'error in repo'

fatal: [FG71F-HA]: FAILED! => {"changed": false, "meta": {"action": "backup", "build": 444, "http_method": "POST", "http_status": 403, "name": "config", "path": "system", "serial": "", "status": "error", "vdom": "root", "version": "v7.0.9"}, "msg": "Error in repo"}

[fortigate]
FG71F-HA ansible_host=192.168.1.1 ansible_user=user ansible_password=password123

[dc_fortigate:vars]
ansible_network_os=fortinet.fortios.fortios
fortios_access_token=sdfdsafdsafdsafasdfsdf

  GNU nano 6.2                                                                                    
- hosts: fortigate
  connection: httpapi
  collections:
  - fortinet.fortios
  vars:
   vdom: "root"
   ansible_httpapi_use_ssl: yes
   ansible_httpapi_validate_certs: no
   ansible_httpapi_port: 8080
   ansible_httpapi_timeout: 60
  tasks:
  - name: Backup a virtual domain.
    fortios_monitor:
     access_token: "{{ fortios_access_token }}"
     selector: 'backup.system.config'
     vdom: 'root'
     params:
        scope: 'global'
    register: backupinfo

  - name: Save the backup information.
    copy:
     content: '{{ backupinfo.meta.raw }}'
     dest: './local.backup'
MaxxLiu22 commented 1 year ago

Hi @mattpainter701 ,

Thank you for your question, I run your script in my local environment without any error, could you provide your Ansible and collection version by input ansible-galaxy collection list, fortinet.fortios 2.2.2 is the latest version, and add -vvv at the end of command to get a more detailed error msg like this ansible-playbook -i hosts fortios_monitor.yml -vvv, and do you have issue when running other modules or only this module? Looking for your response.

Thanks, Maxx

MaxxLiu22 commented 1 year ago

I will go ahead to close this case, if you still have questions, feel free to reopen it or another case.