Skip to content

Commit

Permalink
change
Browse files Browse the repository at this point in the history
  • Loading branch information
markuman committed Dec 1, 2023
1 parent e60b55d commit efc5d87
Show file tree
Hide file tree
Showing 16 changed files with 76 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
that:
- update_origin_origin_shield.changed
- update_origin_origin_shield.origins['items'][0].origin_shield.enabled
- update_origin_origin_shield.origins['items'][0].origin_shield.origin_shield_region == '{{ aws_region }}'
- update_origin_origin_shield.origins['items'][0].origin_shield.origin_shield_region == aws_region

# TODO: fix module idempotency issue
# - name: enable origin Origin Shield again to test idempotency
Expand Down
12 changes: 6 additions & 6 deletions tests/integration/targets/codecommit_repository/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- assert:
that:
- output is changed
- output.repository_metadata.repository_name == '{{ resource_prefix }}_repo'
- output.repository_metadata.repository_name == resource_prefix ~ '_repo'
- output.repository_metadata.repository_description == 'original comment'

- name: No-op update to repository
Expand All @@ -39,7 +39,7 @@
- assert:
that:
- output is not changed
- output.repository_metadata.repository_name == '{{ resource_prefix }}_repo'
- output.repository_metadata.repository_name == resource_prefix ~ '_repo'
- output.repository_metadata.repository_description == 'original comment'

- name: Update repository description (CHECK MODE)
Expand All @@ -52,7 +52,7 @@
- assert:
that:
- output is changed
- output.repository_metadata.repository_name == '{{ resource_prefix }}_repo'
- output.repository_metadata.repository_name == resource_prefix ~ '_repo'
- output.repository_metadata.repository_description == 'original comment'

- name: Update repository description
Expand All @@ -64,7 +64,7 @@
- assert:
that:
- output is changed
- output.repository_metadata.repository_name == '{{ resource_prefix }}_repo'
- output.repository_metadata.repository_name == resource_prefix ~ '_repo'
- output.repository_metadata.repository_description == 'new comment'

# ============================================================
Expand Down Expand Up @@ -104,7 +104,7 @@
- assert:
that:
- output is changed
- output.repository_metadata.repository_name == '{{ resource_prefix }}_repo'
- output.repository_metadata.repository_name == resource_prefix ~ '_repo'

- name: No-op update to repository without description
codecommit_repository:
Expand All @@ -114,7 +114,7 @@
- assert:
that:
- output is not changed
- output.repository_metadata.repository_name == '{{ resource_prefix }}_repo'
- output.repository_metadata.repository_name == resource_prefix ~ '_repo'

- name: Delete a repository without description
codecommit_repository:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
assert:
that:
- ecs_service_creation_hcgp.changed
- "{{ecs_service_creation_hcgp.service.healthCheckGracePeriodSeconds}} == 30"
- ecs_service_creation_hcgp.service.healthCheckGracePeriodSeconds == 30

- name: update ecs_service using health_check_grace_period_seconds
ecs_service:
Expand All @@ -368,7 +368,7 @@
assert:
that:
- ecs_service_creation_hcgp2.changed
- "{{ecs_service_creation_hcgp2.service.healthCheckGracePeriodSeconds}} == 10"
- ecs_service_creation_hcgp2.service.healthCheckGracePeriodSeconds == 10

- name: update ecs_service using REPLICA scheduling_strategy
ecs_service:
Expand Down Expand Up @@ -453,8 +453,8 @@
assert:
that:
- ecs_task_definition_constraints is changed
- ecs_task_definition_constraints.taskdefinition.placementConstraints[0].type == "{{ ecs_taskdefinition_placement_constraints[0].type }}"
- ecs_task_definition_constraints.taskdefinition.placementConstraints[0].expression == "{{ ecs_taskdefinition_placement_constraints[0].expression }}"
- ecs_task_definition_constraints.taskdefinition.placementConstraints[0].type == ecs_taskdefinition_placement_constraints[0].type
- ecs_task_definition_constraints.taskdefinition.placementConstraints[0].expression == ecs_taskdefinition_placement_constraints[0].expression

- name: Remove ecs task definition with placement constraints
ecs_taskdefinition:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/targets/ecs_ecr/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@
- name: it should use the provided KMS key
assert:
that:
- result.repository.encryptionConfiguration.kmsKey == '{{ kms_test_key.key_arn }}'
- result.repository.encryptionConfiguration.kmsKey == kms_test_key.key_arn

always:

Expand Down
14 changes: 7 additions & 7 deletions tests/integration/targets/ecs_tag/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
assert:
that:
- taglist.changed == true
- taglist.added_tags.Name == "{{ resource_prefix }}"
- taglist.added_tags.Name == resource_prefix
- taglist.added_tags.another == "foobar"

