Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqs_queue is not idempotent when any queue attribute parameter passed in playbook #578

Closed
shivpathak opened this issue May 13, 2021 · 0 comments · Fixed by #592
Closed

Comments

@shivpathak
Copy link

SUMMARY

sqs-queue is not idempotent if we pass any parameter (sqs attributes)

ISSUE TYPE
  • Bug Report
COMPONENT NAME
ANSIBLE VERSION
ansible 2.10.4
  config file = None
  configured module search path = ['/Users/spathak3/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/ansible
  executable location = /Library/Frameworks/Python.framework/Versions/3.8/bin/ansible
  python version = 3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27) [Clang 6.0 (clang-600.0.57)]
CONFIGURATION
No change
OS / ENVIRONMENT

Darwin Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 i386

STEPS TO REPRODUCE
# This playbook is idempotent running multiple time
---
- name: sqs idempotency check
  hosts: localhost
  tasks:
  - name: Idempotence check
    community.aws.sqs_queue:
      name: sqs-idempotency-issue
      region: eu-west-1
      state: present

# This playbook is NOT idempotent on multiple run, only happen when we pass any attribute params here e.g. default_visibility_timeout
---
- name: sqs idempotency check
  hosts: localhost
  tasks:
  - name: Idempotence check
    community.aws.sqs_queue:
      name: sqs-idempotency-issue
      region: eu-west-1
      state: present
      default_visibility_timeout: 120
EXPECTED RESULTS

setting parameter (sqs attributes) in playbook shouldn't prevent the idempotency.

ACTUAL RESULTS

Adding parameter default_visibility_timeout: 120 prevents idempotency on multiple run.

spathak3@macbook ~/infra/aws-operator
> $ (⎈ |minikube:aws-operator-system) ansible-playbook roles/sqs-queue/tasks/demo.yaml -v
No config file found; using defaults
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [sqs idempotency check] *************************************************************************************************************************************************************************

TASK [Gathering Facts] *******************************************************************************************************************************************************************************
ok: [localhost]

TASK [Idempotence check] *****************************************************************************************************************************************************************************
changed: [localhost] => {"approximate_number_of_messages": 0, "approximate_number_of_messages_delayed": 0, "approximate_number_of_messages_not_visible": 0, "changed": true, "created_timestamp": 1620915962, "default_visibility_timeout": 120, "delay_seconds": 0, "delivery_delay": 0, "last_modified_timestamp": 1620916213, "maximum_message_size": 262144, "message_retention_period": 345600, "name": "sqs-idempotency-issue", "policy": null, "queue_arn": "arn:aws:sqs:eu-west-1:822436023150:sqs-idempotency-issue", "queue_url": "https://eu-west-1.queue.amazonaws.com/822436023150/sqs-idempotency-issue", "receive_message_wait_time": 0, "receive_message_wait_time_seconds": 0, "redrive_policy": null, "region": "eu-west-1", "tags": {}, "visibility_timeout": 120}

PLAY RECAP *******************************************************************************************************************************************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0




spathak3@macbook ~/infra/aws-operator
> $ (⎈ |minikube:aws-operator-system) ansible-playbook roles/sqs-queue/tasks/demo.yaml -v
No config file found; using defaults
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [sqs idempotency check] *************************************************************************************************************************************************************************

TASK [Gathering Facts] *******************************************************************************************************************************************************************************
ok: [localhost]

TASK [Idempotence check] *****************************************************************************************************************************************************************************
changed: [localhost] => {"approximate_number_of_messages": 0, "approximate_number_of_messages_delayed": 0, "approximate_number_of_messages_not_visible": 0, "changed": true, "created_timestamp": 1620915962, "default_visibility_timeout": 120, "delay_seconds": 0, "delivery_delay": 0, "last_modified_timestamp": 1620916213, "maximum_message_size": 262144, "message_retention_period": 345600, "name": "sqs-idempotency-issue", "policy": null, "queue_arn": "arn:aws:sqs:eu-west-1:822436023150:sqs-idempotency-issue", "queue_url": "https://eu-west-1.queue.amazonaws.com/822436023150/sqs-idempotency-issue", "receive_message_wait_time": 0, "receive_message_wait_time_seconds": 0, "redrive_policy": null, "region": "eu-west-1", "tags": {}, "visibility_timeout": 120}

PLAY RECAP *******************************************************************************************************************************************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0



