Open djcross opened 9 years ago
Hi, yes this is a known issue, which I've not had time to workaround/resolve.
The route table module forces a destination (e.g. 0.0.0.0/0 via igw). But the nat monitor script run on the instances change it, so a re-run will fail on that step, and won't return the id's. There's now a route table get facts module (merged in https://github.com/ansible/ansible-modules-extras/pull/778), which should allow handling that a bit cleaner - although I'm not sure it's returning the subnet information, so there would need to be a bit of associative magic.
I asked for the module to be modified to not force a destination, but I'm not sure that's been applied.
Thanks for the reply. I've just tried messing with the 'ec2_vpc_route_table_facts' but am getting constant issues trying to iterate through the filters.
I guess essentially what is needed is the lookup with an ignore_errors, and then runs through the private route table creation if ec2_vpc_route_table_private_out is not already set from the lookup. now, to get that lookup working.
Are you running this in any prod environments? Also, any other gotchas or known issues? It certainly is a lot nicer to work with than cloudformation templates, but it seems the ansible aws modules have a little while to go before this could support a production environment.
I have used it to setup several production environments, but as it's a bootstrap, I'm not re-running it. Subsequent actions are being performed elsewhere.
There are some additional things that could be added to clean it up, such as using block/rescue, and a bit more verification of variables.
But the main issue is the route table forcing a gateway on the destination. Taking another quick look, it seems the route table module doesn't actually force routes to be passed (says they're required in the doc section, but there's conditionals and the param isn't marked required). In which case the solution would be to not set any private routes and extend the nat monitor script to check and create the route itself - which should be pretty easy (and is on my todo list anyway).
Hi I was just wondering if you have managed to do any updates on this ?
Hello @ste-bah, I'm no longer with HighOps and have been busy on other things. I would suggest investigating Terraform for your more complex AWS infrastructure setup, as managing it through Ansible requires a lot more investment especially if you want the ability to tear-down your environments.
HI, I've picked this up after intending to try Ansible for repeatable AWS VPC setups for a while now. Very nice work. I am hitting a few issues however, and here is one.
I have successfully run through and created the VPC, and then when making a small change and re-running the playbook, I hit this.
It seems that this is failing due to the registered variable 'ec2_vpc_route_table_private_out' not being set as the private route tables already exist and the task is skipped.
I'm new to using these VPC modules, and registered variables. I'm wondering if I'm missing something here? I'm very curious as to how Ansible determines the difference between a change and an addition in this context, as I've also tried to alter a tag Key only to have a duplicate resource created, and am finding myself having to manually destroy the instances, and VPC etc in the console quite often to be able to run through the playbook again. Perhaps there's a way for an inventory to be built during the VPC bootstrap?