This is installed on separate server for testing purposes. But this happened with every release i tried, even with the 3.0, from git, and with latest stable from repository.
---
- name: 'Create encrypted AMI'
hosts: localhost
connection: local
gather_facts: False
vars_files:
- "vars/global.yml"
tasks:
- name: 'Copy image'
ec2_ami_copy:
description: "Encrypted image"
aws_access_key: "{{ ec2_access_key }}"
aws_secret_key: "{{ ec2_secret_key }}"
source_region: "{{ ec2_region }}"
region: "{{ ec2_region }}"
source_image_id: "{{ ec2_image_id }}"
encrypted: yes
kms_key_id: "{{ ec2_encrypt_key }}"
[WARNING]: provided hosts list is empty, only localhost is available
PLAYBOOK: create_enc.yml *******************************************************
1 plays in /var/lib/awx/projects/test/create_enc.yml
PLAY [Create encrypted AMI] ****************************************************
TASK [Copy image] **************************************************************
task path: /var/lib/awx/projects/test/create_enc.yml:10
Using module file /usr/lib/python2.7/site-packages/ansible/modules/extras/cloud/amazon/ec2_ami_copy.py
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1477638624.19-200038182352706 `" && echo ansible-tmp-1477638624.19-200038182352706="` echo $HOME/.ansible/tmp/ansible-tmp-1477638624.19-200038182352706 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpCTcaiy TO /root/.ansible/tmp/ansible-tmp-1477638624.19-200038182352706/ec2_ami_copy.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1477638624.19-200038182352706/ /root/.ansible/tmp/ansible-tmp-1477638624.19-200038182352706/ec2_ami_copy.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1477638624.19-200038182352706/ec2_ami_copy.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1477638624.19-200038182352706/" > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
"changed": false,
"failed": true,
"invocation": {
"module_args": {
"aws_access_key": "*************",
"aws_secret_key": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"description": "Encrypted image",
"ec2_url": null,
"encrypted": true,
"kms_key_id": "**********",
"name": null,
"profile": null,
"region": "eu-central-1",
"security_token": null,
"source_image_id": "********",
"source_region": "eu-central-1",
"tags": null,
"validate_certs": true,
"wait": false,
"wait_timeout": "1200"
},
"module_name": "ec2_ami_copy"
},