forked from ansible-collections/community.aws
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ec2_instance don't change termination protection in check mode (ansib…
…le-collections#505) * ec2_instance don't change termination protection in check mode Fixes: ansible/ansible/issues/67716 Extend termination protection tests * Set the path for the aws CLI tool - setting ansible_python_interpreter updates the python search path but not the shell search path * changelog Co-authored-by: Mark Chappell <[email protected]>
- Loading branch information
Showing
5 changed files
with
120 additions
and
7 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
changelogs/fragments/505-ec2_instance-terminate_protection.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bugfixes: | ||
- ec2_instance - ensure that termination protection isn't modified when using check_mode (https://github.com/ansible/ansible/issues/67716). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...egration/targets/ec2_instance/roles/ec2_instance/tasks/termination_protection_wrapper.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
- include_role: | ||
name: 'setup_remote_tmp_dir' | ||
|
||
- set_fact: | ||
virtualenv: "{{ remote_tmp_dir }}/virtualenv" | ||
virtualenv_command: "{{ ansible_python_interpreter }} -m virtualenv" | ||
|
||
- set_fact: | ||
virtualenv_interpreter: "{{ virtualenv }}/bin/python" | ||
aws_cli: "{{ virtualenv }}/bin/aws" | ||
|
||
- pip: | ||
name: "virtualenv" | ||
|
||
- pip: | ||
name: | ||
- awscli<=1.18.159 | ||
- botocore<1.19.0,>=1.13.3 | ||
- boto3 >= 1.9.250, <= 1.15.18 | ||
- coverage<5 | ||
virtualenv: "{{ virtualenv }}" | ||
virtualenv_command: "{{ virtualenv_command }}" | ||
virtualenv_site_packages: no | ||
|
||
- include_tasks: termination_protection.yml | ||
vars: | ||
ansible_python_interpreter: "{{ virtualenv_interpreter }}" | ||
|
||
- file: | ||
state: absent | ||
path: "{{ virtualenv }}" |