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

ec2_asg: backport PRs 960 and 933 #982

Conversation

alinabuzachis
Copy link
Contributor

@alinabuzachis alinabuzachis commented Mar 11, 2022

SUMMARY

ec2_asg: backports PRs #960 and #933

ISSUE TYPE
  • Bugfix Pull Request
  • Docs Pull Request
  • Feature Pull Request
  • New Module Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION

…sible-collections#933)

ec2_asg: Add functionality to detach specified instances from ASG 

SUMMARY

Adds feature to detach specified instances from a AutoScalingGroup rather than terminating them directly.
Detached instances are not terminated and can be managed independently.

Implements ansible-collections#649
ISSUE TYPE


Feature Pull Request

COMPONENT NAME

ec2_asg
ADDITIONAL INFORMATION


Makes use of
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/autoscaling.html#AutoScaling.Client.detach_instances

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Mandar Kulkarni <mandar242@gmail.com>
Reviewed-by: Jill R <None>
Reviewed-by: Joseph Torcasso <None>
ec2_asg: Add purge_tags to AutoScalingGroups.

SUMMARY

Add purge_tags to ec2_asg module.

Fixes ansible-collections#481.
ISSUE TYPE


Feature Pull Request

COMPONENT NAME

ec2_asg
ADDITIONAL INFORMATION

There was another PR (currently closed) ansible-collections#482 - with similar functionality but I'm not sure if having modules to handle tags for individual services/modules is a good way to have this functionality. It will certainly cause increase in number of modules.
Hence tried modifying existing ec2_asg module to be able to do this.

This utilizes underlying API calls to:
https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeTags.html
https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_CreateOrUpdateTags.html
https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DeleteTags.html

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Jill R <None>
Reviewed-by: Mandar Kulkarni <mandar242@gmail.com>
@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug community_review integration tests/integration module module needs_triage plugins plugin (any type) tests tests labels Mar 11, 2022
@alinabuzachis alinabuzachis changed the title ec2_asg: backports PRs 960 and 933 ec2_asg: backport PRs 960 and 933 Mar 11, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@markuman
Copy link
Member

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@markuman
Copy link
Member

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@markuman
Copy link
Member

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@markuman
Copy link
Member

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@alinabuzachis
Copy link
Contributor Author

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@markuman
Copy link
Member

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@markuman
Copy link
Member

@alinabuzachis

    "message": "The runtime parameter of python2.7 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions."

imo this is not related to this backport PR

@markuman
Copy link
Member

hmmm, maybe a rebase is sufficient, because it is already solved in the main branch.

@markuman
Copy link
Member

Ah, I think we must also backport #984

@marknet15
Copy link
Contributor

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@markuman markuman closed this Mar 28, 2022
@markuman markuman reopened this Mar 28, 2022
@markuman
Copy link
Member

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@markuman
Copy link
Member

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@alinabuzachis
Copy link
Contributor Author

recheck

@markuman
Copy link
Member

maybe some waiter issue (without knowing the source code of the step function...)

TASK [aws_step_functions_state_machine : Stop execution of state machine -- check_mode] ***
task path: /home/zuul/.ansible/collections/ansible_collections/community/aws/tests/integration/targets/aws_step_functions_state_machine/tasks/main.yml:182
Using module file /home/zuul/.ansible/collections/ansible_collections/community/aws/plugins/modules/aws_step_functions_state_machine_execution.py
Pipelining is enabled.
<testhost> ESTABLISH LOCAL CONNECTION FOR USER: zuul
<testhost> EXEC /bin/sh -c 'ANSIBLE_DEBUG_BOTOCORE_LOGS=True /home/zuul/venv/bin/python && sleep 0'
ok: [testhost] => {
    "changed": false,
    "invocation": {
        "module_args": {
            "action": "stop",
            "aws_access_key": "ASIA6CCDWXDOKLY6LH5I",
            "aws_ca_bundle": null,
            "aws_config": null,
            "aws_secret_key": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "cause": "cause of the failure",
            "debug_botocore_endpoint_logs": true,
            "ec2_url": null,
            "error": "error code of the failure",
            "execution_arn": "arn:aws:states:us-east-1:966509639900:execution:2e7dc7a4ff1b_step_function_332606827:ansible-test-77340140-node-0002304223_sfn_execution",
            "execution_input": "{}",
            "name": null,
            "profile": null,
            "region": "us-east-1",
            "security_token": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "state_machine_arn": null,
            "validate_certs": true
        }
    },
    "output": "State machine execution is not running.",
    "resource_actions": [
        "states:DescribeExecution"
    ]
}

TASK [aws_step_functions_state_machine : assert] *******************************
task path: /home/zuul/.ansible/collections/ansible_collections/community/aws/tests/integration/targets/aws_step_functions_state_machine/tasks/main.yml:191
fatal: [testhost]: FAILED! => {
    "assertion": "stop_execution_output.changed",
    "changed": false,
    "evaluated_to": false,
    "msg": "Assertion failed"
}

@markuman
Copy link
Member

hm, no, it was in check_mode hmm

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@markuman
Copy link
Member

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@markuman
Copy link
Member

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@markuman
Copy link
Member

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@markuman
Copy link
Member

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@markuman
Copy link
Member

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@markuman
Copy link
Member

WOW!!!!!

@markuman markuman added the mergeit Merge the PR (SoftwareFactory) label Mar 30, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build failed (gate pipeline). For information on how to proceed, see
http://docs.openstack.org/infra/manual/developers.html#automated-testing

@markuman
Copy link
Member

regate

@softwarefactory-project-zuul
Copy link
Contributor

Build failed (gate pipeline). For information on how to proceed, see
http://docs.openstack.org/infra/manual/developers.html#automated-testing

@markuman
Copy link
Member

regate

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 73328aa into ansible-collections:stable-3 Mar 30, 2022
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 community_review integration tests/integration mergeit Merge the PR (SoftwareFactory) module module plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants