Skip to main content

ansible_simple

A simple SDK to use Ansible API.

usage

pip install ansible-simple

ansible module

from ansible_simple.api import AnsibleApi

a = AnsibleApi(remote_user="root", hosts=["192.168.13.109", "192.168.13.56"], remote_password={"conn_pass": "password"})
# a.run(module='shell', args='hostname')
# print(a.get_result())

ansible playbook

- name: mydbserver
  hosts: mydbserver
  gather_facts: no
  tasks:
    - name: uptime
      raw: uptime
      register: uptime
    - debug:
        msg: "{{ uptime.stdout }}"
    - name: online pm2 ls
      raw: ls
      register: ls
    - debug:
        msg: "{{ ls.stdout }}"
a.playbook(dynamic_inv={"mydbserver":["192.168.13.109", "192.168.13.56"]}, playbooks=['test.yml'])
# print(a.get_result())

reference

https://packaging.python.org/en/latest/tutorials/packaging-projects/
https://docs.ansible.com

Metadata

Release files for ansible-simple 2.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ansible-simple 2.0.3
File Size Uploaded Provenance Actions
ansible_simple-2.0.3.tar.gz 7.4 kB Without provenance Details for ansible_simple-2.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ansible-simple 2.0.3
File Interpreter ABI Platform Actions
ansible_simple-2.0.3-py3-none-any.whl Python 3 none any Details for ansible_simple-2.0.3-py3-none-any.whl

Total release size: 15.5 kB

Release files / ansible_simple-2.0.3.tar.gz

Download URL ansible_simple-2.0.3.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
47d9cccbcbe0b776c679707f8ced1d7540ff596b86aeb4912f358afc06bc0d04
BLAKE2b-256 checksum
How to use checksums
0da8eb63d67e4c189cf85e4d18f0faf8536535fd96e2950d4e7fb316d149584d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / ansible_simple-2.0.3-py3-none-any.whl

Download URL ansible_simple-2.0.3-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6a1f689d18aec5c3e544237575ab70603c0e11619d23750c371adaa91d322db
BLAKE2b-256 checksum
How to use checksums
8b695b0d79933f84d6f967c520648671623066b3d3b070c7cd2ed9f6927c6b45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for ansible-simple 2.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page