Skip to main content

Ansiblator - make ansible api more pythonic and usefull

Project description

Ansiblator
==========

This wrapper allows more quicker and easier way to use ansible in python
ansible without playbooks, so more like fabric.

Ansible is then more powerfull and it will allow to chain commands with
python commands.

Get started
===========

For instalation you can download package and then just unpack and use

python setup.py install

or

pip install ansiblator


Quick use case
==============

For most quickest example you can just create your ansible file named
ansible_hosts inside your home directory or full path.

Ansiblater is mainly using file such as in ~/ansible_hosts

code::

from ansiblator.api import Ansiblator
ans = Ansiblator()
ret = ans.local("uname -a", now=True, use_shell=True)
ans.run("uname -a", now=True)
ans.runner("uptime")
ans.run_all()
ans.copy(src="/tmp/aabc.csv", dest="/tmp/",pattern="pc",now=True)

use dictionary::

inv = {'pc':[{'ssh_host':'192.168.0.10', 'ssh_user':'test_user', 'su_user':'root'}}
ans = Ansiblator(inventory=inv)
ans.run("uname -a", now=True)


More useable way
================

Ansiblator automatically save return json values for actuall runs, so
you can use them for testing and conditions. For example

testing::

return_code = ans.run("uname -a", now=True, use_shell=True)
return_code['contacted']

or

return_code = ans.run(["uname", "-a"], now=True, use_shell=False)
return_code['contacted']

Info
====
For more information consult functions or ansible documentation.
more information can be also used on www.pripravto.cz. You can also
contact us there.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ansiblator-0.5-4-28-09-2014.tar.gz (6.0 kB view details)

Uploaded Source

File details

Details for the file ansiblator-0.5-4-28-09-2014.tar.gz.

File metadata

File hashes

Hashes for ansiblator-0.5-4-28-09-2014.tar.gz
Algorithm Hash digest
SHA256 603af22df7b5464aa39640471376b253a5ebe7be396f38fb2342db59ac35be31
MD5 cc53043a3d69cbeb91aa7fa8cdfdad47
BLAKE2b-256 e246b150f6f3940d038ecc5c17480383ca1358ca6ba82270b8f39690c4a1eb8e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page