mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-03 01:03:09 +00:00
Roll boto3_conn tests into ec2_asg (#35854)
* Roll boto3_conn tests into ec2_asg.
This commit is contained in:
@@ -1 +0,0 @@
|
||||
cloud/aws
|
||||
@@ -1,50 +0,0 @@
|
||||
---
|
||||
# tasks file for test_ec2_asg
|
||||
|
||||
- name: Test incomplete credentials with ec2_asg
|
||||
|
||||
block:
|
||||
|
||||
# ============================================================
|
||||
|
||||
- name: test invalid profile
|
||||
ec2_asg:
|
||||
name: "{{ resource_prefix }}-asg"
|
||||
region: "{{ aws_region }}"
|
||||
profile: notavalidprofile
|
||||
ignore_errors: yes
|
||||
register: result
|
||||
|
||||
- name:
|
||||
assert:
|
||||
that:
|
||||
- "'The config profile (notavalidprofile) could not be found' in result.msg"
|
||||
|
||||
- name: test partial credentials
|
||||
ec2_asg:
|
||||
name: "{{ resource_prefix }}-asg"
|
||||
region: "{{ aws_region }}"
|
||||
aws_access_key: "{{ aws_access_key }}"
|
||||
ignore_errors: yes
|
||||
register: result
|
||||
|
||||
- name:
|
||||
assert:
|
||||
that:
|
||||
- "'Partial credentials found in explicit, missing: aws_secret_access_key' in result.msg"
|
||||
|
||||
- name: test without specifying region
|
||||
ec2_asg:
|
||||
name: "{{ resource_prefix }}-asg"
|
||||
aws_access_key: "{{ aws_access_key }}"
|
||||
aws_secret_key: "{{ aws_secret_key }}"
|
||||
security_token: "{{ security_token }}"
|
||||
ignore_errors: yes
|
||||
register: result
|
||||
|
||||
- name:
|
||||
assert:
|
||||
that:
|
||||
- result.msg == 'The ec2_asg module requires a region and none was found in configuration, environment variables or module parameters'
|
||||
|
||||
# ============================================================
|
||||
@@ -1,2 +0,0 @@
|
||||
dependencies:
|
||||
- boto3_conn
|
||||
@@ -1,6 +1,54 @@
|
||||
---
|
||||
# tasks file for test_ec2_asg
|
||||
|
||||
- name: Test incomplete credentials with ec2_asg
|
||||
|
||||
block:
|
||||
|
||||
# ============================================================
|
||||
|
||||
- name: test invalid profile
|
||||
ec2_asg:
|
||||
name: "{{ resource_prefix }}-asg"
|
||||
region: "{{ aws_region }}"
|
||||
profile: notavalidprofile
|
||||
ignore_errors: yes
|
||||
register: result
|
||||
|
||||
- name:
|
||||
assert:
|
||||
that:
|
||||
- "'The config profile (notavalidprofile) could not be found' in result.msg"
|
||||
|
||||
- name: test partial credentials
|
||||
ec2_asg:
|
||||
name: "{{ resource_prefix }}-asg"
|
||||
region: "{{ aws_region }}"
|
||||
aws_access_key: "{{ aws_access_key }}"
|
||||
ignore_errors: yes
|
||||
register: result
|
||||
|
||||
- name:
|
||||
assert:
|
||||
that:
|
||||
- "'Partial credentials found in explicit, missing: aws_secret_access_key' in result.msg"
|
||||
|
||||
- name: test without specifying region
|
||||
ec2_asg:
|
||||
name: "{{ resource_prefix }}-asg"
|
||||
aws_access_key: "{{ aws_access_key }}"
|
||||
aws_secret_key: "{{ aws_secret_key }}"
|
||||
security_token: "{{ security_token }}"
|
||||
ignore_errors: yes
|
||||
register: result
|
||||
|
||||
- name:
|
||||
assert:
|
||||
that:
|
||||
- result.msg == 'The ec2_asg module requires a region and none was found in configuration, environment variables or module parameters'
|
||||
|
||||
# ============================================================
|
||||
|
||||
- name: Test incomplete arguments with ec2_asg
|
||||
|
||||
block:
|
||||
|
||||
Reference in New Issue
Block a user