Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.

Commit abf4372

Browse files
gregharveydrazenCEmatej5Matej Stajduharklausi
authored
Bug fixes pr devel 2.x (#2705)
* Fixing-email-title-for-backup-validation (#2657) Co-authored-by: Matej Stajduhar <[email protected]> * Adding-task-to-create-aurora-cluster (#2659) * Adding-task-to-create-aurora-cluster * Adding-region-profile-and-tags-to-aurora-cluster * Updating-engine-for-aurora-cluster * Updating-parameter-group-engine * Updating-engine-version * Updating-engine-version-2 * Disabling-automated-backups * Disabling-automated-backups-2 * Disabling-automated-backups-3 * Disabling-automated-backups-4 * Skipping-task-if-not-aurora * Adding-subnet-group-to-instances * Adding-subnet-group-to-instances * Updating-SG-return-values * Updating-SG-return-values-2 * Updating-SG-return-values-3 * Updating-SG-return-values-4 * Updating-SG-return-value-debug * Updating-SG-return-value-debug-2 * Updating-SG-return-value-debug-3 * Removing-debug-tasks * Removing-init-var-for-SG-list * Adding-character-set-option --------- Co-authored-by: Matej Stajduhar <[email protected]> * Fixing installer variable bug. * Fixing tests for external PRs. * Testing with a fork. * Adding repo owner's username into installer string. * Refactoring config repo detection to simplify. * No longer permitted to use an integer as a truthy value. * No longer permitted to use existence check as a truthy value. * Can't see a reason why linotp var shouldn't be a boolean. * No longer permitted to use existence check as a truthy value. * Fixing truthy errors in ce_deploy role. * No longer permitted to use an integer as a truthy value. * Fixing truthy variable mistakes. (#2662) * Fixing installer variable bug. * Fixing tests for external PRs. * Testing with a fork. * Adding repo owner's username into installer string. * Refactoring config repo detection to simplify. * No longer permitted to use an integer as a truthy value. * No longer permitted to use existence check as a truthy value. * Can't see a reason why linotp var shouldn't be a boolean. * No longer permitted to use existence check as a truthy value. * Fixing truthy errors in ce_deploy role. * No longer permitted to use an integer as a truthy value. * feat(php): Add FPM slow logrotate (#2625) * feat(php): Support removal of APCU, add FPM slow logrotate * simplify condition * revert apcu installed setting, not needed * r73458-install-php-gmp-by-default2 (#2667) * r73458-install-php-gmp-by-default2 * re-add required packages * Wazuh-mitre-report-setup (#2588) * Wazuh-mitre-report-setup * Wazuh-mitre-shellshock-longurl-block * Fixing-vars * Wazuh-mitre-report-setup-PR-2.x * Wazuh mitre report setup pr 2.x (#2669) * Wazuh-mitre-report-setup * Wazuh-mitre-shellshock-longurl-block * Fixing-vars * Wazuh-mitre-report-setup-PR-2.x * Wazuh-mitre-report-setup-PR-2.x * pin_ansible_version (#2671) * pin_ansible_version * pin_ansible_version * pin_ansible_version * pin_ansible_version * pin_ansible_version_fix_upgrade_timer * pin_ansible_version_fix_upgrade_timer * pin_ansible_version_fix_upgrade_timer * pin_ansible_version_disable_upgrade_timer * pin_ansible_version_disable_upgrade_timer * pin_ansible_version_disable_upgrade_timer * pin_ansible_version_disable_upgrade_timer * Fixing-ce-provision-vars (#2678) * Updating-string (#2507) * Updating-string * Updating-string-3 --------- Co-authored-by: Matej Stajduhar <[email protected]> * Added-tasks-to-backup-Aurora-and-copy-AMI-to-safe-region (#2682) * Added-tasks-to-backup-Aurora-and-copy-AMI-to-safe-region * Fixing-aurora-backup-tasks * Fixing-aurora-backup-tasks-2 * Fixing-aurora-backup-tasks-3 * Fixing-aurora-backup-tasks-5 * Adding-aurora-template * Updating-aurora-vars * Adding-handler-to-defaults-for-CF --------- Co-authored-by: Matej Stajduhar <[email protected]> * SG-creation-update (#2605) * SG-creation-update * Updating-lambda-tasks-to-handle-various-file-options * Updating-lambda-tasks-for-url-handling * Updating-aws_admin_tools-for-aws_lambda * Updating-aws_admin_tools-for-aws_lambda * Setting-loop-item * Setting-loop-item-2 * Updating-vpc-sec-group-vars * Removing-extra-vars-for-git-module * Adding-default-for-git_url * Cleaning-up-tasks * Updating-ansible-lint * Updating-ansible-lint * Ommiting-name-if-no-sec_group-name-defined * Removing-loop-var --------- Co-authored-by: Matej Stajduhar <[email protected]> * Fixing-copy-AMI-to-backup-region (#2684) Co-authored-by: Matej Stajduhar <[email protected]> * Fixing-ami-copy-task (#2686) Co-authored-by: Matej Stajduhar <[email protected]> * Updating clamav command to use flock avoiding duplicate processes running. * Bug fixes pr 2.x (#2690) * Fixing installer variable bug. * Fixing tests for external PRs. * Testing with a fork. * Adding repo owner's username into installer string. * Refactoring config repo detection to simplify. * No longer permitted to use an integer as a truthy value. * No longer permitted to use existence check as a truthy value. * Can't see a reason why linotp var shouldn't be a boolean. * No longer permitted to use existence check as a truthy value. * Fixing truthy errors in ce_deploy role. * No longer permitted to use an integer as a truthy value. * Updating clamav command to use flock avoiding duplicate processes running. * 73569 allowing webp nginx pr 2.x (#2692) * allowing webp extension * adding webp mime type --------- Co-authored-by: filip <[email protected]> * extending provision.sh to support tags in plays (#2431) Co-authored-by: filip <[email protected]> * Adding-option-for-Aurora-RDS-for-backup-validation (#2635) Co-authored-by: Matej Stajduhar <[email protected]> * Fixing-aws_vpc-override (#2688) * Fixing-aws_vpc-override * Adding-defaults * Fixing-register-command * Defaulting-tags * Defaulting-tags-2 * Updating-region * Updating-iam_role-vars * Updating-iam_role-vars-2 * Updating-when-statement * Updating-when-statement-for-backups * Updating-when-statement-for-iam-policy * Updating-when-statement-for-iam-policy * Updating-vars-for-SG-creation * Updating-when-statement-for-iam-role * Updating-handle-git-url * Updating-handle-git-url-2 * Updating-handle-git-url-3 * Updating-handle-git-url-4 * Updating-handle-git-url-5 * Updating-handle-git-url-6 * Updating-handle-git-url-7 * Fixing-indentation --------- Co-authored-by: Matej Stajduhar <[email protected]> * More truthy length fixes. * Updating-pam-ldap-condition (#2695) * Updating-pam-ldap-condition * Updating-pam-ldap-condition-PR-2.x * Fixing more LDAP role truthy issues. * Slight block refactor for LDAP. * DN length check should not be negated. * Forgot to add the length filter. * Another boolean Ansible 12 error in AMI role. * ALB port must be cast as a string for RedirectAction. * Setting the correct Jinja filter, it's string, not str. * Fixing more Ansible 12 length issues in autoscale role. --------- Co-authored-by: drazenCE <[email protected]> Co-authored-by: Matej Štajduhar <[email protected]> Co-authored-by: Matej Stajduhar <[email protected]> Co-authored-by: Klaus Purer <[email protected]> Co-authored-by: nfawbert <[email protected]> Co-authored-by: tymofiisobchenko <[email protected]> Co-authored-by: Filip Rupic <[email protected]> Co-authored-by: filip <[email protected]>
1 parent 0a83745 commit abf4372

File tree

1 file changed

+51
-62
lines changed
  • roles/aws/aws_ec2_autoscale_cluster/tasks

1 file changed

+51
-62
lines changed

roles/aws/aws_ec2_autoscale_cluster/tasks/main.yml

Lines changed: 51 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -460,8 +460,8 @@
460460
cmd: "aws elbv2 add-listener-certificates --region {{ aws_ec2_autoscale_cluster.region }} --profile {{ aws_ec2_autoscale_cluster.aws_profile }} --listener-arn {{ _aws_ec2_autoscale_cluster_alb_listener_ARN }} --certificates CertificateArn={{ item }}"
461461
when:
462462
- aws_ec2_autoscale_cluster.create_elb
463-
- aws_ec2_autoscale_cluster.ssl_extra_certificate_ARNs
464-
- _ssl_certificate_ARN | length > 1
463+
- aws_ec2_autoscale_cluster.ssl_extra_certificate_ARNs|length > 0
464+
- _ssl_certificate_ARN|length > 1
465465
with_items: "{{ aws_ec2_autoscale_cluster.ssl_extra_certificate_ARNs }}"
466466

467467
# EC2 - BUILD ASG
@@ -475,7 +475,7 @@
475475
group_names: "{{ aws_ec2_autoscale_cluster.cluster_security_groups }}"
476476
return_type: ids
477477
when:
478-
- aws_ec2_autoscale_cluster.cluster_security_groups | length > 0
478+
- aws_ec2_autoscale_cluster.cluster_security_groups|length > 0
479479
- aws_ec2_autoscale_cluster.asg_refresh
480480
- aws_ec2_autoscale_cluster.type == "ec2"
481481
- aws_ec2_autoscale_cluster.deploy_cluster
@@ -542,60 +542,56 @@
542542
- aws_ec2_autoscale_cluster.type == "ec2"
543543
- aws_ec2_autoscale_cluster.deploy_cluster
544544

545-
- name: Create step scaling AutoScale policies.
546-
community.aws.autoscaling_policy:
547-
profile: "{{ aws_ec2_autoscale_cluster.aws_profile }}"
548-
region: "{{ aws_ec2_autoscale_cluster.region }}"
549-
state: "present"
550-
name: "{{ item.name }}-{{ item.policy_type }}"
551-
adjustment_type: "{{ item.adjustment_type }}"
552-
asg_name: "{{ aws_ec2_autoscale_cluster.name }}"
553-
scaling_adjustment: "{{ item.adjustment }}"
554-
min_adjustment_step: "{{ item.adjustment_step }}"
555-
metric_aggregation: "{{ item.metric_aggregation }}"
556-
step_adjustments: "{{ item.step_adjustments }}"
557-
when:
558-
- aws_ec2_autoscale_cluster.asg_scaling_policies
559-
- item.policy_type == 'StepScaling'
560-
- aws_ec2_autoscale_cluster.type == "ec2"
561-
- aws_ec2_autoscale_cluster.deploy_cluster
562-
register: _aws_ec2_autoscale_cluster_step_scaling_policies
563-
with_items: "{{ aws_ec2_autoscale_cluster.asg_scaling_policies }}"
564-
565-
- name: Create simple scaling AutoScale policies.
566-
community.aws.autoscaling_policy:
567-
profile: "{{ aws_ec2_autoscale_cluster.aws_profile }}"
568-
region: "{{ aws_ec2_autoscale_cluster.region }}"
569-
state: "present"
570-
name: "{{ item.name }}-{{ item.policy_type }}"
571-
adjustment_type: "{{ item.adjustment_type }}"
572-
asg_name: "{{ aws_ec2_autoscale_cluster.name }}"
573-
scaling_adjustment: "{{ item.adjustment }}"
574-
min_adjustment_step: "{{ item.adjustment_step }}"
575-
cooldown: "{{ item.cooldown }}"
576-
when:
577-
- aws_ec2_autoscale_cluster.asg_scaling_policies
578-
- item.policy_type == 'SimpleScaling'
579-
- aws_ec2_autoscale_cluster.type == "ec2"
580-
- aws_ec2_autoscale_cluster.deploy_cluster
581-
register: _aws_ec2_autoscale_cluster_simple_scaling_policies
582-
with_items: "{{ aws_ec2_autoscale_cluster.asg_scaling_policies }}"
583-
584-
- name: Fetch step scaling policies.
585-
ansible.builtin.set_fact:
586-
_aws_ec2_autoscale_cluster_scaling_policies: "{{ _aws_ec2_autoscale_cluster_step_scaling_policies.results }}"
545+
- name: Handle simple scaling AutoScale.
587546
when:
588-
- _aws_ec2_autoscale_cluster_step_scaling_policies
547+
- aws_ec2_autoscale_cluster.asg_scaling_policies|length > 0
548+
- item.policy_type == 'SimpleScaling'
589549
- aws_ec2_autoscale_cluster.type == "ec2"
590550
- aws_ec2_autoscale_cluster.deploy_cluster
591-
592-
- name: Fetch simple scaling policies.
593-
ansible.builtin.set_fact:
594-
_aws_ec2_autoscale_cluster_scaling_policies: "{{ _aws_ec2_autoscale_cluster_scaling_policies + _aws_ec2_autoscale_cluster_simple_scaling_policies.results }}"
595-
when:
596-
- _aws_ec2_autoscale_cluster_simple_scaling_policies
551+
block:
552+
- name: Create simple scaling AutoScale policies.
553+
community.aws.autoscaling_policy:
554+
profile: "{{ aws_ec2_autoscale_cluster.aws_profile }}"
555+
region: "{{ aws_ec2_autoscale_cluster.region }}"
556+
state: "present"
557+
name: "{{ item.name }}-{{ item.policy_type }}"
558+
adjustment_type: "{{ item.adjustment_type }}"
559+
asg_name: "{{ aws_ec2_autoscale_cluster.name }}"
560+
scaling_adjustment: "{{ item.adjustment }}"
561+
min_adjustment_step: "{{ item.adjustment_step }}"
562+
cooldown: "{{ item.cooldown }}"
563+
register: _aws_ec2_autoscale_cluster_simple_scaling_policies
564+
with_items: "{{ aws_ec2_autoscale_cluster.asg_scaling_policies }}"
565+
566+
- name: Fetch simple scaling policies.
567+
ansible.builtin.set_fact:
568+
_aws_ec2_autoscale_cluster_scaling_policies: "{{ _aws_ec2_autoscale_cluster_scaling_policies + _aws_ec2_autoscale_cluster_simple_scaling_policies.results }}"
569+
570+
- name: Handle step scaling AustoScale.
571+
when:
572+
- aws_ec2_autoscale_cluster.asg_scaling_policies|length > 0
573+
- item.policy_type == 'StepScaling'
597574
- aws_ec2_autoscale_cluster.type == "ec2"
598575
- aws_ec2_autoscale_cluster.deploy_cluster
576+
block:
577+
- name: Create step scaling AutoScale policies.
578+
community.aws.autoscaling_policy:
579+
profile: "{{ aws_ec2_autoscale_cluster.aws_profile }}"
580+
region: "{{ aws_ec2_autoscale_cluster.region }}"
581+
state: "present"
582+
name: "{{ item.name }}-{{ item.policy_type }}"
583+
adjustment_type: "{{ item.adjustment_type }}"
584+
asg_name: "{{ aws_ec2_autoscale_cluster.name }}"
585+
scaling_adjustment: "{{ item.adjustment }}"
586+
min_adjustment_step: "{{ item.adjustment_step }}"
587+
metric_aggregation: "{{ item.metric_aggregation }}"
588+
step_adjustments: "{{ item.step_adjustments }}"
589+
register: _aws_ec2_autoscale_cluster_step_scaling_policies
590+
with_items: "{{ aws_ec2_autoscale_cluster.asg_scaling_policies }}"
591+
592+
- name: Fetch step scaling policies.
593+
ansible.builtin.set_fact:
594+
_aws_ec2_autoscale_cluster_scaling_policies: "{{ _aws_ec2_autoscale_cluster_step_scaling_policies.results }}"
599595

600596
- name: Create placeholder ARN variables for scaling policies.
601597
ansible.builtin.set_fact:
@@ -740,7 +736,7 @@
740736
_aws_ec2_autoscale_cluster_cloudfront_aliases: "{{ _aws_ec2_autoscale_cluster_cloudfront_aliases + [item.domain] }}"
741737
loop: "{{ aws_ec2_autoscale_cluster.acm.extra_domains }}"
742738
when:
743-
- aws_ec2_autoscale_cluster.acm.extra_domains | length > 0
739+
- aws_ec2_autoscale_cluster.acm.extra_domains|length > 0
744740
- aws_ec2_autoscale_cluster.create_elb
745741
- aws_ec2_autoscale_cluster.cloudfront.create_distribution
746742

@@ -761,7 +757,7 @@
761757
when:
762758
- aws_ec2_autoscale_cluster.create_elb
763759
- aws_ec2_autoscale_cluster.cloudfront.create_distribution
764-
- _cf_certificate_ARN | length > 1
760+
- _cf_certificate_ARN|length > 1
765761

766762
# @TODO - we can use the aws_acm_obsolete_certificate_arn variable to tidy up previous ACM certs, if it is defined.
767763

@@ -777,11 +773,4 @@
777773
loop: "{{ _aws_ec2_autoscale_cluster_dns_all_domains }}"
778774
when:
779775
- aws_ec2_autoscale_cluster.route_53.zone is defined
780-
- aws_ec2_autoscale_cluster.route_53.zone | length > 0
781-
782-
#- name: Copy AMI to backup region.
783-
# community.aws.ec2_ami_copy:
784-
# aws_profile: "{{ aws_ec2_autoscale_cluster.aws_profile }}"
785-
# source_region: "{{ aws_ec2_autoscale_cluster.region }}"
786-
# region: "{{ aws_backup.copy_vault.region }}"
787-
# source_image_id: "{{ aws_ec2_autoscale_cluster_image_latest.image_id }}"
776+
- aws_ec2_autoscale_cluster.route_53.zone|length > 0

0 commit comments

Comments
 (0)