Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: Job Inventory should be optional #11

Closed
ansibleguy opened this issue Feb 26, 2024 · 1 comment
Closed

Problem: Job Inventory should be optional #11

ansibleguy opened this issue Feb 26, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ansibleguy
Copy link
Owner

Versions

latest

Scope

Backend (API)

Issue

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

@ansibleguy ansibleguy added the bug Something isn't working label Feb 26, 2024
@johnlane
Copy link

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.

@ansibleguy ansibleguy self-assigned this Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants