ansible-collections / community.aws

Ansible Collection for Community AWS
GNU General Public License v3.0
187 stars 395 forks source link

Batch compute environment fails in check mode when there are updates to make #147

Open msemikin opened 4 years ago

msemikin commented 4 years ago
SUMMARY

Batch compute environment fails in check mode when there are updates to make

ISSUE TYPE
COMPONENT NAME

aws_batch_compute_environment

ANSIBLE VERSION

Slightly modified to remove sensitive info

ansible 2.9.9
  config file = ./ansible/ansible.cfg
  configured module search path = ['~/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = .../.venv/lib/python3.7/site-packages/ansible
  executable location = .../.venv/bin/ansible
  python version = 3.7.6 (default, Jan  8 2020, 19:59:22) [GCC 7.3.0]
CONFIGURATION

Slightly modified to remove sensitive info

DEFAULT_JINJA2_NATIVE = True
DEFAULT_STDOUT_CALLBACK = debug
HOST_KEY_CHECKING = False
OS / ENVIRONMENT

Ubuntu 20.04 64bit

STEPS TO REPRODUCE

Run the module in check mode when a compute environment already exists but with a slightly different configuration

- name: Batch compute environment
  aws_batch_compute_environment:
    compute_environment_name: "{{ aws_batch_compute_environment_name }}"
    state: present
    compute_environment_state: ENABLED
    type: MANAGED
    compute_resource_type: EC2
    minv_cpus: 0
    maxv_cpus: "{{ batch_max_cpus}}"
    desiredv_cpus: "{{ batch_desired_cpus }}"
    instance_types:
      - i3
    subnets:
      - "{{ private_subnets.subnets.0.id }}"
    security_group_ids:
      - "{{ batch_security_groups.security_groups.0.group_id }}"
    instance_role: "{{ aws_batch_ecs_instance_role_name }}"
    tags:
      Project: "{{ project_tag }}"
    service_role: "{{ aws_batch_service_role.iam_role.arn }}"
  register: compute_environment
EXPECTED RESULTS

The module reports changed but does not fail

ACTUAL RESULTS

The module fails with an error

TASK [aws_batch : Batch compute environment] *****************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {
    "changed": false
}
MSG:
Unable to get compute environment information after creating
ansibullbot commented 4 years ago

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 4 years ago

cc @jillr @jonmer85 @s-hertel @tremble @wimnat click here for bot help