ansible-auto-scaling-tutorial icon indicating copy to clipboard operation
ansible-auto-scaling-tutorial copied to clipboard

failure with lc_find

Open dhgrainger opened this issue 9 years ago • 1 comments

First of all I really like this playbook, it's a really great tutorial. The one issue I have is when I try to run the custom module lc_find. I am passing the

ESTABLISH LOCAL CONNECTION FOR USER: douggrainger localhost EXEC ( umask 22 && mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1458078036.19-221905393396085 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1458078036.19-221905393396085 )" ) localhost PUT /var/folders/y_/nxy2vpcs3d5_jztrfg2sn8t00000gn/T/tmpBgwMXq TO /Users/douggrainger/.ansible/tmp/ansible-tmp-1458078036.19-221905393396085/lc_find localhost EXEC LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /Users/douggrainger/.ansible/tmp/ansible-tmp-1458078036.19-221905393396085/lc_find; rm -rf "/Users/douggrainger/.ansible/tmp/ansible-tmp-1458078036.19-221905393396085/" > /dev/null 2>&1 fatal: [172.16.1.44 -> localhost]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "lc_find"}, "module_stderr": "\nUnknown output type: None\nTraceback (most recent call last):\n File "/Users/douggrainger/.ansible/tmp/ansible-tmp-1458078036.19-221905393396085/lc_find", line 2219, in \n main()\n File "/Users/douggrainger/.ansible/tmp/ansible-tmp-1458078036.19-221905393396085/lc_find", line 31, in main\n lc_cmd_result = subprocess.check_output(["aws", "autoscaling", "describe-launch-configurations", "--region", module.params.get('region')])\n File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output\n raise CalledProcessError(retcode, cmd, output=output)\nsubprocess.CalledProcessError: Command '['aws', 'autoscaling', 'describe-launch-configurations', '--region', 'us-east-1']' returned non-zero exit status 255\n", "module_stdout": "", "msg": "MODULE FAILURE", "parsed": false}.

These are the parameters i'm passing

  • name: Find Old Launch Configuration sudo: false local_action: module: lc_find region: 'us-east-1' name_regex: "{{rails_env}}-{{role}}-lc-*" sort: yes sort_end: -2 register: old_lc_result

dhgrainger avatar Mar 16 '16 14:03 dhgrainger

@dhgrainger Thanks for the error report. Are you sure that you have the aws command installed on your Ansible control host? You can get it on most distributions by running:

[sudo] pip install awscli

We have a new version of this module that uses native Python APIs to search for launch configurations instead of a command line subprocess - I'll update this repo sometime soon with the newer module.

manicminer avatar May 12 '16 12:05 manicminer