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

amazon.aws.ec2_instance throws deprecation warning for teardown #689

Closed
1 task done
IPvSean opened this issue Feb 22, 2022 · 2 comments · Fixed by #719
Closed
1 task done

amazon.aws.ec2_instance throws deprecation warning for teardown #689

IPvSean opened this issue Feb 22, 2022 · 2 comments · Fixed by #719
Labels
bug This issue/PR relates to a bug jira python3

Comments

@IPvSean
Copy link
Contributor

IPvSean commented Feb 22, 2022

Summary

There is a deprecation warning "Default value instance_type has been deprecated, in the future you must set an instance_type or a launch_template. This feature will be removed from amazon.aws in a release after 2023-01-01." I think this makes sense, except that this particular module does not need the instance_type set at all if you are doing state: absent. I am not sure if we just document this... or if the warning needs to be clear to ignore if you are doing state: absent, or if we can be smart enough to not display the warning if you are doing state: absent.

Issue Type

Bug Report

Component Name

amazon.aws.ec2_instance

Ansible Version

$ ansible --version
ansible [core 2.12.2]
  config file = /Users/sean/Documents/GitHub/IPvSean/workshops/provisioner/ansible.cfg
  configured module search path = ['/Users/sean/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/sean/Documents/GitHub/IPvSean/workshops/feb21/lib/python3.9/site-packages/ansible
  ansible collection location = /Users/sean/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/sean/Documents/GitHub/IPvSean/workshops/feb21/bin/ansible
  python version = 3.9.9 (main, Nov 21 2021, 03:23:42) [Clang 13.0.0 (clang-1300.0.29.3)]
  jinja version = 3.0.3
  libyaml = True

Collection Versions

(feb21) ➜  provisioner git:(gh-pages) ✗  ansible-galaxy collection list

# /Users/sean/.ansible/collections/ansible_collections
Collection                          Version
----------------------------------- -------
amazon.aws                          3.1.1
ansible.netcommon                   2.0.2
ansible.posix                       1.2.0
ansible.product_demos               1.2.12
ansible.utils                       2.5.0
ansible.windows                     1.5.0
ansible.workshops                   1.0.11
arista.eos                          2.1.2
awx.awx                             19.4.0
chocolatey.chocolatey               1.1.0
cisco.ios                           2.0.1
community.aws                       1.5.0
community.crypto                    1.6.2
community.general                   3.0.2
community.mysql                     2.1.0
community.windows                   1.3.0
containers.podman                   1.9.1
f5networks.f5_modules               1.9.0
junipernetworks.junos               2.1.0
redhat_cop.controller_configuration 2.1.1
redhat_cop.tower_utilities          2.0.1

AWS SDK versions

(feb21) ➜  provisioner git:(gh-pages) ✗ pip show boto boto3 botocore
WARNING: Package(s) not found: boto
Name: boto3
Version: 1.21.3
Summary: The AWS SDK for Python
Home-page: https://github.com/boto/boto3
Author: Amazon Web Services
Author-email:
License: Apache License 2.0
Location: /Users/sean/Documents/GitHub/IPvSean/workshops/feb21/lib/python3.9/site-packages
Requires: botocore, jmespath, s3transfer
Required-by:
---
Name: botocore
Version: 1.24.3
Summary: Low-level, data-driven core of boto 3.
Home-page: https://github.com/boto/botocore
Author: Amazon Web Services
Author-email:
License: Apache License 2.0
Location: /Users/sean/Documents/GitHub/IPvSean/workshops/feb21/lib/python3.9/site-packages
Requires: jmespath, python-dateutil, urllib3
Required-by: boto3, s3transfer

Configuration

DEFAULT_FORKS(/Users/sean/Documents/GitHub/IPvSean/workshops/provisioner/ansible.cfg) = 50
DEFAULT_HOST_LIST(/Users/sean/Documents/GitHub/IPvSean/workshops/provisioner/ansible.cfg) = ['/Users/sean/Documents/GitHub/IPvSean/workshops/provisioner/hosts']
DEFAULT_STDOUT_CALLBACK(/Users/sean/Documents/GitHub/IPvSean/workshops/provisioner/ansible.cfg) = yaml
HOST_KEY_CHECKING(/Users/sean/Documents/GitHub/IPvSean/workshops/provisioner/ansible.cfg) = False
PERSISTENT_COMMAND_TIMEOUT(/Users/sean/Documents/GitHub/IPvSean/workshops/provisioner/ansible.cfg) = 60
PERSISTENT_CONNECT_TIMEOUT(/Users/sean/Documents/GitHub/IPvSean/workshops/provisioner/ansible.cfg) = 60
RETRY_FILES_ENABLED(/Users/sean/Documents/GitHub/IPvSean/workshops/provisioner/ansible.cfg) = False

OS / Environment

MacOS Big Sur Version 11.6.1

Steps to Reproduce

# Destroy VPC 2 instances for network automation
- name: destroy EC2 instances (VPC2)
  amazon.aws.ec2_instance:
    region: "{{ ec2_region }}"
    state: absent
    instance_ids: "{{ all_workshop_vpc2_nodes.instances | map(attribute='instance_id') | list }}"
    wait: true
    wait_timeout: "{{ student_total * 300 | int}}"
  register: result_ec2_destroy2
  when:
    - ec2_vpc_id2 is defined
    - all_workshop_vpc2_nodes.instances

Expected Results

No purple warning

Actual Results

TASK [../roles/manage_ec2_instances : destroy EC2 instances (VPC2)] *****************************************************************************************************************************************************************************
[DEPRECATION WARNING]: Default value instance_type has been deprecated, in the future you must set an instance_type or a launch_template. This feature will be removed from amazon.aws in a release after 2023-01-01. Deprecation warnings can
be disabled by setting deprecation_warnings=False in ansible.cfg.
changed: [localhost]

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link

Files identified in the description:
None

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 ansibullbot added bug This issue/PR relates to a bug needs_triage python3 labels Feb 22, 2022
@alinabuzachis
Copy link
Collaborator

@IPvSean Thank you for raising this. I guess we can easily reduce the scope of this warning to specific states. Do you agree @jillr?

softwarefactory-project-zuul bot pushed a commit that referenced this issue Mar 21, 2022
Fix deprecation warning scope

SUMMARY

Fix deprecation warning scope to be not displayed while terminating instances.

Fixes #689
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

ec2_instance

Reviewed-by: Joseph Torcasso <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: Mandar Kulkarni <[email protected]>
patchback bot pushed a commit that referenced this issue Mar 21, 2022
Fix deprecation warning scope

SUMMARY

Fix deprecation warning scope to be not displayed while terminating instances.

Fixes #689
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

ec2_instance

Reviewed-by: Joseph Torcasso <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: Mandar Kulkarni <[email protected]>
(cherry picked from commit d6b1186)
softwarefactory-project-zuul bot pushed a commit that referenced this issue Mar 23, 2022
[PR #719/d6b11864 backport][stable-3] Fix deprecation warning scope

This is a backport of PR #719 as merged into main (d6b1186).
SUMMARY

Fix deprecation warning scope to be not displayed while terminating instances.

Fixes #689
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

ec2_instance
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Oct 24, 2023
…s3_sync-file_root

s3_sync: file_root parameter - handle individual file path

SUMMARY

Added ability to handle individual file path and upload an individual file to s3 bucket.
Fixes ansible-collections#689.

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

s3_sync

Reviewed-by: Markus Bergholz <[email protected]>
Reviewed-by: None <None>
Reviewed-by: Mark Chappell <None>
Reviewed-by: None <None>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug jira python3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants