ansibleguy / webui

Basic WebUI for using Ansible
https://webui.ansibleguy.net
GNU General Public License v3.0
84 stars 7 forks source link

Problem: Job Inventory should be optional #11

Closed ansibleguy closed 6 months ago

ansibleguy commented 6 months ago

Versions

latest

Scope

Backend (API)

Issue

In case of dynamic inventories or if inventory was configured in ansible.cfg

johnlane commented 6 months ago

Just an FYI, here's what I have re inventory. In case I misunderstood what you said - when you have dynamic inventory you still have an inventory file but it configures your use of the dynamic inventory plugin instead of defining inventory.

Just as a specific example (this is what I've been doing my recent testing with...)

In ansible.cfg

[defaults]
inventory = inventory.aws_ec2.yml

[inventory]
enable_plugins = amazon.aws.aws_ec2

The default inventory file is defined in the defaults section and I load the aws dynamic inventory plugin in the inventory block.

Then my inventory.aws_ec2.yml (the naming format is prescribed by the plugin), I use the plugin:

plugin: amazon.aws.aws_ec2

followed by the yaml configuration for the plugin to collect and organise my inventory.

So I have a default inventory file set AND I am using an inventory plugin. I can, at the command line, omit the --inventory parameter from ansible commands.