- name: cluster tags - Add tags to cluster again
Expand Down Expand Up @@ -162,8 +162,8 @@
assert:
that:
- taglist.changed == true
- taglist.added_tags.Name == "service-{{ resource_prefix }}"
- taglist.tags.Name == "service-{{ resource_prefix }}"
- "taglist.added_tags.Name == 'service-' ~ resource_prefix"
- "taglist.tags.Name == 'service-' ~ resource_prefix"

- name: services tags - Add name tag again - see no change
ecs_tag:
Expand All @@ -179,7 +179,7 @@
assert:
that:
- taglist.changed == false
- taglist.tags.Name == "service-{{ resource_prefix }}"
- "taglist.tags.Name == 'service-' ~ resource_prefix"

- name: service tags - remove service tags
ecs_tag:
Expand Down Expand Up @@ -215,8 +215,8 @@
assert:
that:
- taglist.changed == true
- taglist.added_tags.Name == "task_definition-{{ resource_prefix }}"
- taglist.tags.Name == "task_definition-{{ resource_prefix }}"
- "taglist.added_tags.Name == 'task_definition-' ~ resource_prefix"
- "taglist.tags.Name == 'task_definition-' ~ resource_prefix"

- name: task_definition tags - Add name tag again - see no change
ecs_tag:
Expand All @@ -232,7 +232,7 @@
assert:
that:
- taglist.changed == false
- taglist.tags.Name == "task_definition-{{ resource_prefix }}"
- "taglist.tags.Name == 'task_definition-' ~ resource_prefix"

- name: task_definition tags - remove task_definition tags
ecs_tag:
Expand Down
18 changes: 9 additions & 9 deletions tests/integration/targets/elb_target_info/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@

- assert:
that:
- "{{ alb_target_group.target_group_arn in (target_facts.instance_target_groups | map(attribute='target_group_arn')) }}"
- "{{ nlb_target_group.target_group_arn in (target_facts.instance_target_groups | map(attribute='target_group_arn')) }}"
- "{{ idle_target_group.target_group_arn not in (target_facts.instance_target_groups | map(attribute='target_group_arn')) }}"
- "alb_target_group.target_group_arn in (target_facts.instance_target_groups | map(attribute='target_group_arn'))"
- "nlb_target_group.target_group_arn in (target_facts.instance_target_groups | map(attribute='target_group_arn'))"
- "idle_target_group.target_group_arn not in (target_facts.instance_target_groups | map(attribute='target_group_arn'))"
- (target_facts.instance_target_groups | length) == 2
msg: "target facts showed the target in the right target groups"

Expand All @@ -228,9 +228,9 @@

- assert:
that:
- "{{ alb_target_group.target_group_arn in (target_facts.instance_target_groups | map(attribute='target_group_arn')) }}"
- "{{ nlb_target_group.target_group_arn in (target_facts.instance_target_groups | map(attribute='target_group_arn')) }}"
- "{{ idle_target_group.target_group_arn in (target_facts.instance_target_groups | map(attribute='target_group_arn')) }}"
- "alb_target_group.target_group_arn in (target_facts.instance_target_groups | map(attribute='target_group_arn'))"
- "nlb_target_group.target_group_arn in (target_facts.instance_target_groups | map(attribute='target_group_arn'))"
- "idle_target_group.target_group_arn in (target_facts.instance_target_groups | map(attribute='target_group_arn'))"
- (target_facts.instance_target_groups | length) == 3
msg: "target facts reflected the addition of the target to the idle group"

Expand All @@ -242,9 +242,9 @@

