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

Host specific template name #22

Open
badgerspoke opened this issue May 14, 2019 · 0 comments
Open

Host specific template name #22

badgerspoke opened this issue May 14, 2019 · 0 comments

Comments

@badgerspoke
Copy link

When using this role to apply templates to multiple AWS accounts, I often need slightly different results from the rendering per account. An example would be when the template will include the account's ID - that value must differ between the 'hosts' (accounts). The fix is trivial:

$ git diff tasks/
diff --git a/tasks/run.yml b/tasks/run.yml
index 28ea31c..cf38a20 100644
--- a/tasks/run.yml
+++ b/tasks/run.yml
@@ -5,7 +5,7 @@
 ###
 - name: register a sane template name
   set_fact:
-    cloudformation_file_name: "{{ cloudformation.template | basename }}-{{ cloudformation.stack_name }}.yml"
+    cloudformation_file_name: "{{ inventory_hostname + '-' + cloudformation.template | basename }}-{{ cloudformation.stack_name }}.yml"
   check_mode: False

.. we just include the inventory_hostname in the rendered template path. Worth considering?

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

No branches or pull requests

1 participant