/ansible-gen

a tool to generate ansible API automatically for huawei net-engine ansible plugin

Primary LanguagePythonOtherNOASSERTION

ansible-gen

Overview

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.

Installation

Prerequisites

From Source

$git clone https://github.com/HuaweiDatacomm/ansible-gen.git
$python setup.py install

From Pypi

$pip3 install ansible-gen

How to use it

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

Usage Example

see ansible-gen-example

Contributing

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

Additional Resources