Skip to main content

Impansible

Introduction

Impansible is a Robot Framework test library for access to all Ansible internal modules. All Ansible modules are available as Robotframework’s keywords. The Impansible library can be used without Robotframework.

Impansible is operating system independent and supports Python 2.7 as well as Python 3.x or newer.

Documentation

See keyword documentation for available keywords and more information about the library in general.

For general information about using test libraries with Robot Framework, see Robot Framework User Guide.

Installation

The recommended installation method is using pip:

pip install --upgrade robotframework-impansible

With recent versions of pip it is possible to install directly from the GitHub repository. To install latest source from the master branch, use this command:

pip install git+https://github.com/AdamPrzybyla/Impansible.git

Alternatively you can download the source distribution from PyPI, extract it, and install it using one of the following depending are you using Python or Jython:

python setup.py install

Usage

The library can be used localy if teh first parametr is set to “local” or remotly if the first parameter is set to hostname. You need to export ssh keys or provide the propper credentials. if you have root access you need to set the ansible_password variable but for sudo access you neeed to set ansible_become_password and ansible_user variables.

The keywors documenatation can be found on this site: keyword Documentation

*** variables ***
${PAC}   mtr
#${ansible_password}  xxxxxxx
${ansible_become_password}  xxxxxxxxx
${ansible_user}  user_user

*** settings ***
library  Impansible
library  Collections
library  OperatingSystem

*** test cases ***
test 1
        ${x}=   Setup  localhost
                log  ${x}
        ${y}=   get from dictionary  ${x}   ansible_facts
        ${h}=   get from dictionary  ${y}   ansible_hostname
        ${z}=   get from dictionary  ${y}   ansible_distribution
                Should be Equal  ${z}  Ubuntu
                Should Contain   ${h}  tester
test 2
        [Timeout]    600
        ${x}=   apt    localhost   package=${PAC}   state=present
        ${x}=   get from dictionary  ${x}   invocation
        ${y}=   get from dictionary  ${x}   module_args
        ${s}=   get from dictionary  ${y}   state
                Should be Equal  ${s}  present
        ${w}=   Run     which ${PAC}
                Should Contain  ${w}  ${PAC}

test 3
        [Timeout]    600
        ${x}=   apt   localhost   package=${PAC}   state=absent
        ${x}=   get from dictionary  ${x}   invocation
        ${y}=   get from dictionary  ${x}   module_args
        ${s}=   get from dictionary  ${y}   state
                Should be Equal  ${s}  absent
        ${w}=   Run     which ${PAC}
                Should not Contain  ${w}  ${PAC}

test 4
        ${x}=   apt    localhost   package=python-openssl   state=present
        ${c}=   get certificate   localhost  host=www.onet.pl   port=443  proxy_host=1.1.2.2
        ${e}=   get from dictionary  ${c}   expired
                Should not be True   ${e}

test 5
        ${x}=  nitz2
                log  ${x}

test 6
        ${w}=   command   localhost   uname -a
        ${w}=   get from dictionary  ${w}   stdout
                Should Contain  ${w}  GNU/Linux

test 7
        ${x}=   python requirements info  localhost
        ${x}=   get from dictionary  ${x}   ansible_facts
        ${x}=   get from dictionary  ${x}   discovered_interpreter_python
                Should Contain  ${x}  python

Support

If the provided documentation is not enough, there are various support forums available:

Release files for robotframework-impansible 0.11

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

Source distribution (sdist)

Source distribution for robotframework-impansible 0.11
File Size Uploaded
robotframework-impansible-0.11.tar.gz 264.1 kB Details

Release files / robotframework-impansible-0.11.tar.gz

Download URL robotframework-impansible-0.11.tar.gz
Size 264.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b26f4e42c67d3a9e2117e88783f5bce43383a474eb733b597f87e13f7c19dc94
BLAKE2b-256 checksum
How to use checksums
40a09c292eaf80ecb9afe8bac77a162a695f8d2d0974d4c26043db4366b71110
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.7.4 pkginfo/1.3.2 requests/2.14.2 setuptools/22.0.5 requests-toolbelt/0.8.0 clint/0.5.1 CPython/2.7.5 Linux/3.10.0-1127.18.2.el7.x86_64

Release history Release notifications | RSS feed

This release

0.11 This release

1 release file

0.10

1 release file

0.9

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

0.1

1 release file

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