Code Monkey home page Code Monkey logo

ansible-role-cloudformation's People

Contributors

cytopia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-role-cloudformation's Issues

Enable Termination Protection

Hey,

Great role, here's a feature request.. I would raise a PR but this is such a trivial change - how about if we also allow Termination Protection via a protect flag?

$ git diff roles/galaxy/
diff --git a/ansible/roles/galaxy/cytopia.cloudformation/tasks/run.yml b/ansible/roles/galaxy/cytopia.cloudformation/tasks/run.yml
index 3f584b8..eb0cd9a 100644
--- a/ansible/roles/galaxy/cytopia.cloudformation/tasks/run.yml
+++ b/ansible/roles/galaxy/cytopia.cloudformation/tasks/run.yml
@@ -80,6 +80,7 @@
     profile: "{{ cloudformation.profile | default(cloudformation_defaults.profile | default(omit)) }}"
     region: "{{ cloudformation.region | default(cloudformation_defaults.region | default(omit)) }}"
     notification_arns: "{{ cloudformation.notification_arns | default(cloudformation_defaults.notification_arns | default(omit)) }}"
+    termination_protection: "{{ cloudformation.protect | default(False) }}"
     template_parameters: "{{ cloudformation.template_parameters | default(omit) }}"
     tags: "{{ cloudformation.tags | default(omit) }}"
   when: not cloudformation_generate_only

cloudformation_diff doesn't work

Hey!

Looks like cloudformation_diff script doesn't work anymore. Tried with latest ansible available in python:3-alpine docker image

TASK [ansible-role-cloudformation : diff cloudformation template parameters] ***********************************************************************************************************************************************************************************************************************************************
fatal: [infrastructure]: FAILED! => {
    "changed": false,
    "rc": 1
}

MSG:

MODULE FAILURE
See stdout/stderr for the exact error


MODULE_STDERR:

/root/.ansible/tmp/ansible-tmp-1563169478.9655852-25792851061594/AnsiballZ_cloudformation_diff.py:18: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-tmp-1563169478.9655852-25792851061594/AnsiballZ_cloudformation_diff.py", line 114, in <module>
    _ansiballz_main()
  File "/root/.ansible/tmp/ansible-tmp-1563169478.9655852-25792851061594/AnsiballZ_cloudformation_diff.py", line 106, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/root/.ansible/tmp/ansible-tmp-1563169478.9655852-25792851061594/AnsiballZ_cloudformation_diff.py", line 49, in invoke_module
    imp.load_module('__main__', mod, module, MOD_DESC)
  File "/usr/local/lib/python3.7/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/usr/local/lib/python3.7/imp.py", line 169, in load_source
    module = _exec(spec, sys.modules[name])
  File "<frozen importlib._bootstrap>", line 630, in _exec
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/tmp/ansible_cloudformation_diff_payload_35lmcfal/__main__.py", line 590, in <module>
  File "/tmp/ansible_cloudformation_diff_payload_35lmcfal/__main__.py", line 488, in main
AttributeError: 'str' object has no attribute 'decode'



PLAY RECAP *****************************************************************************************************************************************************************************************************************************************************************************************************************
infrastructure             : ok=8    changed=0    unreachable=0    failed=1    skipped=2    rescued=0    ignored=0

/src # python -V
Python 3.7.4
/src # pip list | egrep "(boto|cfn)"
boto3           1.9.188
botocore        1.12.188
cfn-flip        1.2.1
/src #

Host specific template name

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.