cloudformation create_stack() got an unexpected keyword argument 'stack_policy_body'

232 views
Skip to first unread message

John G

unread,
Mar 2, 2016, 8:47:44 PM3/2/16
to Ansible Project
Hi,

I am getting this error on Ubuntu 14.04.4 LTS. Any idea what is causing it?

$ ansible-playbook go_cloud.yml  -vvvv
Using /home/johng/Documents/ansible/ansible/ansible.cfg as config file
Loaded callback default of type stdout, v2.0
Loaded callback unnamed of type old, v1.0
1 plays in go_cloud.yml

PLAY
***************************************************************************

TASK
[setup] *******************************************************************
ESTABLISH LOCAL CONNECTION FOR USER
: johng
127.0.0.1 EXEC /bin/sh -c '( umask 22 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1456960430.23-151711803624276 `" && echo "` echo $HOME/.ansible/tmp/ansible-tmp-1456960430.23-151711803624276 `" )'
127.0.0.1 PUT /tmp/tmpt7aQZU TO /home/johng/.ansible/tmp/ansible-tmp-1456960430.23-151711803624276/setup
127.0.0.1 EXEC /bin/sh -c 'LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python /home/johng/.ansible/tmp/ansible-tmp-1456960430.23-151711803624276/setup; rm -rf "/home/johng/.ansible/tmp/ansible-tmp-1456960430.23-151711803624276/" > /dev/null 2>&1'
ok
: [localhost]

TASK
[Push hello-app cloudformation stack] *************************************
task path
: /home/johng/Documents/ansible/ansible/go_cloud.yml:5
ESTABLISH LOCAL CONNECTION FOR USER
: johng
127.0.0.1 EXEC /bin/sh -c '( umask 22 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1456960431.07-114836551388786 `" && echo "` echo $HOME/.ansible/tmp/ansible-tmp-1456960431.07-114836551388786 `" )'
127.0.0.1 PUT /tmp/tmp4Pac7s TO /home/johng/.ansible/tmp/ansible-tmp-1456960431.07-114836551388786/cloudformation
127.0.0.1 EXEC /bin/sh -c 'LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python /home/johng/.ansible/tmp/ansible-tmp-1456960431.07-114836551388786/cloudformation; rm -rf "/home/johng/.ansible/tmp/ansible-tmp-1456960431.07-114836551388786/" > /dev/null 2>&1'
fatal
: [localhost]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"aws_access_key": "XXXXXXXXXXXXXXXXXXXX", "aws_secret_key": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "disable_rollback": false, "ec2_url": null, "notification_arns": null, "profile": null, "region": "us-east-1", "security_token": null, "stack_name": "ittest7", "stack_policy": null, "state": "present", "tags": null, "template": "EC2InstanceWithSecurityGroupSample.template", "template_format": "json", "template_parameters": {"InstanceType": "t2.micro", "KeyName": "sysadmin-key"}, "template_url": null, "validate_certs": true}, "module_name": "cloudformation"}, "msg": "create_stack() got an unexpected keyword argument 'stack_policy_body'"}

msg
: create_stack() got an unexpected keyword argument 'stack_policy_body'

NO MORE HOSTS LEFT
*************************************************************
        to
retry, use: --limit @go_cloud.retry

PLAY RECAP
*********************************************************************
localhost                  
: ok=1    changed=0    unreachable=0    failed=1



$ ansible --version
ansible
2.0.1.0
  config file
= /home/johng/Documents/ansible/ansible/ansible.cfg
  configured
module search path = /usr/share/ansible
$ cat
/etc/lsb-release
DISTRIB_ID
=Ubuntu
DISTRIB_RELEASE
=14.04
DISTRIB_CODENAME
=trusty
DISTRIB_DESCRIPTION
="Ubuntu 14.04.4 LTS"


---
- hosts: localhost
  tasks
:
   
- name: Push hello-app cloudformation stack
      cloudformation
:
        aws_access_key
: "{{ lookup('env', 'AWS_ACCESS_KEY_ID')  }}"
        aws_secret_key
: "{{ lookup('env', 'AWS_SECRET_ACCESS_KEY')  }}"
        stack_name
: "ittest7"
        state
: present
        region
: "us-east-1"
       
template: "EC2InstanceWithSecurityGroupSample.template"
        template_parameters
:
         
InstanceType: "t2.micro"
         
KeyName: "sysadmin-key"




Works OK on CentOS 7 with ansible 2.0.0.2.

$ ansible-playbook go_cloud.yml
[WARNING]: log file at /var/log/ansible.log is not writeable, aborting

 
[WARNING]: provided hosts list is empty, only localhost is available


PLAY
***************************************************************************

TASK
[setup] *******************************************************************
ok
: [localhost]

TASK
[Push hello-app cloudformation stack] *************************************
ok
: [localhost]

PLAY RECAP
*********************************************************************
localhost                  
: ok=2    changed=0    unreachable=0    failed=0  

$ ansible
--version
[WARNING]: log file at /var/log/ansible.log is not writeable, aborting

ansible
2.0.0.2
  config file
= /etc/ansible/ansible.cfg
  configured
module search path = /usr/share/ansible
$ cat
/etc/redhat-release
CentOS Linux release 7.0.1406 (Core)



Thanks

John G

unread,
Mar 3, 2016, 4:01:33 PM3/3/16
to Ansible Project
Found my issue. It was picking up an old version of boto. I removed the deb package and reinstalled the pip version.

$ strace -o boto_strace  python -c 'import boto; print boto.__version__'
2.20.1

# apt-get remove python-boto
# pip install --upgrade --force-reinstall  boto

$ python -c 'import boto; print boto.__version__'
2.39.0

Reply all
Reply to author
Forward
0 new messages