
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
The 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-variables
will help to keep track of your host context variables:
Based on one host it will return a list with all variables, values and variable type.
Tested with ansible-core
2.11 - 2.18.
pip install ansible-variables
The command line usage is similar to the official Ansible CLI tools, especially like ansible-inventory, thus to see all possible commands and options run
ansible-variables --help
The basic usage is pretty simple, you only need to pass the Ansible hostname to it:
ansible-variables mywebserver
This results in following simple rich formatted output
The verbosity can be increased Ansible like with -v
, -vvv
, ...
With -v
the inventory files where the variable is defined, will be printed. The last file wins.
With -vvv
it will also print all files which were considered to look for the variable.
If you are only interested in one variable you can specify it with --var
:
ansible-variables mywebserver --var foo
Same es above, the verbosity can also increase here.
With --help
you will see which further arguments are possible, e.g. you can set the path to your inventory with -i
ansible-variables mywebserver -i /path/to/inventory
This 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 of
ansible-inventory
.
To get the source and the inventory files in which Ansible will look for a variable,
we are using a debug flag
in Ansible's get_vars
method.
As as result, the output of ansible-variables
can be fully trusted
as it uses the same methods as Ansible to get the variable precedence.
This project is licensed under the GNU General Public License v3.0
FAQs
Keep track of Ansible host context variables
We found that ansible-variables demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.