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

GNU General Public License v3.0
85 stars 49 forks source link

Ansible 2.10 support #44

Closed chillancezen closed 4 years ago

chillancezen commented 4 years ago

hi @felixfontein,

I got a problem with ansible-base, i.e. 2.10.

Aug-10 04:02:56 linky@hyrule  ~/workspace/Ansible/BUGTRIAGE/FMG/failed_modules
$ansible --version
ansible 2.10.0rc4
  config file = None
  configured module search path = ['/home/linky/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/linky/.local/lib/python3.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.7.3 (default, Oct  7 2019, 12:56:13) [GCC 8.3.0]
Aug-10 04:02:44 linky@hyrule  ~/workspace/Ansible/BUGTRIAGE/FMG/failed_modules
$cat fmgr_antivirus_mmschecksum.yml
- hosts: fortimanager01
  collections:
    - fortinet.fortimanager
  connection: httpapi
  vars:
     ansible_httpapi_use_ssl: True
     ansible_httpapi_validate_certs: False
     ansible_httpapi_port: 443
  tasks:
   - name: Configure MMS content checksum list.
     fmgr_antivirus_mmschecksum:
        adom: "root"
        state: present
        antivirus_mmschecksum:
           comment: 'test-comment2'
           entries:
             -
                 checksum: "test_checksum2"
                 name: "entries-name2"
                 status: disable
           id: 21
           name: "test_checksum21"
Aug-10 04:02:54 linky@hyrule  ~/workspace/Ansible/BUGTRIAGE/FMG/failed_modules
$cat host
[myfortimanagers]
fortimanager01 ansible_host=192.168.190.102 ansible_user=APIUser ansible_password=Fortinet1!
fortimanager02 ansible_host=192.168.190.103 ansible_user=APIUser ansible_password=Fortinet1!
[myfortimanagers:vars]
ansible_network_os=fortinet.fortimanager.fortimanager

but I got an error of searching plugin in our own collection:

Aug-10 03:58:00 linky@hyrule  ~/workspace/Ansible/BUGTRIAGE/FMG/failed_modules
$ansible-playbook -i host -vvv fmgr_antivirus_mmschecksum.yml
ansible-playbook 2.10.0rc4
  config file = None
  configured module search path = ['/home/linky/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/linky/.local/lib/python3.7/site-packages/ansible
  executable location = /home/linky/.local/bin/ansible-playbook
  python version = 3.7.3 (default, Oct  7 2019, 12:56:13) [GCC 8.3.0]
No config file found; using defaults
host_list declined parsing /home/linky/workspace/Ansible/BUGTRIAGE/FMG/failed_modules/host as it did not pass its verify_file() method
script declined parsing /home/linky/workspace/Ansible/BUGTRIAGE/FMG/failed_modules/host as it did not pass its verify_file() method
auto declined parsing /home/linky/workspace/Ansible/BUGTRIAGE/FMG/failed_modules/host as it did not pass its verify_file() method
Parsed /home/linky/workspace/Ansible/BUGTRIAGE/FMG/failed_modules/host inventory source with ini plugin
PLAYBOOK: fmgr_antivirus_mmschecksum.yml *************************************************************************************************************************************************************************************************
1 plays in fmgr_antivirus_mmschecksum.yml
PLAY [fortimanager01] ********************************************************************************************************************************************************************************************************************
TASK [Gathering Facts] *******************************************************************************************************************************************************************************************************************
task path: /home/linky/workspace/Ansible/BUGTRIAGE/FMG/failed_modules/fmgr_antivirus_mmschecksum.yml:1
redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
fatal: [fortimanager01]: FAILED! => {
    "msg": "the connection plugin 'httpapi' was not found"
}
PLAY RECAP *******************************************************************************************************************************************************************************************************************************
fortimanager01             : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

could you help us ?

thanks,

chillancezen commented 4 years ago

resolved , install a collection from: https://github.com/ansible-collections/ansible.netcommon will be ok.