diff --git a/roles/aws/aws_elb/defaults/main.yml b/roles/aws/aws_elb/defaults/main.yml index ec551d142..565ce301f 100644 --- a/roles/aws/aws_elb/defaults/main.yml +++ b/roles/aws/aws_elb/defaults/main.yml @@ -45,6 +45,12 @@ aws_elb: # - example-server-two targets_port: 80 # Port to forward to on target servers. modify_targets: false # Set to true if this is a standalone ELB, so the list of targets in the target group can be updated. + ## Target Group Stickiness. Disabled by default unless set otherwise. Uncomment if needed: + # stickiness_enabled: true + # stickiness_type: "lb_cookie" # Valid values are lb_cookie, app_cookie or source_ip. + # stickiness_app_cookie_name: "my_app_cookie" + # stickiness_app_cookie_duration: 86400 + # stickiness_lb_cookie_duration: 86400 # ELB settings idle_timeout: 60 ip_address_type: "ipv4" # Can be 'ipv4' or 'dualstack' (the latter includes IPv4 and IPv6 addresses). diff --git a/roles/aws/aws_elb/tasks/target_group.yml b/roles/aws/aws_elb/tasks/target_group.yml index 2aebb2f02..2d652b1a6 100644 --- a/roles/aws/aws_elb/tasks/target_group.yml +++ b/roles/aws/aws_elb/tasks/target_group.yml @@ -30,5 +30,10 @@ health_check_timeout: "{{ target_group.health_check_timeout }}" healthy_threshold_count: "{{ target_group.health_check_healthy_count }}" unhealthy_threshold_count: "{{ target_group.health_check_unhealthy_count }}" + stickiness_enabled: "{{ target_group.stickiness_enabled | default(omit) }}" + stickiness_type: "{{ target_group.stickiness_type | default(omit) }}" + stickiness_app_cookie_name: "{{ target_group.stickiness_app_cookie_name | default(omit) }}" + stickiness_app_cookie_duration: "{{ target_group.stickiness_app_cookie_duration | default(omit) }}" + stickiness_lb_cookie_duration: "{{ target_group.stickiness_lb_cookie_duration | default(omit) }}" modify_targets: "{{ target_group.modify_targets }}" targets: "{{ _targets }}" diff --git a/roles/debian/nginx/tasks/domain.yml b/roles/debian/nginx/tasks/domain.yml index 8566d7ec1..9de761ad1 100644 --- a/roles/debian/nginx/tasks/domain.yml +++ b/roles/debian/nginx/tasks/domain.yml @@ -81,7 +81,8 @@ - _nginx_cloudwatch_dir.stat.isdir is defined and _nginx_cloudwatch_dir.stat.isdir - name: Append AWS Cloudwatch vhost config on Debian 12. - ansible.builtin.command: "/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a append-config -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d/nginx-{{ domain.server_name }}.json" + ansible.builtin.command: "/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a append-config -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d/nginx-{{ domain.server_name }}.json -s" when: - ansible_os_family == 'Debian' - ansible_distribution_major_version | int >= 12 + - _nginx_cloudwatch_dir.stat.isdir is defined and _nginx_cloudwatch_dir.stat.isdir diff --git a/roles/debian/nginx/tasks/main.yml b/roles/debian/nginx/tasks/main.yml index abfe213ec..3deb62c58 100644 --- a/roles/debian/nginx/tasks/main.yml +++ b/roles/debian/nginx/tasks/main.yml @@ -132,6 +132,13 @@ when: - _nginx_cloudwatch_dir.stat.isdir is defined and _nginx_cloudwatch_dir.stat.isdir +- name: Append AWS Cloudwatch default config on Debian 12. + ansible.builtin.command: "/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a append-config -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.d/nginx-main.json -s" + when: + - ansible_os_family == 'Debian' + - ansible_distribution_major_version | int >= 12 + - _nginx_cloudwatch_dir.stat.isdir is defined and _nginx_cloudwatch_dir.stat.isdir + - name: Update nginx mime.types ansible.builtin.template: src: mime.types.j2