- assert:
that:
- "{{ alb_target_group.target_group_arn in (target_facts.instance_target_groups | map(attribute='target_group_arn')) }}"
- "{{ nlb_target_group.target_group_arn in (target_facts.instance_target_groups | map(attribute='target_group_arn')) }}"
- "{{ idle_target_group.target_group_arn not in (target_facts.instance_target_groups | map(attribute='target_group_arn')) }}"
- "alb_target_group.target_group_arn in (target_facts.instance_target_groups | map(attribute='target_group_arn'))"
- "nlb_target_group.target_group_arn in (target_facts.instance_target_groups | map(attribute='target_group_arn'))"
- "idle_target_group.target_group_arn not in (target_facts.instance_target_groups | map(attribute='target_group_arn'))"
- (target_facts.instance_target_groups | length) == 2
msg: "target_facts.instance_target_groups did not gather unused target groups when variable was set"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
- name: assert the hostvars are defined with prefix and/or suffix
assert:
that:
- "hostvars[broker_name].{{ vars_prefix }}host_instance_type{{ vars_suffix }} == 'mq.t3.micro'"
- "hostvars[broker_name].{{ vars_prefix }}engine_type{{ vars_suffix }} == '{{ engine }}'"
- "hostvars[broker_name].{{ vars_prefix }}broker_state{{ vars_suffix }} in ('CREATION_IN_PROGRESS', 'RUNNING')"
- "hostvars[broker_name][vars_prefix ~ 'host_instance_type' ~ vars_suffix] == 'mq.t3.micro'"
- "hostvars[broker_name][vars_prefix ~ 'engine_type' ~ vars_suffix] == engine"
- "hostvars[broker_name][vars_prefix ~ 'broker_state' ~ vars_suffix] in ('CREATION_IN_PROGRESS', 'RUNNING')"
- "'host_instance_type' not in hostvars[broker_name]"
- "'engine_type' not in hostvars[broker_name]"
- "'broker_state' not in hostvars[broker_name]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
that:
- "'aws_mq' in groups"
- "groups.aws_mq | length == 1"
- "groups.aws_mq.0 == '{{ broker_name }}'"
- groups.aws_mq.0 == broker_name
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
# Not always returned by API
# - "msk_cluster.cluster_info.client_authentication.unauthenticated.enabled == false"
- "msk_cluster.cluster_info.open_monitoring.prometheus.jmx_exporter.enabled_in_broker == false"
- "msk_cluster.cluster_info.cluster_arn.startswith('arn:aws:kafka:{{ aws_region }}:')"
- "msk_cluster.cluster_info.cluster_arn.startswith('arn:aws:kafka:' ~ aws_region ~ ':')"

- name: create a msk cluster with authentication flipped from default (idempotency)
msk_cluster:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
- "msk_cluster.cluster_info.broker_node_group_info.instance_type == 'kafka.t3.small'"
- "msk_cluster.cluster_info.broker_node_group_info.storage_info.ebs_storage_info.volume_size == 10"
- "msk_cluster.cluster_info.open_monitoring.prometheus.jmx_exporter.enabled_in_broker == false"
- "msk_cluster.cluster_info.cluster_arn.startswith('arn:aws:kafka:{{ aws_region }}:')"
- "msk_cluster.cluster_info.cluster_arn.startswith('arn:aws:kafka:' ~ aws_region ~ ':')"

- name: create msk cluster (idempotency)
msk_cluster:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/targets/msk_config/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
assert:
that:
- msk_config.revision == 1
- "msk_config.arn.startswith('arn:aws:kafka:{{ aws_region }}:')"
- "msk_config.arn.startswith('arn:aws:kafka:' ~ aws_region ~ ':')"
- "'auto.create.topics.enable=True' in msk_config.server_properties"
- "'zookeeper.session.timeout.ms=18000' in msk_config.server_properties"

Expand Down
6 changes: 3 additions & 3 deletions tests/integration/targets/sns_topic/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
that:
- sns_topic_info is successful
- "'result' in sns_topic_info"
- sns_topic_info.result["sns_arn"] == "{{ sns_arn }}"
- sns_topic_info.result["sns_arn"] == sns_arn
- "'sns_topic' in sns_topic_info.result"
- "'display_name' in sns_topic_info.result['sns_topic']"
- sns_topic_info.result["sns_topic"]["display_name"] == "My topic name"
Expand All @@ -79,7 +79,7 @@
that:
- sns_topic_info is successful
- "'result' in sns_topic_info"
- sns_topic_info.result["sns_arn"] == "{{ sns_arn }}"
- sns_topic_info.result["sns_arn"] == sns_arn
- "'sns_topic' in sns_topic_info.result"
- "'display_name' in sns_topic_info.result['sns_topic']"
- sns_topic_info.result["sns_topic"]["display_name"] == "My topic name"
Expand Down Expand Up @@ -110,7 +110,7 @@
that:
- sns_fifo_topic.changed
- sns_fifo_topic.sns_topic.topic_type == 'fifo'
- sns_fifo_topic.sns_topic.name == '{{ sns_topic_topic_name }}-fifo'
- sns_fifo_topic.sns_topic.name == sns_topic_topic_name ~ '-fifo'

- name: Run create a FIFO topic again for idempotence test (with .fifo)
sns_topic:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/targets/sqs_queue/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
assert:
that:
- create_result.changed
- create_result.region == "{{ aws_region }}"
- create_result.region == aws_region

always:
- name: Test deleting SQS queue
Expand Down
Loading

0 comments on commit efc5d87

Please sign in to comment.