-
Notifications
You must be signed in to change notification settings - Fork 343
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
inventory/aws_ec2 - support jinja2 filters in hostnames option #2427
base: main
Are you sure you want to change the base?
inventory/aws_ec2 - support jinja2 filters in hostnames option #2427
Conversation
Docs Build 📝Thank you for contribution!✨ The docsite for this PR is available for download as an artifact from this run: You can compare to the docs for the File changes:
Click to see the diff comparison.NOTE: only file modifications are shown here. New and deleted files are excluded. diff --git a/home/runner/work/amazon.aws/amazon.aws/docsbuild/base/collections/amazon/aws/aws_ec2_inventory.html b/home/runner/work/amazon.aws/amazon.aws/docsbuild/head/collections/amazon/aws/aws_ec2_inventory.html
index fbdce97..4c0b9e6 100644
--- a/home/runner/work/amazon.aws/amazon.aws/docsbuild/base/collections/amazon/aws/aws_ec2_inventory.html
+++ b/home/runner/work/amazon.aws/amazon.aws/docsbuild/head/collections/amazon/aws/aws_ec2_inventory.html
@@ -409,6 +409,7 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-aws-ec2-
<p>Can be one of the options specified in <a class="reference external" href="http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html#options">http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html#options</a>.</p>
<p>If value provided does not exist in the above options, it will be used as a literal string.</p>
<p>To use tags as hostnames use the syntax <a class="reference external" href="tag:Name=Value">tag:Name=Value</a> to use the hostname Name_Value, or <a class="reference external" href="tag:Name">tag:Name</a> to use the value of the Name tag.</p>
+<p>Jinja2 filters can be added to the hostnames string. Added in version 9.2.0.</p>
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">[]</span></code></p>
</div></td>
</tr>
@@ -878,6 +879,15 @@ see <a class="reference internal" href="#ansible-collections-amazon-aws-aws-ec2-
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">us-east-1</span>
<span class="nt">hostvars_prefix</span><span class="p">:</span><span class="w"> </span><span class="s">'aws_'</span>
<span class="nt">hostvars_suffix</span><span class="p">:</span><span class="w"> </span><span class="s">'_ec2'</span>
+
+<span class="nn">---</span>
+
+<span class="c1"># Define hostnames variables with jinja2 filters.</span>
+<span class="nt">plugin</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">amazon.aws.aws_ec2</span>
+<span class="nt">regions</span><span class="p">:</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">us-east-1</span>
+<span class="nt">hostnames</span><span class="p">:</span>
+<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="s">"tag:Name</span><span class="nv"> </span><span class="s">|</span><span class="nv"> </span><span class="s">replace('test',</span><span class="nv"> </span><span class="s">'prod')"</span>
</pre></div>
</div>
<section id="authors">
|
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 5m 08s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
SUMMARY
Closes #2402
ISSUE TYPE
COMPONENT NAME
inventory/aws_ec2