Skip to content

Module filtering #204

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

DaviPtrs
Copy link

@DaviPtrs DaviPtrs commented Jul 12, 2025

SUMMARY

I have a use case where a single Terraform configuration manages multiple environments sharing the same modules, but for the Ansible part I would like to have separate inventory files.

I thought about a feature where I can choose which modules I want to fetch the ansible_host and ansible_group resources from, instead of only choosing between root + child modules or just root modules.

So I added both include_modules and exclude_modules directives to the terraform provider inventory plugin.

ISSUE TYPE
  • Feature Pull Request
ADDITIONAL INFORMATION

This is the basic usage:

plugin: cloud.terraform.terraform_provider
project_path: some/project/path
include_modules:
  - production

or

plugin: cloud.terraform.terraform_provider
project_path: some/project/path
exclude_modules:
  - development
  • include_modules and exclude_modules are mutually exclusive
  • if you set search_child_modules: false, the module filtering directives are ignored

@DaviPtrs
Copy link
Author

the command to generate docs is not working properly btw

ansible-doc --list | grep cloud.terraform | cut -d " " -f 1 | xargs -I {} antsibull-docs plugin --dest-dir docs/ {}
image

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant