Saravanan666/pypi-org huggingface dataset:
Package: ansible-tests
Ansible testMake testinfra easier with ansible repository.Write your test directly in your rolespurpose of ansible-testsI want to be able to write testinfra tests in my role and use my inventories and my playbooks to run themUsagesansible-tests --file-name tests.yml --inventory inventory/dev.iniTest your ansible rolesYour tests should be in test directory inside your role :nginx
    ├── defaults
    │   └── main.yml
    ├── handlers
    │   └── main.yml
    ├── tasks
    │   └── main.yml
    └── tests
        └── test_nginx.pyExample of test file :# tests/test_nginx.py

def test_check_nginx_is_installed(host):
  nginx = host.package('nginx')
  assert nginx.is_installed

def test_nginx_is_running(host):
  nginx = host.service('nginx')
  assert nginx.is_runningExample of corersponding task file :# tasks/main.yml
---
- name: install nginx
  package:
    name: nginx
    state: present

- name: start nginx
  service:
    name: nginx
    state: startedConfigure ansible-testTo run ansible test, you have to respect this requirements:your roles must be inrolesdirectoryyou must have a playbook or a file to describe the matching between tests and serverstests.yml supported formats- hosts: bdd
  roles: postgres
- hosts: all
  roles: secu- hosts: all
  roles:
    - base
    - secu- hosts:
  - bdd
  - web-app
  roles:
  - role: secu
  - role: users- hosts: bdd:web-app
  roles:
  - role: secuYou should be able to use directly your playbook if you don't use stuff like!groupto exclude some group
Package: ansible-test-tool
Ansible-test is a tool for testing your automation in docker containers. It works a little bit like chef’s kitchen.usage:ansible-test[-h][--ansibleANSIBLE][--imageIMAGE]roleroles_pathpositionalarguments:roleDefinetheroletotestroles_pathDefinethepathtotheroles(likeinansible.cfg)optionalarguments:-h,--helpshowthishelpmessageandexit--ansibleANSIBLE,-aANSIBLETheansibleversiontoinstall--imageIMAGE,-iIMAGEThedockerbaseimagetotesttherole/playbookon.InstallationTo install ansible-test:$pipinstallansible-testDocumentationansible-test requires that you have docker installed locally. If you are using Mac OSX, I recommend you use boot2docker.
Package: ansible-tools
ansible-toolsThis is a set of wrappers around theansible,ansible-playbookandansible-vaultcommands
which integrate with the system keyring to retrieve the vault password.It should work on both Linux and macOS.InstallationOn macOS, with Homebrew:brew install lvillani/tap/ansible-tools;With Pip:pip install --user ansible-tools;It is best, however, to installansible-toolsin a Virtualenv, along with the version of Ansible
you are using.Overviewansible-vault-helper: Used by users to setup keyring integration, called by Ansible to obtain a
Vault unlock password.vaultify: Wraps Ansible commands such asansible,ansible-playbookandansible-playbookso
that the Vault is automatically unlocked with the password stored in the system's keyring.ansible-local: Wrapper to run Ansible locally.ansible-mkpasswd: Generates an encrypted password that can be used with the user module (see alsohere)UsageGo to the same directory that contains your playbooks and then run:ansible-vault-helper --updateYou will be prompted for a vault name (which can be anything) and the unlock password. The former is
stored inansible.cfgalongside your playbooks, the latter is securely stored in your keyring.At this point you can run Ansible as usual but precede the command withvaultify. That is, to
start a playbook run:vaultify ansible-playbook site.ymlWe also ship a tool to easily apply a playbook on the current system calledansible-localwhich is
composable withvaultify.AliasesHere's a list of handy shell aliases to make your life easier. They were tested on fish but should
work also on Bash and Zsh:alias v="vault"
alias ansible="vaultify ansible"
alias ansible-playbook="vaultify ansible-playbook"
Package: ansible-vagrant
Tired of the rather limitedvagrant provisionwith theansibleprovider? Tired of
keeping yourhostsfile up to date?ansible-vagrantto the rescue!Usage$ pip install ansible-vagrant
$ cd /path/to/project/with/a/vagrantfile

$ ansible-vagrant-update-hosts
$ cat hosts_vagrant
[vagrant]
vagrant  ansible_ssh_host=127.0.0.1  ansible_ssh_port=2222  ansible_ssh_use...

$ ansible-vagrant all -m ping
# Same as: ansible-vagrant-update-hosts \
#          && ansible all --inventory=./hosts_vagrant -m ping

$ ansible-playbook-vagrant playbook.yml
# Same as: ansible-vagrant-update-hosts \
#          && ansible-playbook --extra-vars="vagrant_host=true" \
#                              --inventory=./hosts_vagrant playbook.ymlNotesAll*-vagrantcommands useANSIBLE_HOST_KEY_CHECKING=Falseto
prevent errors withvagrant destroy && vagrant upIt’s a good idea to puthosts_vagrantunder.gitignoreansible-playbook-vagrantadds a global variable namedvagrantUsewhen: vagrant_host is (not) definedto run stuff based on the
current environmentShortcutsansiblevforansible-vagrantansible-playbookvforansible-playbook-vagrant
Package: ansiblevarchecker
ansiblevarcheckerCLI to check what vars are defined / used to find undefined or extra vars not documented.Based on source for ansible 2.9 and striped down and modified version of jinja2schema.Known IssuesSub attributes of a dictionary are marked as defined if a different sub attribute is set e.g# Settingdict:sub:yay# Will cause the use of the following undefined var to be marked as defined{{dict.undefined}}Setting variables in jinja2 templates are seen as variable usage and will be marked as undefined if they have not been registered outside of the jinja2 templateBecause of the removed scalar typing (to fix issues with filter discovery and other edge cases), infer-ing assumes all if statements evaluate to a boolean which can fail when actually run. This is out of scope of what avc is meant to do and is expected behavior (aka, test your code before pushing)Python 3.6.x isn't tested and isn't 100% supported due tohttps://www.python.org/dev/peps/pep-0538/being introduced min 3.7. 3.6 can still be configured to work with UTF-8 encoding but this package is not tested against 3.6Tests can fail withImportError: cannot import name 'soft_unicode' from 'markupsafe'. To overcome this a downgraded version of markupsafe must be usedpip install MarkupSafe==2.0.1On my local machinepython -mneeds to come before theansiblevarcheckerotherwise aImportError: cannot import name 'main' from 'ansiblevarchecker'occurs
Package: ansible-variables
ansible-variablesThe Ansible inventory provides a very powerful framework to declare variables in a hierarchical manner.
There a lof of different places where a variable can be defined (inventory, host_vars, groups_vars, ...)
and Ansible will merge them in a specific order
(variable precedence).ansible-variableswill help to keep track of your host context variables:inventory file or script group varsinventory group_vars/allinventory group_vars/*inventory file or script host varsinventory host_vars/*Based on one host it will return a list with all variables, values and variable type.Tested withansible-core2.11 - 2.16.Installationpipinstallansible-variablesUsageThe command line usage is similar to the official Ansible CLI tools, especially like ansible-inventory,
thus to see all possible commands and options runansible-variables --helpGet all variables for a hostThe basic usage is pretty simple, you only need to pass the Ansible hostname to it:ansible-variables mywebserverThis results in following simple rich formatted outputThe verbosity can be increased Ansible like with-v,-vvv, ...With-vthe inventory files where the variable is defined, will be printed. The last file wins.With-vvvit will also print all files which were considered to look for the variable.Get one specific variables for a hostIf you are only interested in one variable you can specify it with--var:ansible-variables mywebserver --var fooSame es above, the verbosity can also increase here.More customizationWith--helpyou will see which further arguments are possible, e.g. you can set the path to your inventory with-iansible-variables mywebserver -i /path/to/inventoryImplementationThis tool is tightly coupled to the Ansible library (ansible-core) and simple reuses what is already there.
The whole structure and implementation was inspired and oriented by the implementation ofansible-inventory.To get the source and the inventory files in which Ansible will look for a variable,
we are using adebug flagin Ansible'sget_varsmethod.As as result, the output ofansible-variablescan be fully trusted
as it uses the same methods as Ansible to get the variable precedence.Limitationsas written in the description, this tool only shows host context variables and
does not know anything about playbook or role variables or command line options.Creditsthe screenshots used  in this README where created withtermshotLicenseThis project is licensed under theGNU General Public License v3.0
Package: ansible-vault
ansible-vaultThis project aim to R/W an ansible-vault yaml file.This is not Ansible official project.You can install with pip.pip install ansible-vaultWhen you have an ansible-vault file, then you can read file. See below.fromansible_vaultimportVaultvault=Vault('password')data=vault.load(open('vault.yml').read())When you have to write data, then you can write data to file. See below.fromansible_vaultimportVaultvault=Vault('password')vault.dump(data,open('vault.yml','w'))# also you can get encrypted textprint(vault.dump(data))And seewiki.
Package: ansible-vault-rekey
ansible-vault-rekeyRoll keys and re-encrypt secrets in any repo using Ansible VaultFree software: BSD licenseDocumentation:https://ansible-vault-rekey.readthedocs.io.UsageWARNING: Very few guardrails present. Running this without optionswilloverwrite data by default.Known issues / caveats:Shows a callous disregard for whitespace and commentsAssumes it’s in a playbook directory if-risn’t providedWill casually write secrets to STDOUT in–debugmode$ ansible-vault-rekey --help
Usage: ansible-vault-rekey [OPTIONS]

  (Re)keys Ansible Vault repos.

Options:
  --debug
  --dry-run                 Skip any action that would overwrite an original
                            file.
  -k, --keep-backups        Keep unencrypted copies of files after a
                            successful rekey.
  -r, --code-path TEXT      Path to Ansible code.
  -p, --password-file TEXT  Path to password file. Default: vault-password.txt
  -v, --vars-file TEXT      Only operate on the file specified. Default is to
                            check every YAML file in Ansible role/play dirs
                            for encrypted assets.
  --help                    Show this message and exit.You can confirm that your secrets were rencryped properly by running debug on an
encrypted var or file. eg:ansible --vault-password-file vault-password.txt -e "@group_vars/all.yml" -i localhost, -c local -m debug -a var=somesecurevar localhostInstallationpip install ansible-vault-rekeyWe have dependencies a couple of layers down which need to compile crypto libraries
if you haven’t already got them. On most systems, you’ll need the following:libffi-dev / libffi-devellibssl-dev / openssl-develgccFeaturesTODOTestingWith Docker (recommended):docker build -t tmp . && docker run --rm -it -w /workspace -v $(pwd):/workspace tmpManually:pip install -r requirements.txt pytest & python -m pytest tests/*.pyCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History2.0.1 (2020-12-31)Fix improper encrypting YAML files2.0.0 (2020-12-31)Fix dependencies errorsDropped support for Python2 and Python 3.5Added support for Python 3.7, 3.8, 3.90.1.0 (2017-10-31)First release on PyPI.
Package: ansible-vault-rotate
python-ansible-vault-rotateAdvanced Python CLI to rotate the secret used for ansible vault inline secrets and files in a projectFeaturesReencrypt vault filesReencrypt inline vaulted secretsInstallationIt is strongly recommended to use pipx instead of pip if possible:pipxinstallansible-vault-rotateOtherwise you can also use plain pip, but be warned that this might
collide with your ansible installation globally!pipinstallansible-vault-rotateUsageRekey given vault secret with new secret specified on CLIansible-vault-rotate--old-vault-secret-sourcefile://my-vault-password\--new-vault-secret-sourcemy-new-secret\--update-source-secretRekey only specific files (e.g. when using multiple keys per stage)ansible-vault-rotate--old-vault-secret-sourcefile://my-vault-password-<stage>\--new-vault-secret-sourcemy-new-secret\--file-glob-patterngroup_vars/<stage>/*.yml\--update-source-secretGetting help about all argsansible-vault-rotate--helpDevelopmentFor development, you will need:Python 3.9 or greaterPoetryInstallpoetry installRun testspoetry run pytest
Package: ansible-vault-var
ansible-vault-var - Get and set encrypted values in vars yaml file.Featuresget encrypted value as plain text from ansible vars yaml fileset encrypted value from plain text in ansible vars yaml filePrerequisitesGNU makepython >= 3.6pipenvUsageGet variablepython3 -m ansible_vault_var --vault-password-file=vault_password.txt \
	get_var --var-name=secret_ingredient --vars-file=secret_vars.ymlSet variablepython3 -m ansible_vault_var --vault-password-file=vault_password.txt \
	set_var --var-name=secret_ingredient --vars-file=secret_vars.yml --new-var-value=saltCopyright (c) 2021 byCornelius Buschka.MIT
Package: ansible-vault-win
DescriptionAlthough Ansible only works on POSIX, you may want to edit your inventories and
playbooks on Windows. This is a problem if you use any files or values encrypted
with Ansible Vault. It may be a pain to find a separate POSIX machine just to
run the ansible-vault CLI to encrypt/decrypt these vault files. This is an
OS-independent port of a simplified version of just the ansible-vault CLI so
that you can work with these encrypted files on Windows.See theansible-vaultdocs for more info.
Package: ansible-waldur-module
Ansible module for WaldurWaldur-based solutions can be managed with Ansible modules to allow provisioning and
management of infrastructure under Waldur through Ansible playbooks.Supported functionalityOpenStack management.SLURM HPC managementCommon client for Waldur APIs in Python.See also:http://docs.ansible.com/ansible/modules.htmlInstallationpipinstallansible-waldur-moduleExample usageConfigure an Ansible playbook with parametersname:Trigger master instancewaldur_marketplace_os_instance:access_token:"{{access_token}}"api_url:"{{api_url}}"flavor:m1.microfloating_ip:autoimage:CentOS 7 x86_64name:"{{instance_name}}"project:"OpenStackProject"offering:Instance in Tenantssh_key:ssh1.pubsubnet:vpc-1-tm-sub-net-2system_volume_size:40wait:falsePass parameters to an Ansible playbookANSIBLE_LIBRARY=/usr/share/ansible-waldur/ansible\-mwaldur_marketplace_os_instance\-a"api_url=https://waldur.example.com/api/ access_token=9036194e1ac54cada3248a8c6b203bf7 name=instance-name project='Project name'"\localhostRunning playbook using virtual Python environmentIf you've installed Ansible Waldur module to virtual Python environment you need to specify
path to Python interpreter and path to module library along with path to playbook:ansible-playbook\-eansible_python_interpreter=/home/user/ansible-env/bin/python\-M/home/user/ansible-env/lib/python3.8/site-packages/\playbook.ymlContributingSee general guidelines:https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.htmlInstallpre-commitandtoxpipinstalltoxpre-commit
pre-commitinstallWhen new module is implemented, don't forget to updatepy_modulessection insetup.pyfile.When new module is implemented, it should be covered with tests. Run tests usingtoxtoxModule name should consist of three parts separated by underscore:waldur, plugin name,
entity name. For example,waldur_os_snapshotrefers to OpenStack (OS) as plugin name and snapshot as entity name.
Package: ansible-workspace
ansible-workspaceCreate a workspace for multiple tools to easier develop ansible playbooks with roles.Roles with a reference to a git repository will be cloned, checked out and added to the workspace.The.gitignorewill be configured to ignore the role repositories or symlinks.Installpipinstall-Uansible-workspaceor withpipxpipxinstallansible-workspaceWorkspacesansible-workspace--helpGeneralSymlinksIf you want your roles in e.g.~/ansible-rolesbut want to symlink them to./rolesuse the following command:ansible-workspace<tool>--roles-path~/ansible-roles--symlink-pathroles/VSCodeThe workspace consists of:A folder for the playbook directoryA folder for each role defined in the requirementsansible-workspacevscodecode~/workspaces/example-project.code-workspacetmuxpThe workspace consists of:A window for the playbook directoryA window to exectute ansible commandsA window for each role defined in the requirementsansible-workspacetmuxptmuxpload-y~/workspaces/example-project.tmuxp-workspace.ymlExamplesThe following roles are defined underroles/requirements.yml:---roles:-name:role1version:v1.0.3src:git@github.com:rwxd/ansible-role-subuid_subgid.gitscm:git-name:role2version:v1.0.2src:git@github.com:rwxd/ansible-role-subuid_subgid.gitscm:git-name:role3version:mastersrc:git@github.com:rwxd/ansible-role-subuid_subgid.gitscm:git❯ansible-workspacevscode
Cloning"git@github.com:rwxd/ansible-role-subuid_subgid.git"to"/tmp/test_repo/roles/role1"Checkingout"v1.0.3"on"git@github.com:rwxd/ansible-role-subuid_subgid.git"Cloning"git@github.com:rwxd/ansible-role-subuid_subgid.git"to"/tmp/test_repo/roles/role2"Checkingout"v1.0.2"on"git@github.com:rwxd/ansible-role-subuid_subgid.git"Cloning"git@github.com:rwxd/ansible-role-subuid_subgid.git"to"/tmp/test_repo/roles/role3"Adding"roles/role1"to.gitignore
Adding"roles/role2"to.gitignore
Adding"roles/role3"to.gitignore
Createdworkspaceconfigat"/home/<name>/workspaces/test_repo.code-workspace"The workspace can now be opened withcode ~/workspaces/test_repo.code-workspace.
Package: ansibug
AnsibugThe core component of the Ansible Debug Adapter Protocol used for debugging Ansible playbooks.
See more documentation foransibugathttps://jborean93.github.io/ansibug/.Please note this library should be considered a preview.
New features and behaviour changes should be expected during this preview period.Debug AdapterThis library combined with aDebug Adapter Protocolclient, like Visual Studio Code, can be used to run and debug Ansible playbook's interactively.
It supports basic features like stepping in, over, and out of tasks in a play with support for getting and setting variables at runtime.More information about the debug adapter and debugging experience of Ansible can be found underthe docs.RequirementsThe following Python requirements must be met before using this library:Python 3.9+ (dependent onansible-coresupport)ansible-core >= 2.14.0The debugger aims to continue to support the currentansible-coreversions that have no reached End Of Life.
See theansible-core support matrixto see the current versions and the control node python versions for those versions.
There are no guarantees that all features will be supported across Ansible versions, new features might be reliant on changes only present in newer Ansible versions.
Any such features will be explicitly called out in the documentation.InstallationThis library has been published on PyPI and can be installed with:python-mpipinstallansibugTo test out the changes locally run the following:gitclonehttps://github.com/jborean93/ansibug.git

python-mpipinstall-e.[dev]pre-commitinstallThis will install the current code in editable mode and also include some development libraries needed for testing or other development features.TestingThis library usestoxto run the sanity and integration tests.
Once the dev extras for this library has been installed, all the tests can be run by running thetoxcommand.As the support matrix for this library can take some time to run it might be beneficial to run only certain tests.
The following factors are available in toxsanitypy3{9,10,11,12}ansible_{2.14,2.15,2.16,devel}Here are some example factors that can be invoked with tox:# Run only the sanity teststoxrun-fsanity# Run Ansible 2.16 on all its supported Python versionstoxrun-fansible_2.16# Run Python 3.12 on all the supported Ansible versionstoxrun-fpy312# Run Ansible 2.16 tests on Python 3.12toxrun-fpy312ansible_2.16
Package: ansicolortags
Theansicolortagsmodule provides efficient and useful functions to use colours in a terminal application with Python 2 and 3, with aHTML-taglike style :<red>text<white>will printtextin red.All ANSI colors code are defined with this tag-like style.This point is the main interest of this module,because all others modules define function to print with some colours.The complete documentation can be found here :http://ansicolortags.readthedocs.io/!ColoursForegroundsYou can choose one of the 8 basic ANSI colours: black, red, green, yellow, blue,
magenta, cyan, white.
The names beginning with alower-scriptdesignforegroundcolours.For example:from ansicolortags import printc
printc('<reset>This is default. <red>This is red<yellow> and yellow in foreground now<reset>').BackgroundsYou can choose one of the 8 basic ANSI colours: Black, Red, Green, Yellow, Blue,
Magenta, Cyan, White.
The names beginning with anupper-scriptdesignbackgroundcolors.For example:from ansicolortags import printc
printc('<Default>this is default. <Blue>this have a blue background<Black> and black in background now<reset>').Other tagsThe following tags are also available:b,B: to turn on and off theboldmode,u,U: to turn on and off theunderlinemode,neg,Neg: to turn on and off thereverse videomode,blink,Blink: to turn on and off theblinkmode,el: to erase the current line,bell: to make the terminal ring.ShortcutsSome macros are also provided, like the tags<ERROR>,<INFO>or<WARNING>.And also<warning>and<question>, which respectively give a colored!and?.Theresettag is a special tag to reinitialize all previously changed parameters.Writing to a file ?This is possible with thewritecfunction. For example:import sys
from ansicolortags import writec
writec('<ERROR><u><red>The computer is going to explode!<reset>', fn=sys.stderr)
# sys.stderr.flush()
# this is useless : writec flush itself.Auto detectionOf course, the colors are disabled if the output does not support them.It works perfectly on any GNU/Linux (tested with Ubuntu 10+, Debian, Arch Linux) and Windows (with or without Cygwin),
and should work fine one MAC OS X or on other UNIX-like.Other featuresOther functionsThere is also thextitle()function, to change the title of the terminal.
This try to use the command-line toolxtitle, and if it fails it tries to use anANSI codeto change the title.There is also anotify()function to display a system notification (using the command-line toolnotify-send).Scriptansicolortags.pyis also a script.
You can have his description (or use it) directly with:python -m ansicolortags --helpFor testingansicolortags.pycan be used to run some tests (with the--testoption).With GNU/Bashansicolortags.pycan be used to generate a GNU/Bash color profile
(with the--generate--filecolor.shoptions).See here for this color.sh fileThisshfile can be imported with$ . color.shin any GNU/Bash scripts, or even in your~/.bashrcfile.License ?This module is licensed under the term of theMIT License, see the fileLICENSEfor more details.
Package: ansicon
Overviewansicon is a Python wrapper for loadingJason Hood’sANSICONInstallation$pipinstallansiconUsageimportansicon# Load ansiconansicon.load()# Have fun with terminal codesprint(u'\x1b[32mGreen\x1b[m')# Unload ansiconansicon.unload()# Check if ansicon is loadedifnotansicon.loaded():ansicon.load()ifansicon.loaded():ansicon.unload()