Skip to content

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

Open
@msemikin

Description

@msemikin
SUMMARY

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

ISSUE TYPE
  • Bug Report
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions