ansible-gen is an automatic code generation tool for ansible modules according to YANG modules and some user-specified files which is designed to managemant the devices through NETCONF.
-
OS: Windows,Red Hat,Ubuntu,CentOS,OS X,BSD,Suse
-
Python: Python2/Python3(greater than python3.8 is preferred)
-
Ansible(optional): ansible 2.9+ or later is preferred.
-
Ne-ansible-plugin: see https://github.com/HuaweiDatacomm/ne-ansible-plugin
$git clone https://github.com/HuaweiDatacomm/ansible-gen.git
$python setup.py install
$pip3 install ansible-gen
input commandline: ansilbe-gen -h after installation.
$ansible-gen -h
Usage: ansible-gen.py [options]
Dynamically generate Ansible modules from yang and xml files, then deploy Ansible module
Options:
-h, --help show this help message and exit
-v, --version version number info for program
-y YANG_DIR, --yang_dir=YANG_DIR the directory of yang_files.
-r XML_DIR, --resource=XML_DIR the directory of ansible api description xml files.
-p SCRIPT_DIR, --script=SCRIPT_DIR the directory of previous generated ansible module which may has user define check implementation.
-l LOG_DIR, --log=LOG_DIR the log directory, name of log is ansible_gen.log
-o OUTPUT_DIR, --output=OUTPUT_DIR the output dir for generated ansible modules
--default get parameters from default config file /etc/ansible-gen/default.cfg
There are many ways to contribute:
- Fix and report bugs
- Improve documentation
- Review code and feature proposals
- Answer questions and discuss here on github and on our Community Site