radify / radiian

Radiian creates Ansible provisioning files for immutable infrastructure on AWS
https://www.npmjs.com/package/radiian
BSD 3-Clause "New" or "Revised" License
19 stars 2 forks source link

Resolve the _ and - problem with tags #79

Open gavD opened 8 years ago

gavD commented 8 years ago

When you create a tag like:

Environment: hello-world

that's effectively tag_Environment_hello-world. the EC2 inventory script does not play nice with this because the - is represented as a _:

... "tag_Environment_hello_world": [ "54.165.138.95", "54.227.13.66" ],


Therefore, the generated provision.sh script needs to change to replace `-` characters with `_` characters:

```bash
# OLD version
ansible-playbook tag-old-nodes.yaml --limit tag_Environment_hello-world || true
ansible-playbook destroy-old-nodes.yaml --limit tag_oldhello-world_True || true

# NEW version
ansible-playbook tag-old-nodes.yaml --limit tag_Environment_hello_world || true
ansible-playbook destroy-old-nodes.yaml --limit tag_oldhello_world_True || true