spathak3@macbook~/infra/aws-operator
> $ (⎈ |minikube:aws-operator-system) ansible-playbook roles/sqs-queue/tasks/demo.yaml -v
No config file found; using defaults
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [sqs idempotency check] *************************************************************************************************************************************************************************

TASK [Gathering Facts] *******************************************************************************************************************************************************************************
ok: [localhost]

TASK [Idempotence check] *****************************************************************************************************************************************************************************
changed: [localhost] => {"approximate_number_of_messages": 0, "approximate_number_of_messages_delayed": 0, "approximate_number_of_messages_not_visible": 0, "changed": true, "created_timestamp": 1620915962, "default_visibility_timeout": 120, "delay_seconds": 0, "delivery_delay": 0, "last_modified_timestamp": 1620916213, "maximum_message_size": 262144, "message_retention_period": 345600, "name": "sqs-idempotency-issue", "policy": null, "queue_arn": "arn:aws:sqs:eu-west-1:822436023150:sqs-idempotency-issue", "queue_url": "https://eu-west-1.queue.amazonaws.com/822436023150/sqs-idempotency-issue", "receive_message_wait_time": 0, "receive_message_wait_time_seconds": 0, "redrive_policy": null, "region": "eu-west-1", "tags": {}, "visibility_timeout": 120}

PLAY RECAP *******************************************************************************************************************************************************************************************
localhost                  : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0


ansible-zuul bot added a commit that referenced this issue Jul 9, 2021
Fix queue attribute comparison

SUMMARY

Fixes sqs queue attribute comparison so updates are not performed on subsequent runs.  Also adds integration tests to verify this behavior.

Fixes #578
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

sqs_queue
ADDITIONAL INFORMATION

Reviewed-by: Markus Bergholz <git@osuv.de>
Reviewed-by: Mark Chappell <None>
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this issue Jul 15, 2021
…eueIdempotent

Fix queue attribute comparison

SUMMARY

Fixes sqs queue attribute comparison so updates are not performed on subsequent runs.  Also adds integration tests to verify this behavior.

Fixes ansible-collections#578
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

sqs_queue
ADDITIONAL INFORMATION

Reviewed-by: Markus Bergholz <git@osuv.de>
Reviewed-by: Mark Chappell <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@3513a09
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this issue Jul 16, 2021
…eueIdempotent

Fix queue attribute comparison

SUMMARY

Fixes sqs queue attribute comparison so updates are not performed on subsequent runs.  Also adds integration tests to verify this behavior.

Fixes ansible-collections#578
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

sqs_queue
ADDITIONAL INFORMATION

Reviewed-by: Markus Bergholz <git@osuv.de>
Reviewed-by: Mark Chappell <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@3513a09
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this issue Jul 17, 2021
…eueIdempotent

Fix queue attribute comparison

SUMMARY

Fixes sqs queue attribute comparison so updates are not performed on subsequent runs.  Also adds integration tests to verify this behavior.

Fixes ansible-collections#578
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

sqs_queue
ADDITIONAL INFORMATION

Reviewed-by: Markus Bergholz <git@osuv.de>
Reviewed-by: Mark Chappell <None>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@36b1d6f
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this issue Jul 19, 2021
Fix queue attribute comparison

SUMMARY

Fixes sqs queue attribute comparison so updates are not performed on subsequent runs.  Also adds integration tests to verify this behavior.

Fixes ansible-collections#578
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

sqs_queue
ADDITIONAL INFORMATION

Reviewed-by: Markus Bergholz <git@osuv.de>
Reviewed-by: Mark Chappell <None>
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this issue Jul 19, 2021
Fix queue attribute comparison

SUMMARY

Fixes sqs queue attribute comparison so updates are not performed on subsequent runs.  Also adds integration tests to verify this behavior.

Fixes ansible-collections#578
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

sqs_queue
ADDITIONAL INFORMATION

Reviewed-by: Markus Bergholz <git@osuv.de>
Reviewed-by: Mark Chappell <None>
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this issue Jul 19, 2021
Fix queue attribute comparison

SUMMARY

Fixes sqs queue attribute comparison so updates are not performed on subsequent runs.  Also adds integration tests to verify this behavior.

Fixes ansible-collections#578
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

sqs_queue
ADDITIONAL INFORMATION

Reviewed-by: Markus Bergholz <git@osuv.de>
Reviewed-by: Mark Chappell <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant