sborenst / ansible_aws_deployer

20 stars 20 forks source link

Get Hosts from aws - task register change even when aws cli is not installed #13

Closed kenthua closed 7 years ago

kenthua commented 7 years ago

This registers as changed even when the aws cli is not installed. https://github.com/sborenst/ansible_aws_deployer/blob/master/ansible/dynamic_inventory.yml#L4-L7

Causes this to fail because it never really got the inventory. This is where I got the missing nfs variable. https://github.com/sborenst/ansible_aws_deployer/blob/master/ansible/dynamic_inventory.yml#L28-L30

thoraxe commented 7 years ago

I'm not sure what to do about that. If you don't have the aws CLI you are missing a prereq. I suppose we could add a task to check the prereqs but... that's not really an issue with the plays or tasks...

kenthua commented 7 years ago

I know it's listed as a pre-req, but if the cf-list-hosts.sh script fails for any reason, which it did by missing not being able to execute the aws command, the task itself should fail. What if it fails while trying to call to amazon, would the tasks still register change, which will then still fail on the generate ansible hosts file task.

thoraxe commented 7 years ago

it might need an all errors fatal flag in the play.

Give it a try and see if that helps.

kenthua commented 7 years ago

all errors fatal doesn't take effect because it always completes with changed regardless of error. If aws sdk is mssing or any errors within cf-list-hosts.sh

PR https://github.com/sborenst/ansible_aws_deployer/pull/15