Comments (6)
@forestoden
could you dump the Ansible version by $ansible-playbook --version
?
from ansible-galaxy-fortios-collection.
Of course, sorry forgot to include that.
$ansible-playbook --version
ansible-playbook 2.9.11
config file = None
configured module search path = ['/Users/forest.oden/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.8/site-packages/ansible
executable location = /usr/local/bin/ansible-playbook
python version = 3.8.5 (default, Jul 21 2020, 10:48:26) [Clang 11.0.3 (clang-1103.0.32.62)]
from ansible-galaxy-fortios-collection.
One way to troubleshoot this is to create a new environment to test the playbook, here's one way to do it:
- Create Dockerfile to build image:
FROM ubuntu:19.10
RUN set -x && \
\
echo "==> Installing python3 and dependencies..." && \
apt update && \
apt install python3-pip --yes && \
\
echo "==> Installing Ansible..." && \
pip3 install ansible && \
\
echo "==> Installing Ansible collections..." && \
echo "==> specific for FortiOS 6.2..." && \
ansible-galaxy collection install fortinet.fortios:1.0.10 && \
ansible-galaxy collection install fortinet.fortimanager && \
WORKDIR /ansible
-
Build image and start container
-
Check if you can see the docs using the full namespace
ansible-doc fortinet.fortios.fortios_system_interface
Using the above process here's the path of my module:
/root/.ansible/collections/ansible_collections/fortinet/fortios/plugins/modules/fortios_system_interface.py
Keep in mind that the ansible-galaxy collection module is not the same that comes shipped with ansible, that one is found here:
root@fc9c76ac267b:/ansible# ansible-doc -F | grep fortios_system_interface
fortios_system_interface /usr/local/lib/python3.7/dist-packages/ansible/modules/network/fortios/fortios_system_interface.py
- Use the full name on the task.
Instead of using - collections
remove that and use the task with the name fortinet.fortios.fortios_system_interface
. Both formats have the same effect.
- Make sure your ansible_network_os variable is set to
fortinet.fortios.fortios
. I had issues in the past using onlyfortios
as it tries to call the older modules.
from ansible-galaxy-fortios-collection.
Hi @mbdraks, all of the checks you have listed here work as expected in my normal development environment. I did not try to set up a docker dev environment because it seems like my normal one has the collection. I use the collection for a few other tasks in the same playbook, and those actually execute without issue
from ansible-galaxy-fortios-collection.
@mbdraks @forestoden ,
thanks Michel, Forest for the issue,
error No module named 'ansible_collections'
usually means environment setup issue. we'd better have a clean environment. here I used a python3 virtual env
#python3 -m venv AnsibleTestEnv
#source AnsibleTestEnv/bin/activate
## Install Ansible 2.9 Base
#pip3 install ansible==2.9.9
#ansible --version
ansible 2.9.9
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /root/BUGTRIAGE/AnsibleTestEnv/lib/python3.6/site-packages/ansible
executable location = /root/BUGTRIAGE/AnsibleTestEnv/bin/ansible
python version = 3.6.9 (default, Jul 17 2020, 12:50:27) [GCC 8.4.0]
## Install FortiOS Ansible collection
#ansible-galaxy collection install fortinet.fortios -f
please also make sure your host inventory is correct https://ansible-galaxy-fortios-docs.readthedocs.io/en/latest/playbook.html
thanks,
Link
from ansible-galaxy-fortios-collection.
mark this issue closed.
@forestoden please feel free to reopen it if your issue persists.
thanks,
Link
from ansible-galaxy-fortios-collection.
Related Issues (20)
- "Error in repo" using fortios_firewall_policy module HOT 4
- config system globals timezone not numeric in 7.4.2 HOT 3
- How to Create SDWAN Zone HOT 11
- Changing admin user password results in 403 PUT error. HOT 1
- network os fortinet.fortios.fortios is not supported HOT 1
- Is global scope security profile supported? HOT 1
- fortinet.fortios.fortios_monitor_fact filter questions HOT 4
- fortinet.fortios.fortios_monitor -selector upgrade.system.firmware possible issue? HOT 3
- Need help w/playbook to list all managed fortiap's per firewall. HOT 4
- updating policy based routing of fortigate is not working always has seq-num error HOT 2
- There must be at least 1 server certificate configured HOT 2
- Getting 404 error while trying to add IPv6 address group using fortios_firewall_addrgrp6 HOT 2
- Error in comparison/serialize HOT 4
- Question on usage - setting dhcp (v4) reservations HOT 3
- federated-upgrade 7.2.7>7.2.8 problem HOT 2
- fortios_system_global timezone not working with FortiOS 7.4.2 and higher HOT 3
- fortinet.fortios.fortios_firewall_addrgrp module question HOT 8
- fortigate firewall firmware upgrade using fortios_monitor module HOT 2
- check mode error since 2.3.5 HOT 2
- IPv4 Virtual Wire Pair Policy HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-galaxy-fortios-collection.