Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

josevnz/ExtendingAnsibleWithPython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExtendingAnsibleWithPython

Tutorial how to extend Ansible with Python

This repository is composed of several modules. They are small enough right now, so I plan to keep this in a single place instead of splitting in submodules.

Topics

How to manage dynamic inventories in Ansible

Installation

git clone git@github.com:josevnz/ExtendingAnsibleWithPython.git
cd ExtendingAnsibleWithPython.git/Inventory
python3 -m venv ~/virtualenv/ExtendingAnsibleWithPythonInventory
. ~/virtualenv/ExtendingAnsibleWithPythonInventory/bin/activate

Developer installation

. ~/virtualenv/ExtendingAnsibleWithPythonInventory/bin/activate
pip install wheel
pip install --upgrade pip
pip install build
python setup.py develop

Running unit tests

(ExtendingAnsibleWithPythonInventory) [josevnz@dmaf5 Inventories]$ python -m unittest test/test_nmap.py 
.{'127.0.01': '127.0.0.1'}
.192.168.1.11
192.168.1.16
192.168.1.25
192.168.1.26
.
----------------------------------------------------------------------
Ran 3 tests in 0.070s

OK

User installation

. ~/virtualenv/ExtendingAnsibleWithPythonInventory/bin/activate
python setup.py bdist_wheel
pip install dist/ansible_nmap_inventories-0.0.1-py3-none-any.whl

Then please read the Inventories tutorial to see what is available.

About

Tutorial how to extend Ansible with Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages