From 6b8eb88d973044276474f7f47fc9d9ce386949fe Mon Sep 17 00:00:00 2001 From: Greg Harvey Date: Thu, 17 Jul 2025 18:44:46 +0200 Subject: [PATCH 01/19] Php unix socket pr 1.x (#724) * Moving cachetool adapter setup to the installer role and adding a test. * Updating cachetool documentation. --- docs/roles/cache_clear/cache_clear-opcache.md | 9 ++----- docs/roles/cli/cachetool.md | 7 ++++++ .../cache_clear/cache_clear-opcache/README.md | 9 ++----- .../cache_clear-opcache/defaults/main.yml | 7 ------ .../cache_clear-opcache/tasks/main.yml | 18 -------------- roles/cli/cachetool/README.md | 7 ++++++ roles/cli/cachetool/defaults/main.yml | 7 ++++++ roles/cli/cachetool/tasks/main.yml | 24 +++++++++++++++++++ 8 files changed, 49 insertions(+), 39 deletions(-) diff --git a/docs/roles/cache_clear/cache_clear-opcache.md b/docs/roles/cache_clear/cache_clear-opcache.md index 267485f4..0dd8cfaf 100644 --- a/docs/roles/cache_clear/cache_clear-opcache.md +++ b/docs/roles/cache_clear/cache_clear-opcache.md @@ -1,6 +1,6 @@ # Opcache -Clear opcache. +Clear opcache. You must have run the `cli/cachetool` role to install `cachetool` first. @@ -10,16 +10,11 @@ Clear opcache. ```yaml --- cache_clear_opcache: - # Adapter string to use as argument. - # eg. - # --fcgi=127.0.0.1:9000 - # Leave blank to use /etc/cachetool.yml - # adapter: "--fcgi=127.0.0.1:9081" # Leave commented to automatically detect the adapter based on PHP version. # Bins to clear. clear_opcache: true clear_apcu: false clear_stat: true - # cachetool_bin: "/path/to/cachetool.phar" # see _init for paths if undefined + # cachetool_bin: "/path/to/cachetool.phar" # see _init for default paths if undefined ``` diff --git a/docs/roles/cli/cachetool.md b/docs/roles/cli/cachetool.md index 36d0a014..d3c5af0b 100644 --- a/docs/roles/cli/cachetool.md +++ b/docs/roles/cli/cachetool.md @@ -6,6 +6,13 @@ Installs the `drush` command-line tool for the deploy user. --- cachetool: version: "" # enter three-digit version number, e.g. "7.0.0", to install a specific version. If not specified, will be installed depending on the php version. + unix_socket: false # Set to true to use automatic detection of Unix socket as set by ce-provision + # Adapter string to use as argument. + # e.g. + # --fcgi=127.0.0.1:9000 + # --fcgi=/var/run/php-fpm.sock + # Provide an empty string to use /etc/cachetool.yml + # adapter: "--fcgi=127.0.0.1:9081" # Leave commented to automatically detect the adapter based on PHP version. ``` diff --git a/roles/cache_clear/cache_clear-opcache/README.md b/roles/cache_clear/cache_clear-opcache/README.md index 267485f4..0dd8cfaf 100644 --- a/roles/cache_clear/cache_clear-opcache/README.md +++ b/roles/cache_clear/cache_clear-opcache/README.md @@ -1,6 +1,6 @@ # Opcache -Clear opcache. +Clear opcache. You must have run the `cli/cachetool` role to install `cachetool` first. @@ -10,16 +10,11 @@ Clear opcache. ```yaml --- cache_clear_opcache: - # Adapter string to use as argument. - # eg. - # --fcgi=127.0.0.1:9000 - # Leave blank to use /etc/cachetool.yml - # adapter: "--fcgi=127.0.0.1:9081" # Leave commented to automatically detect the adapter based on PHP version. # Bins to clear. clear_opcache: true clear_apcu: false clear_stat: true - # cachetool_bin: "/path/to/cachetool.phar" # see _init for paths if undefined + # cachetool_bin: "/path/to/cachetool.phar" # see _init for default paths if undefined ``` diff --git a/roles/cache_clear/cache_clear-opcache/defaults/main.yml b/roles/cache_clear/cache_clear-opcache/defaults/main.yml index bf28c5b0..a9b9e92d 100644 --- a/roles/cache_clear/cache_clear-opcache/defaults/main.yml +++ b/roles/cache_clear/cache_clear-opcache/defaults/main.yml @@ -1,12 +1,5 @@ --- cache_clear_opcache: - # Adapter string to use as argument. - # e.g. - # --fcgi=127.0.0.1:9000 - # --fcgi=/var/run/php-fpm.sock - # Provide an empty string to use /etc/cachetool.yml - # adapter: "--fcgi=127.0.0.1:9081" # Leave commented to automatically detect the adapter based on PHP version. - unix_socket: false # Set to true to use automatic detection of Unix socket as set by ce-provision # Bins to clear. clear_opcache: true clear_apcu: false diff --git a/roles/cache_clear/cache_clear-opcache/tasks/main.yml b/roles/cache_clear/cache_clear-opcache/tasks/main.yml index 56507c4a..ddf9fd07 100644 --- a/roles/cache_clear/cache_clear-opcache/tasks/main.yml +++ b/roles/cache_clear/cache_clear-opcache/tasks/main.yml @@ -1,22 +1,4 @@ --- -- name: Get latest php installed - ansible.builtin.shell: - cmd: 'set -o pipefail && ls -1 /etc/php/ | while read ver; do if [ -d "/etc/php/$ver/fpm" ]; then echo "$ver"; fi; done | tail -1' - args: - executable: /bin/bash - register: _php_version - -- name: Set cachetool adapter specified or default to a TCP/IP port. - ansible.builtin.set_fact: - _cachetool_adapter: "{{ cache_clear_opcache.adapter | default('--fcgi=127.0.0.1:90' + _php_version.stdout | replace('.','')) }}" - -- name: Override cachetool adapter to be a Unix socket if requested. - ansible.builtin.set_fact: - _cachetool_adapter: "--fcgi=/var/run/php{{ _php_version.stdout | replace('.','') }}-fpm.sock" - when: - - cache_clear_opcache.unix_socket - - cache_clear_opcache.adapter is not defined - # cachetool_bin is set in the _init role. - name: Clear opcache. ansible.builtin.command: diff --git a/roles/cli/cachetool/README.md b/roles/cli/cachetool/README.md index 36d0a014..d3c5af0b 100644 --- a/roles/cli/cachetool/README.md +++ b/roles/cli/cachetool/README.md @@ -6,6 +6,13 @@ Installs the `drush` command-line tool for the deploy user. --- cachetool: version: "" # enter three-digit version number, e.g. "7.0.0", to install a specific version. If not specified, will be installed depending on the php version. + unix_socket: false # Set to true to use automatic detection of Unix socket as set by ce-provision + # Adapter string to use as argument. + # e.g. + # --fcgi=127.0.0.1:9000 + # --fcgi=/var/run/php-fpm.sock + # Provide an empty string to use /etc/cachetool.yml + # adapter: "--fcgi=127.0.0.1:9081" # Leave commented to automatically detect the adapter based on PHP version. ``` diff --git a/roles/cli/cachetool/defaults/main.yml b/roles/cli/cachetool/defaults/main.yml index 8b98934d..77c338ce 100644 --- a/roles/cli/cachetool/defaults/main.yml +++ b/roles/cli/cachetool/defaults/main.yml @@ -1,3 +1,10 @@ --- cachetool: version: "" # enter three-digit version number, e.g. "7.0.0", to install a specific version. If not specified, will be installed depending on the php version. + unix_socket: false # Set to true to use automatic detection of Unix socket as set by ce-provision + # Adapter string to use as argument. + # e.g. + # --fcgi=127.0.0.1:9000 + # --fcgi=/var/run/php-fpm.sock + # Provide an empty string to use /etc/cachetool.yml + # adapter: "--fcgi=127.0.0.1:9081" # Leave commented to automatically detect the adapter based on PHP version. diff --git a/roles/cli/cachetool/tasks/main.yml b/roles/cli/cachetool/tasks/main.yml index c9855743..e7035c7c 100644 --- a/roles/cli/cachetool/tasks/main.yml +++ b/roles/cli/cachetool/tasks/main.yml @@ -83,3 +83,27 @@ - deploy_operation == 'deploy' - cachetool.version is defined - cachetool.version | length > 0 + +# Set up cachetool adapter +- name: Get latest PHP version installed. + ansible.builtin.shell: + cmd: 'set -o pipefail && ls -1 /etc/php/ | while read ver; do if [ -d "/etc/php/$ver/fpm" ]; then echo "$ver"; fi; done | tail -1' + args: + executable: /bin/bash + register: _php_version + +- name: Set cachetool adapter specified or default to a TCP/IP port. + ansible.builtin.set_fact: + _cachetool_adapter: "{{ cachetool.adapter | default('--fcgi=127.0.0.1:90' + _php_version.stdout | replace('.','')) }}" + +- name: Override cachetool adapter to be a Unix socket if requested. + ansible.builtin.set_fact: + _cachetool_adapter: "--fcgi=/var/run/php{{ _php_version.stdout | replace('.','') }}-fpm.sock" + when: + - cachetool.unix_socket + - cachetool.adapter is not defined + +# We want to fail early if cachetool is broken. +- name: Ensure cachetool is working. + ansible.builtin.command: + cmd: "{{ cachetool_bin }} {{ _cachetool_adapter }} -n opcache:status" From dc7b24e3a5ec0083cb0f1ff7667941106db5f09a Mon Sep 17 00:00:00 2001 From: Greg Harvey Date: Thu, 17 Jul 2025 19:26:48 +0200 Subject: [PATCH 02/19] Php unix socket pr 1.x (#726) * Moving cachetool adapter setup to the installer role and adding a test. * Updating cachetool documentation. * Making sure _cachetool_adapter is always set. --- roles/_init/tasks/drupal7.yml | 2 +- roles/_init/tasks/drupal8.yml | 6 ++---- roles/cli/cachetool/tasks/main.yml | 25 ++++++++++++------------- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/roles/_init/tasks/drupal7.yml b/roles/_init/tasks/drupal7.yml index 3053c5c4..f6919125 100644 --- a/roles/_init/tasks/drupal7.yml +++ b/roles/_init/tasks/drupal7.yml @@ -11,7 +11,7 @@ import_role: name: cli/drush -- name: Ensure we have a cachetool binary. +- name: Ensure we have a cachetool binary and configuration. ansible.builtin.import_role: name: cli/cachetool when: install_php_cachetool diff --git a/roles/_init/tasks/drupal8.yml b/roles/_init/tasks/drupal8.yml index c254ffd6..afd1217b 100644 --- a/roles/_init/tasks/drupal8.yml +++ b/roles/_init/tasks/drupal8.yml @@ -11,9 +11,7 @@ ansible.builtin.set_fact: drush_live_bin: "{{ drush_live_bin | default('{{ live_symlink_dest }}/vendor/bin/drush') }}" -- name: Ensure we have a cachetool binary. +- name: Ensure we have a cachetool binary and configuration. ansible.builtin.import_role: name: cli/cachetool - when: - - install_php_cachetool - - deploy_operation == 'deploy' + when: install_php_cachetool diff --git a/roles/cli/cachetool/tasks/main.yml b/roles/cli/cachetool/tasks/main.yml index e7035c7c..d3a21cb2 100644 --- a/roles/cli/cachetool/tasks/main.yml +++ b/roles/cli/cachetool/tasks/main.yml @@ -1,17 +1,16 @@ --- -- name: Remove previous cachetool if exists. - ansible.builtin.file: - path: "{{ cachetool_bin }}" - state: absent - when: - - deploy_operation == 'deploy' +- name: Initial housekeeping tasks. + when: deploy_operation == 'deploy' + block: + - name: Remove previous cachetool if exists. + ansible.builtin.file: + path: "{{ cachetool_bin }}" + state: absent -- name: Ensure bin directory exists. - ansible.builtin.file: - path: "{{ cachetool_bin | dirname }}" - state: directory - when: - - deploy_operation == 'deploy' + - name: Ensure bin directory exists. + ansible.builtin.file: + path: "{{ cachetool_bin | dirname }}" + state: directory - name: Download cachetool depending on latest php version installed. # If not specified manually, according to https://github.com/gordalina/cachetool#compatibility when: @@ -84,7 +83,7 @@ - cachetool.version is defined - cachetool.version | length > 0 -# Set up cachetool adapter +# Set up cachetool adapter - needs to happen on every run so _cachetool_adapter is set. - name: Get latest PHP version installed. ansible.builtin.shell: cmd: 'set -o pipefail && ls -1 /etc/php/ | while read ver; do if [ -d "/etc/php/$ver/fpm" ]; then echo "$ver"; fi; done | tail -1' From e705aeec72dd857d242a0941e694ff45aa3dcbcb Mon Sep 17 00:00:00 2001 From: drazenCE <140631110+drazenCE@users.noreply.github.com> Date: Mon, 28 Jul 2025 16:32:05 +0200 Subject: [PATCH 03/19] Optional-drush-cr-before-import (#728) --- .../database_apply/database_apply-drupal8/tasks/main.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/roles/database_apply/database_apply-drupal8/tasks/main.yml b/roles/database_apply/database_apply-drupal8/tasks/main.yml index 1935ac79..7915d95f 100644 --- a/roles/database_apply/database_apply-drupal8/tasks/main.yml +++ b/roles/database_apply/database_apply-drupal8/tasks/main.yml @@ -108,6 +108,15 @@ msg: "{{ _drush_output }}" when: drupal.drush_verbose_output +- name: Clear cache before config import. + ansible.builtin.include_role: + name: "cache_clear/cache_clear-{{ project_type }}" + with_items: "{{ drupal.sites }}" + loop_control: + loop_var: site + when: + - drupal.clear_cache_before_config_import | default(false) + - name: Import configuration. ansible.builtin.command: cmd: "{{ drush_bin }} -l {{ site.folder }} -y {{ site.config_import_command }}" From 2aab8107949683e8066d1fe66edda298cfb1230d Mon Sep 17 00:00:00 2001 From: Filip Rupic <123341158+filiprupic@users.noreply.github.com> Date: Tue, 29 Jul 2025 10:19:43 +0200 Subject: [PATCH 04/19] 73171 fixing cachetool checks fpm pr 1.x (#729) * skipping cachetool check when no fpm * remove empty line --------- Co-authored-by: filip --- roles/cli/cachetool/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/cli/cachetool/tasks/main.yml b/roles/cli/cachetool/tasks/main.yml index d3a21cb2..0c221115 100644 --- a/roles/cli/cachetool/tasks/main.yml +++ b/roles/cli/cachetool/tasks/main.yml @@ -106,3 +106,4 @@ - name: Ensure cachetool is working. ansible.builtin.command: cmd: "{{ cachetool_bin }} {{ _cachetool_adapter }} -n opcache:status" + when: _php_version.stdout | length > 0 From c46831754fe0676dbc7a8439aad7cf89dfd81d1c Mon Sep 17 00:00:00 2001 From: tymofiisobchenko <104431720+tymofiisobchenko@users.noreply.github.com> Date: Fri, 22 Aug 2025 19:03:42 +0300 Subject: [PATCH 05/19] asg_management_fix_and_improve (#733) * asg_management_fix_and_improve * asg_management_fix_and_improve * asg_management_fix_and_improve * asg_management_fix_and_improve * asg_management_fix_and_improve --- roles/asg_management/defaults/main.yml | 2 + roles/asg_management/tasks/main.yml | 2 +- roles/deploy_code/tasks/cleanup.yml | 212 ++++++++++++++++--------- 3 files changed, 136 insertions(+), 80 deletions(-) diff --git a/roles/asg_management/defaults/main.yml b/roles/asg_management/defaults/main.yml index 67371acd..ab54916e 100644 --- a/roles/asg_management/defaults/main.yml +++ b/roles/asg_management/defaults/main.yml @@ -2,6 +2,8 @@ # AWS ASG variables to allow for the suspension of autoscaling during a code deployment. asg_management: name: "" # if the deploy is on an ASG put the name here + #target_group_name: "example" # matches the ASG name by default, specify if your TargetGroup name is different (for example due to the 32-char name length limit in AWS) + refresh_asg_instances: true # runs only if squashFS image unmount failed and this set to true. #profile: "example" # optional, the boto profile name to use if not the system default region: "eu-west-1" suspend_processes: "Launch Terminate HealthCheck" # space separated string, see https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html diff --git a/roles/asg_management/tasks/main.yml b/roles/asg_management/tasks/main.yml index 03ee8b44..885eb564 100644 --- a/roles/asg_management/tasks/main.yml +++ b/roles/asg_management/tasks/main.yml @@ -11,7 +11,7 @@ region: "{{ asg_management.region }}" profile: "{{ asg_management.profile | default(omit) }}" names: - - "{{ asg_management.name }}" + - "{{ asg_management.target_group_name | default(asg_management.name) }}" register: _target_group - name: Loop over target instances until they are all 'healthy'. diff --git a/roles/deploy_code/tasks/cleanup.yml b/roles/deploy_code/tasks/cleanup.yml index 796854e6..9db5403f 100644 --- a/roles/deploy_code/tasks/cleanup.yml +++ b/roles/deploy_code/tasks/cleanup.yml @@ -150,93 +150,147 @@ failed_when: false register: _deploy_code_mount_check - - name: Get the current pts session. - ansible.builtin.shell: - cmd: "tty | sed 's#/dev/##'" - register: deploy_pts - - - name: "Check for active sessions in {{ deploy_base_path }}." - ansible.builtin.shell: - cmd: "ps -eo pid,tty | awk '{print $1}' | xargs -n 1 pwdx 2>&1 | grep -v 'No such process' | grep {{ deploy_base_path }} | cut -d: -f1 | xargs -n 1 ps -o tty= -p | sort | uniq" - register: sessions_in_deploy_path - become: true - - - name: Display active sessions. - ansible.builtin.debug: - msg: > - Deploy session: {{ deploy_pts.stdout | default('Unknown') }}. - Active sessions in {{ deploy_base_path }}: {{ sessions_in_deploy_path.stdout_lines | default([]) | join(', ') | default('None') }}. - - - name: Kill sessions except the current one. + - name: Mount SquashFS image if there is no mounted one. ansible.builtin.command: - cmd: "pkill -9 -t {{ item }}" - loop: "{{ sessions_in_deploy_path.stdout_lines }}" - when: - - "item != deploy_pts.stdout" - - "item is match('^pts/\\d+$')" - failed_when: false - register: kill_sessions_result - become: true - - - name: Display killed sessions. - ansible.builtin.debug: - msg: > - Sessions terminated: {{ kill_sessions_result.results | selectattr('rc', 'defined') | selectattr('rc', 'equalto', 0) | map(attribute='item') | list | join(', ') | default('None') }}. - - - name: Reload any services that might be keeping the loop device busy. - ansible.builtin.service: - name: "{{ www_service }}" - state: reloaded - with_items: "{{ deploy_code.services }}" - loop_control: - loop_var: www_service - become: true - when: - - _deploy_code_mount_check.rc == 0 - - deploy_code.service_action == "reload" - - deploy_code.services | length > 0 - - - name: Stop any services that might be keeping the loop device busy. - ansible.builtin.service: - name: "{{ www_service }}" - state: stopped - with_items: "{{ deploy_code.services }}" - loop_control: - loop_var: www_service + cmd: "mount {{ build_base_path }}/deploy.sqsh {{ deploy_base_path }} -t squashfs -o loop" become: true when: - - _deploy_code_mount_check.rc == 0 - - deploy_code.service_action == "stop" - - deploy_code.services | length > 0 + - _deploy_code_mount_check.rc != 0 - - name: Unmount existing SquashFS image. - ansible.builtin.command: - cmd: "umount {{ deploy_base_path }}" - become: true + - name: Mount new SquashFS image instead of the already mounted. when: - _deploy_code_mount_check.rc == 0 - register: task_result - retries: "{{ deploy_code.unmount_retries }}" - delay: "{{ deploy_code.unmount_delay }}" - until: task_result.rc == 0 + block: + - name: Get the current pts session. + ansible.builtin.shell: + cmd: "tty | sed 's#/dev/##'" + register: deploy_pts - - name: Mount new SquashFS image. - ansible.builtin.command: - cmd: "mount {{ build_base_path }}/deploy.sqsh {{ deploy_base_path }} -t squashfs -o loop" - become: true + - name: "Check for active sessions in {{ deploy_base_path }}." + ansible.builtin.shell: + cmd: "ps -eo pid,tty | awk '{print $1}' | xargs -n 1 pwdx 2>&1 | grep -v 'No such process' | grep {{ deploy_base_path }} | cut -d: -f1 | xargs -n 1 ps -o tty= -p | sort | uniq" + register: sessions_in_deploy_path + become: true - - name: Start any services we stopped. - ansible.builtin.service: - name: "{{ www_service }}" - state: started - with_items: "{{ deploy_code.services }}" - loop_control: - loop_var: www_service - become: true - when: - - _deploy_code_mount_check.rc == 0 - - deploy_code.service_action == "stop" - - deploy_code.services | length > 0 + - name: Display active sessions. + ansible.builtin.debug: + msg: > + Deploy session: {{ deploy_pts.stdout | default('Unknown') }}. + Active sessions in {{ deploy_base_path }}: {{ sessions_in_deploy_path.stdout_lines | default([]) | join(', ') | default('None') }}. + + - name: Kill sessions except the current one. + ansible.builtin.command: + cmd: "pkill -9 -t {{ item }}" + loop: "{{ sessions_in_deploy_path.stdout_lines }}" + when: + - "item != deploy_pts.stdout" + - "item is match('^pts/\\d+$')" + failed_when: false + register: kill_sessions_result + become: true + + - name: Display killed sessions. + ansible.builtin.debug: + msg: > + Sessions terminated: {{ kill_sessions_result.results | selectattr('rc', 'defined') | selectattr('rc', 'equalto', 0) | map(attribute='item') | list | join(', ') | default('None') }}. + + - name: Reload any services that might be keeping the loop device busy. + ansible.builtin.service: + name: "{{ www_service }}" + state: reloaded + with_items: "{{ deploy_code.services }}" + loop_control: + loop_var: www_service + become: true + when: + - deploy_code.service_action == "reload" + - deploy_code.services | length > 0 + + - name: Stop any services that might be keeping the loop device busy. + ansible.builtin.service: + name: "{{ www_service }}" + state: stopped + with_items: "{{ deploy_code.services }}" + loop_control: + loop_var: www_service + become: true + when: + - deploy_code.service_action == "stop" + - deploy_code.services | length > 0 + + - name: Unmount existing SquashFS image. + ansible.builtin.command: + cmd: "umount {{ deploy_base_path }}" + become: true + register: task_result + retries: "{{ deploy_code.unmount_retries }}" + delay: "{{ deploy_code.unmount_delay }}" + until: task_result.rc == 0 + failed_when: false + + - name: If current image unmount succeeded. + when: task_result.rc == 0 + block: + - name: Mount new SquashFS image. + ansible.builtin.command: + cmd: "mount {{ build_base_path }}/deploy.sqsh {{ deploy_base_path }} -t squashfs -o loop" + become: true + + - name: Start any services that we stopped if the image re-mounting was successful. + ansible.builtin.service: + name: "{{ www_service }}" + state: started + with_items: "{{ deploy_code.services }}" + loop_control: + loop_var: www_service + become: true + when: + - deploy_code.service_action == "stop" + - deploy_code.services | length > 0 + + - name: If current image unmount failed. + when: task_result.rc != 0 + block: + - name: Resume all autoscale processes on ASG. + amazon.aws.autoscaling_group: + name: "{{ asg_management.name }}" + region: "{{ asg_management.region }}" + profile: "{{ asg_management.profile | default(omit) }}" + suspended_processes: [] + delegate_to: localhost + run_once: true + when: + - asg_management.name | length > 0 + + - name: Run ASG instance refresh. + amazon.aws.autoscaling_instance_refresh: + name: "{{ asg_management.name }}" + region: "{{ asg_management.region }}" + profile: "{{ asg_management.profile | default(omit) }}" + strategy: Rolling + preferences: + min_healthy_percentage: 51 + instance_warmup: 100 + skip_matching: false + state: started + delegate_to: localhost + run_once: true + when: + - asg_management.name | length > 0 + - asg_management.refresh_asg_instances + + - name: Start any services we stopped if the image re-mounting failed and ASG management is disabled. + ansible.builtin.service: + name: "{{ www_service }}" + state: started + with_items: "{{ deploy_code.services }}" + loop_control: + loop_var: www_service + become: true + when: + - deploy_code.service_action == "stop" + - deploy_code.services | length > 0 + - not asg_management.refresh_asg_instances or (asg_management.name | length) == 0 # End of the squashFS block. - name: Trigger an infrastructure rebuild. From 3b852e7be280274009df8822ef91dd6f1171b557 Mon Sep 17 00:00:00 2001 From: drazenCE <140631110+drazenCE@users.noreply.github.com> Date: Thu, 28 Aug 2025 14:37:32 +0200 Subject: [PATCH 06/19] Adding-delay-opcache-status-check (#737) * Adding-delay-opcache-status-check * Removing-failed-when --- roles/cli/cachetool/defaults/main.yml | 2 ++ roles/cli/cachetool/tasks/main.yml | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/roles/cli/cachetool/defaults/main.yml b/roles/cli/cachetool/defaults/main.yml index 77c338ce..5c4ccbc0 100644 --- a/roles/cli/cachetool/defaults/main.yml +++ b/roles/cli/cachetool/defaults/main.yml @@ -2,6 +2,8 @@ cachetool: version: "" # enter three-digit version number, e.g. "7.0.0", to install a specific version. If not specified, will be installed depending on the php version. unix_socket: false # Set to true to use automatic detection of Unix socket as set by ce-provision + check_retries: 5 + check_delay: 20 # Adapter string to use as argument. # e.g. # --fcgi=127.0.0.1:9000 diff --git a/roles/cli/cachetool/tasks/main.yml b/roles/cli/cachetool/tasks/main.yml index 0c221115..f765da90 100644 --- a/roles/cli/cachetool/tasks/main.yml +++ b/roles/cli/cachetool/tasks/main.yml @@ -107,3 +107,7 @@ ansible.builtin.command: cmd: "{{ cachetool_bin }} {{ _cachetool_adapter }} -n opcache:status" when: _php_version.stdout | length > 0 + register: opcache_status_check + retries: "{{ cachetool.check_retries }}" + delay: "{{ cachetool.check_delay }}" + until: opcache_status_check.rc == 0 From 34c76c0eb677d4a54dac5c87a8dd30aba65be121 Mon Sep 17 00:00:00 2001 From: tymofiisobchenko <104431720+tymofiisobchenko@users.noreply.github.com> Date: Mon, 1 Sep 2025 18:56:47 +0300 Subject: [PATCH 07/19] fix_var_name_for_asg_management (#739) --- roles/deploy_code/tasks/cleanup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/deploy_code/tasks/cleanup.yml b/roles/deploy_code/tasks/cleanup.yml index 9db5403f..b365a876 100644 --- a/roles/deploy_code/tasks/cleanup.yml +++ b/roles/deploy_code/tasks/cleanup.yml @@ -256,7 +256,7 @@ name: "{{ asg_management.name }}" region: "{{ asg_management.region }}" profile: "{{ asg_management.profile | default(omit) }}" - suspended_processes: [] + suspend_processes: [] delegate_to: localhost run_once: true when: From 357a44803c6c92dc7c7c997af1df4e2e0517029e Mon Sep 17 00:00:00 2001 From: Drazen Date: Thu, 4 Sep 2025 08:42:08 +0200 Subject: [PATCH 08/19] Fixing-cron-syntax --- roles/cron/cron_drupal7/defaults/main.yml | 12 ++++++++++++ roles/cron/cron_drupal7/tasks/job.yml | 2 +- roles/cron/cron_drupal8/defaults/main.yml | 19 ++++++++++++++++--- roles/cron/cron_drupal8/tasks/job.yml | 2 +- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/roles/cron/cron_drupal7/defaults/main.yml b/roles/cron/cron_drupal7/defaults/main.yml index 636557ca..27e8caeb 100644 --- a/roles/cron/cron_drupal7/defaults/main.yml +++ b/roles/cron/cron_drupal7/defaults/main.yml @@ -19,3 +19,15 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" + cron_error_filter: > + > /tmp/cron_output.txt 2>&1; rc=$?; + if [ $rc -ne 0 ]; then + mail -s "Cron Error - $(hostname)" sysadm@codeenigma.com < /tmp/cron_output.txt; + elif grep -iE "(error|fail|fatal|critical|exception)" /tmp/cron_output.txt | grep -v -E '("rc": -13|MODULE FAILURE)' | grep -q .; then + mail -s "Cron Error - $(hostname)" sysadm@codeenigma.com < /tmp/cron_output.txt; + fi + cron_error_email: >- + {% if entry.cron_error_mailto is defined %} + echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }} + {% endif %} + python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" diff --git a/roles/cron/cron_drupal7/tasks/job.yml b/roles/cron/cron_drupal7/tasks/job.yml index 18722640..2c442876 100644 --- a/roles/cron/cron_drupal7/tasks/job.yml +++ b/roles/cron/cron_drupal7/tasks/job.yml @@ -1,7 +1,7 @@ --- - name: Define cron job command. ansible.builtin.set_fact: - _cron_job_command: "cd {{ live_symlink_dest }}/{{ webroot }}/sites/{{ site.folder }} && {{ drupal.drush_location }} {{ entry.job }}" + _cron_job_command: "cd {{ _ce_deploy_base_dir }} && {{ _ce_deploy_ansible_location }} {{ drupal.defer_target }} {{ drupal.python_interpreter }} -m shell -a '{{ _cron_job_command }} {{ drupal.cron_error_filter }} {{ drupal.cron_error_email | default('') }}'" - name: Define cron job command if deferred (ASG). ansible.builtin.set_fact: diff --git a/roles/cron/cron_drupal8/defaults/main.yml b/roles/cron/cron_drupal8/defaults/main.yml index c49ed529..84324f60 100644 --- a/roles/cron/cron_drupal8/defaults/main.yml +++ b/roles/cron/cron_drupal8/defaults/main.yml @@ -12,12 +12,25 @@ drupal: # month: job: cron # disabled: true - # mailto: "{{ drupal.cron_mailto | default('') }}" # Each cron can have it's own mailto and can be configured to use different e-mail addresses. - # file: "/etc/cron.d/{{ project_name }}_{{ build_type }}_job_name" # edit job_name and uncomment to create a file for cron - note, deploy user needs to be able to write to the location - # file_user: "{{ deploy_user }}" # if you drop a file you must also supply an owner, usually the deploy user - make sure the deploy user has perms! + # mailto: "{{ drupal.cron_mailto | default('') }}" + # file: "/etc/cron.d/{{ project_name }}_{{ build_type }}_job_name" + # file_user: "{{ deploy_user }}" + cron_mailto: "" # If the sites are being deployed to an ASG, setting defer to true will create the crontab entry on the deploy server rather than all of the app servers. defer: false # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" + cron_error_filter: > + > /tmp/cron_output.txt 2>&1; rc=$?; + if [ $rc -ne 0 ]; then + mail -s "Cron Error - $(hostname)" sysadm@codeenigma.com < /tmp/cron_output.txt; + elif grep -iE "(error|fail|fatal|critical|exception)" /tmp/cron_output.txt | grep -v -E '("rc": -13|MODULE FAILURE)' | grep -q .; then + mail -s "Cron Error - $(hostname)" sysadm@codeenigma.com < /tmp/cron_output.txt; + fi + cron_error_email: >- + {% if entry.cron_error_mailto is defined %} + echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }} + {% endif %} + python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" diff --git a/roles/cron/cron_drupal8/tasks/job.yml b/roles/cron/cron_drupal8/tasks/job.yml index 9c039fdc..386065c7 100644 --- a/roles/cron/cron_drupal8/tasks/job.yml +++ b/roles/cron/cron_drupal8/tasks/job.yml @@ -5,7 +5,7 @@ - name: Define cron job command if deferred (ASG). ansible.builtin.set_fact: - _cron_job_command: "cd {{ _ce_deploy_base_dir }} && {{ _ce_deploy_ansible_location }} {{ drupal.defer_target }} -m shell -a \"{{ _cron_job_command }}\" > /dev/null" + _cron_job_command: "cd {{ _ce_deploy_base_dir }} && {{ _ce_deploy_ansible_location }} {{ drupal.defer_target }} {{ drupal.python_interpreter }} -m shell -a '{{ _cron_job_command }} {{ drupal.cron_error_filter }} {{ drupal.cron_error_email | default('') }}'" when: - drupal.defer is defined - drupal.defer From 1c4ee8cad3de3dc349d7da87fa47ed9ca2cc0c42 Mon Sep 17 00:00:00 2001 From: Drazen Date: Thu, 4 Sep 2025 09:53:15 +0200 Subject: [PATCH 09/19] Fixing-cron-syntax-PR-devel-1.x --- roles/cron/cron_drupal7/defaults/main.yml | 13 ++----------- roles/cron/cron_drupal7/tasks/job.yml | 4 ++-- roles/cron/cron_drupal8/defaults/main.yml | 13 ++----------- 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/roles/cron/cron_drupal7/defaults/main.yml b/roles/cron/cron_drupal7/defaults/main.yml index 27e8caeb..e066b6e7 100644 --- a/roles/cron/cron_drupal7/defaults/main.yml +++ b/roles/cron/cron_drupal7/defaults/main.yml @@ -19,15 +19,6 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: > - > /tmp/cron_output.txt 2>&1; rc=$?; - if [ $rc -ne 0 ]; then - mail -s "Cron Error - $(hostname)" sysadm@codeenigma.com < /tmp/cron_output.txt; - elif grep -iE "(error|fail|fatal|critical|exception)" /tmp/cron_output.txt | grep -v -E '("rc": -13|MODULE FAILURE)' | grep -q .; then - mail -s "Cron Error - $(hostname)" sysadm@codeenigma.com < /tmp/cron_output.txt; - fi - cron_error_email: >- - {% if entry.cron_error_mailto is defined %} - echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }} - {% endif %} + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ $rc -ne 0 ]; then mail -s \"Cron Error - $(hostname)\" sysadm@codeenigma.com < /tmp/cron_output.txt; elif grep -iE \"(error|fail|fatal|critical|exception)\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then mail -s \"Cron Error - $(hostname)\" sysadm@codeenigma.com < /tmp/cron_output.txt; fi" + cron_error_email: "{% if entry.cron_error_mailto is defined %}; if [ $rc -ne 0 ] || grep -iE \"(error|fail|fatal|critical|exception)\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }}; fi{% endif %}" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" diff --git a/roles/cron/cron_drupal7/tasks/job.yml b/roles/cron/cron_drupal7/tasks/job.yml index 3cfddf71..a944d864 100644 --- a/roles/cron/cron_drupal7/tasks/job.yml +++ b/roles/cron/cron_drupal7/tasks/job.yml @@ -1,11 +1,11 @@ --- - name: Define cron job command. ansible.builtin.set_fact: - _cron_job_command: "cd {{ _ce_deploy_base_dir }} && {{ _ce_deploy_ansible_location }} {{ drupal.defer_target }} {{ drupal.python_interpreter }} -m shell -a '{{ _cron_job_command }} {{ drupal.cron_error_filter }} {{ drupal.cron_error_email | default('') }}'" + _cron_job_command: "cd {{ live_symlink_dest }}/{{ webroot }}/sites/{{ site.folder }} && {{ drupal.drush_location }} {{ entry.job }}" - name: Define cron job command if deferred (ASG). ansible.builtin.set_fact: - _cron_job_command: "cd {{ _ce_deploy_base_dir }} && {{ _ce_deploy_ansible_location }} {{ drupal.defer_target }} {{ drupal.python_interpreter }} -m shell -a '{{ _cron_job_command }} {{ drupal.cron_error_filter }} {{ drupal.cron_error_email | default('') }}'" + _cron_job_command: "cd {{ _ce_deploy_base_dir }} && {{ _ce_deploy_ansible_location }} {{ drupal.defer_target }} {{ drupal.python_interpreter }} -m shell -a '{{ _cron_job_command }} {{ drupal.cron_error_filter }} {{ drupal.cron_error_email | default('') }}'" when: - drupal.defer is defined - drupal.defer diff --git a/roles/cron/cron_drupal8/defaults/main.yml b/roles/cron/cron_drupal8/defaults/main.yml index 84324f60..e74a6ca2 100644 --- a/roles/cron/cron_drupal8/defaults/main.yml +++ b/roles/cron/cron_drupal8/defaults/main.yml @@ -22,15 +22,6 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: > - > /tmp/cron_output.txt 2>&1; rc=$?; - if [ $rc -ne 0 ]; then - mail -s "Cron Error - $(hostname)" sysadm@codeenigma.com < /tmp/cron_output.txt; - elif grep -iE "(error|fail|fatal|critical|exception)" /tmp/cron_output.txt | grep -v -E '("rc": -13|MODULE FAILURE)' | grep -q .; then - mail -s "Cron Error - $(hostname)" sysadm@codeenigma.com < /tmp/cron_output.txt; - fi - cron_error_email: >- - {% if entry.cron_error_mailto is defined %} - echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }} - {% endif %} + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ $rc -ne 0 ]; then mail -s \"Cron Error - $(hostname)\" sysadm@codeenigma.com < /tmp/cron_output.txt; elif grep -iE \"(error|fail|fatal|critical|exception)\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then mail -s \"Cron Error - $(hostname)\" sysadm@codeenigma.com < /tmp/cron_output.txt; fi" + cron_error_email: "{% if entry.cron_error_mailto is defined %}; if [ $rc -ne 0 ] || grep -iE \"(error|fail|fatal|critical|exception)\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }}; fi{% endif %}" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" From 214480c380d3550c0c52fa4e7a43a5eda8ffa789 Mon Sep 17 00:00:00 2001 From: Drazen Date: Thu, 4 Sep 2025 10:40:18 +0200 Subject: [PATCH 10/19] Fixing-cron-syntax-PR-devel-1.x --- roles/cron/cron_drupal7/defaults/main.yml | 4 ++-- roles/cron/cron_drupal8/defaults/main.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/cron/cron_drupal7/defaults/main.yml b/roles/cron/cron_drupal7/defaults/main.yml index e066b6e7..8a2e7ea7 100644 --- a/roles/cron/cron_drupal7/defaults/main.yml +++ b/roles/cron/cron_drupal7/defaults/main.yml @@ -19,6 +19,6 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ $rc -ne 0 ]; then mail -s \"Cron Error - $(hostname)\" sysadm@codeenigma.com < /tmp/cron_output.txt; elif grep -iE \"(error|fail|fatal|critical|exception)\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then mail -s \"Cron Error - $(hostname)\" sysadm@codeenigma.com < /tmp/cron_output.txt; fi" - cron_error_email: "{% if entry.cron_error_mailto is defined %}; if [ $rc -ne 0 ] || grep -iE \"(error|fail|fatal|critical|exception)\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }}; fi{% endif %}" + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ $rc -ne 0 ]; then mail -s \"Cron Error - $(hostname)\" sysadm@codeenigma.com < /tmp/cron_output.txt; elif grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then mail -s \"Cron Error - $(hostname)\" sysadm@codeenigma.com < /tmp/cron_output.txt; fi" + cron_error_email: "{% if entry.cron_error_mailto is defined %}if [ $rc -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }}; fi{% endif %}" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" diff --git a/roles/cron/cron_drupal8/defaults/main.yml b/roles/cron/cron_drupal8/defaults/main.yml index e74a6ca2..1d1dd61b 100644 --- a/roles/cron/cron_drupal8/defaults/main.yml +++ b/roles/cron/cron_drupal8/defaults/main.yml @@ -22,6 +22,6 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ $rc -ne 0 ]; then mail -s \"Cron Error - $(hostname)\" sysadm@codeenigma.com < /tmp/cron_output.txt; elif grep -iE \"(error|fail|fatal|critical|exception)\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then mail -s \"Cron Error - $(hostname)\" sysadm@codeenigma.com < /tmp/cron_output.txt; fi" - cron_error_email: "{% if entry.cron_error_mailto is defined %}; if [ $rc -ne 0 ] || grep -iE \"(error|fail|fatal|critical|exception)\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }}; fi{% endif %}" + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ $rc -ne 0 ]; then mail -s \"Cron Error - $(hostname)\" sysadm@codeenigma.com < /tmp/cron_output.txt; elif grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then mail -s \"Cron Error - $(hostname)\" sysadm@codeenigma.com < /tmp/cron_output.txt; fi" + cron_error_email: "{% if entry.cron_error_mailto is defined %}if [ $rc -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }}; fi{% endif %}" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" From b2f6c961484eb06cb7eb3312e3b2cf567c0da90a Mon Sep 17 00:00:00 2001 From: Drazen Date: Thu, 4 Sep 2025 11:31:33 +0200 Subject: [PATCH 11/19] Another-cron-test --- roles/cron/cron_drupal7/defaults/main.yml | 5 +++-- roles/cron/cron_drupal8/defaults/main.yml | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/roles/cron/cron_drupal7/defaults/main.yml b/roles/cron/cron_drupal7/defaults/main.yml index 8a2e7ea7..73c22b1c 100644 --- a/roles/cron/cron_drupal7/defaults/main.yml +++ b/roles/cron/cron_drupal7/defaults/main.yml @@ -19,6 +19,7 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ $rc -ne 0 ]; then mail -s \"Cron Error - $(hostname)\" sysadm@codeenigma.com < /tmp/cron_output.txt; elif grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then mail -s \"Cron Error - $(hostname)\" sysadm@codeenigma.com < /tmp/cron_output.txt; fi" - cron_error_email: "{% if entry.cron_error_mailto is defined %}if [ $rc -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }}; fi{% endif %}" + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=\\$?; if [ \\$rc -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\"rc\\\": -13|MODULE FAILURE)\" | grep -q .; then mail -s \\\"Cron Error - \\$(hostname)\\\" {{ entry.cron_error_mailto }} < /tmp/cron_output.txt; fi" + cron_error_email: "{% if entry.cron_error_mailto is defined %}if [ \\$rc -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\"rc\\\": -13|MODULE FAILURE)\" | grep -q .; then echo \\\"Command failed\\\" | mail -s \\\"Cron Error - {{ inventory_hostname }}\\\" {{ entry.cron_error_mailto }}; fi{% endif %}" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" + diff --git a/roles/cron/cron_drupal8/defaults/main.yml b/roles/cron/cron_drupal8/defaults/main.yml index 1d1dd61b..9cde63e7 100644 --- a/roles/cron/cron_drupal8/defaults/main.yml +++ b/roles/cron/cron_drupal8/defaults/main.yml @@ -22,6 +22,6 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ $rc -ne 0 ]; then mail -s \"Cron Error - $(hostname)\" sysadm@codeenigma.com < /tmp/cron_output.txt; elif grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then mail -s \"Cron Error - $(hostname)\" sysadm@codeenigma.com < /tmp/cron_output.txt; fi" - cron_error_email: "{% if entry.cron_error_mailto is defined %}if [ $rc -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then echo 'Command failed' | mail -s 'Cron Error - {{ inventory_hostname }}' {{ entry.cron_error_mailto }}; fi{% endif %}" + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=\\$?; if [ \\$rc -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\"rc\\\": -13|MODULE FAILURE)\" | grep -q .; then mail -s \\\"Cron Error - \\$(hostname)\\\" {{ entry.cron_error_mailto }} < /tmp/cron_output.txt; fi" + cron_error_email: "{% if entry.cron_error_mailto is defined %}if [ \\$rc -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\"rc\\\": -13|MODULE FAILURE)\" | grep -q .; then echo \\\"Command failed\\\" | mail -s \\\"Cron Error - {{ inventory_hostname }}\\\" {{ entry.cron_error_mailto }}; fi{% endif %}" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" From eb2efa77a9eb78cdb742a8ad4b466c875aea8152 Mon Sep 17 00:00:00 2001 From: Drazen Date: Thu, 4 Sep 2025 11:59:15 +0200 Subject: [PATCH 12/19] Fixing-cron-syntax-PR-devel-1.x --- roles/cron/cron_drupal7/defaults/main.yml | 4 ++-- roles/cron/cron_drupal8/defaults/main.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/cron/cron_drupal7/defaults/main.yml b/roles/cron/cron_drupal7/defaults/main.yml index 73c22b1c..8c6e5577 100644 --- a/roles/cron/cron_drupal7/defaults/main.yml +++ b/roles/cron/cron_drupal7/defaults/main.yml @@ -19,7 +19,7 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=\\$?; if [ \\$rc -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\"rc\\\": -13|MODULE FAILURE)\" | grep -q .; then mail -s \\\"Cron Error - \\$(hostname)\\\" {{ entry.cron_error_mailto }} < /tmp/cron_output.txt; fi" - cron_error_email: "{% if entry.cron_error_mailto is defined %}if [ \\$rc -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\"rc\\\": -13|MODULE FAILURE)\" | grep -q .; then echo \\\"Command failed\\\" | mail -s \\\"Cron Error - {{ inventory_hostname }}\\\" {{ entry.cron_error_mailto }}; fi{% endif %}" + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=\\$?; if [ \\$rc -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\"rc\\\": -13|MODULE FAILURE)\" | grep -q .; then [ -n \\\"{{ entry.cron_error_mailto }}\\\" ] && mail -s \\\"Cron Error - \\$(hostname)\\\" {{ entry.cron_error_mailto }} < /tmp/cron_output.txt; fi" + cron_error_email: "" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" diff --git a/roles/cron/cron_drupal8/defaults/main.yml b/roles/cron/cron_drupal8/defaults/main.yml index 9cde63e7..a8ce5b9f 100644 --- a/roles/cron/cron_drupal8/defaults/main.yml +++ b/roles/cron/cron_drupal8/defaults/main.yml @@ -22,6 +22,6 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=\\$?; if [ \\$rc -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\"rc\\\": -13|MODULE FAILURE)\" | grep -q .; then mail -s \\\"Cron Error - \\$(hostname)\\\" {{ entry.cron_error_mailto }} < /tmp/cron_output.txt; fi" - cron_error_email: "{% if entry.cron_error_mailto is defined %}if [ \\$rc -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\"rc\\\": -13|MODULE FAILURE)\" | grep -q .; then echo \\\"Command failed\\\" | mail -s \\\"Cron Error - {{ inventory_hostname }}\\\" {{ entry.cron_error_mailto }}; fi{% endif %}" + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=\\$?; if [ \\$rc -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\"rc\\\": -13|MODULE FAILURE)\" | grep -q .; then [ -n \\\"{{ entry.cron_error_mailto }}\\\" ] && mail -s \\\"Cron Error - \\$(hostname)\\\" {{ entry.cron_error_mailto }} < /tmp/cron_output.txt; fi" + cron_error_email: "" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" From a9762392e9e3e3f08b4981b3a6cb4d899a2c0070 Mon Sep 17 00:00:00 2001 From: Drazen Date: Fri, 5 Sep 2025 05:02:37 +0200 Subject: [PATCH 13/19] Fixing-cron-syntax-PR-devel-1.x --- roles/cron/cron_drupal7/defaults/main.yml | 4 ++-- roles/cron/cron_drupal8/defaults/main.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/cron/cron_drupal7/defaults/main.yml b/roles/cron/cron_drupal7/defaults/main.yml index 8c6e5577..2ba25354 100644 --- a/roles/cron/cron_drupal7/defaults/main.yml +++ b/roles/cron/cron_drupal7/defaults/main.yml @@ -19,7 +19,7 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=\\$?; if [ \\$rc -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\"rc\\\": -13|MODULE FAILURE)\" | grep -q .; then [ -n \\\"{{ entry.cron_error_mailto }}\\\" ] && mail -s \\\"Cron Error - \\$(hostname)\\\" {{ entry.cron_error_mailto }} < /tmp/cron_output.txt; fi" - cron_error_email: "" + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=\\$?; if [ \\$rc -ne 0 ] || grep -iE 'error|fail|fatal|critical|exception' /tmp/cron_output.txt | grep -v -E '(\\\"rc\\\": -13|MODULE FAILURE)' | grep -q .; then fi" + cron_error_email: "{% if item.cron_error_mailto is defined and item.cron_error_mailto|length > 0 %}mail -s 'Cron Error - $(hostname)' {{ item.cron_error_mailto }} < /tmp/cron_output.txt;{% endif %}" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" diff --git a/roles/cron/cron_drupal8/defaults/main.yml b/roles/cron/cron_drupal8/defaults/main.yml index a8ce5b9f..2afaa893 100644 --- a/roles/cron/cron_drupal8/defaults/main.yml +++ b/roles/cron/cron_drupal8/defaults/main.yml @@ -22,6 +22,6 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=\\$?; if [ \\$rc -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\"rc\\\": -13|MODULE FAILURE)\" | grep -q .; then [ -n \\\"{{ entry.cron_error_mailto }}\\\" ] && mail -s \\\"Cron Error - \\$(hostname)\\\" {{ entry.cron_error_mailto }} < /tmp/cron_output.txt; fi" - cron_error_email: "" + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=\\$?; if [ \\$rc -ne 0 ] || grep -iE 'error|fail|fatal|critical|exception' /tmp/cron_output.txt | grep -v -E '(\\\"rc\\\": -13|MODULE FAILURE)' | grep -q .; then fi" + cron_error_email: "{% if item.cron_error_mailto is defined and item.cron_error_mailto|length > 0 %}mail -s 'Cron Error - $(hostname)' {{ item.cron_error_mailto }} < /tmp/cron_output.txt;{% endif %}" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" From 1bfca111936bcc17e8672724e9af84d513c80c2f Mon Sep 17 00:00:00 2001 From: Drazen Date: Fri, 5 Sep 2025 05:34:03 +0200 Subject: [PATCH 14/19] Fixing-cron-syntax-PR-devel-1.x --- roles/cron/cron_drupal7/defaults/main.yml | 5 ++--- roles/cron/cron_drupal8/defaults/main.yml | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/roles/cron/cron_drupal7/defaults/main.yml b/roles/cron/cron_drupal7/defaults/main.yml index 2ba25354..5b2fcc7d 100644 --- a/roles/cron/cron_drupal7/defaults/main.yml +++ b/roles/cron/cron_drupal7/defaults/main.yml @@ -19,7 +19,6 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=\\$?; if [ \\$rc -ne 0 ] || grep -iE 'error|fail|fatal|critical|exception' /tmp/cron_output.txt | grep -v -E '(\\\"rc\\\": -13|MODULE FAILURE)' | grep -q .; then fi" - cron_error_email: "{% if item.cron_error_mailto is defined and item.cron_error_mailto|length > 0 %}mail -s 'Cron Error - $(hostname)' {{ item.cron_error_mailto }} < /tmp/cron_output.txt;{% endif %}" + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=\\$?; if [ \"\\$rc\" -ne 0 ] || grep -iE 'error|fail|fatal|critical|exception' /tmp/cron_output.txt | grep -v -E '(\\\"rc\\\": -13|MODULE FAILURE)' | grep -q .; then" + cron_error_email: "{% if item.cron_error_mailto is defined and item.cron_error_mailto|length > 0 %}mail -s 'Cron Error - $(hostname)' {{ item.cron_error_mailto }} < /tmp/cron_output.txt;{% endif %} fi" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" - diff --git a/roles/cron/cron_drupal8/defaults/main.yml b/roles/cron/cron_drupal8/defaults/main.yml index 2afaa893..3868e7d8 100644 --- a/roles/cron/cron_drupal8/defaults/main.yml +++ b/roles/cron/cron_drupal8/defaults/main.yml @@ -22,6 +22,6 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=\\$?; if [ \\$rc -ne 0 ] || grep -iE 'error|fail|fatal|critical|exception' /tmp/cron_output.txt | grep -v -E '(\\\"rc\\\": -13|MODULE FAILURE)' | grep -q .; then fi" - cron_error_email: "{% if item.cron_error_mailto is defined and item.cron_error_mailto|length > 0 %}mail -s 'Cron Error - $(hostname)' {{ item.cron_error_mailto }} < /tmp/cron_output.txt;{% endif %}" + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=\\$?; if [ \"\\$rc\" -ne 0 ] || grep -iE 'error|fail|fatal|critical|exception' /tmp/cron_output.txt | grep -v -E '(\\\"rc\\\": -13|MODULE FAILURE)' | grep -q .; then" + cron_error_email: "{% if item.cron_error_mailto is defined and item.cron_error_mailto|length > 0 %}mail -s 'Cron Error - $(hostname)' {{ item.cron_error_mailto }} < /tmp/cron_output.txt;{% endif %} fi" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" From 48e66edbc7abbd93fe7988425a35541015c4d23d Mon Sep 17 00:00:00 2001 From: Drazen Date: Fri, 5 Sep 2025 05:46:34 +0200 Subject: [PATCH 15/19] Fixing-cron-syntax-PR-devel-1.x --- roles/cron/cron_drupal7/defaults/main.yml | 4 ++-- roles/cron/cron_drupal8/defaults/main.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/cron/cron_drupal7/defaults/main.yml b/roles/cron/cron_drupal7/defaults/main.yml index 5b2fcc7d..0239fc3e 100644 --- a/roles/cron/cron_drupal7/defaults/main.yml +++ b/roles/cron/cron_drupal7/defaults/main.yml @@ -19,6 +19,6 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=\\$?; if [ \"\\$rc\" -ne 0 ] || grep -iE 'error|fail|fatal|critical|exception' /tmp/cron_output.txt | grep -v -E '(\\\"rc\\\": -13|MODULE FAILURE)' | grep -q .; then" - cron_error_email: "{% if item.cron_error_mailto is defined and item.cron_error_mailto|length > 0 %}mail -s 'Cron Error - $(hostname)' {{ item.cron_error_mailto }} < /tmp/cron_output.txt;{% endif %} fi" + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ \"$rc\" -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\\\\\"rc\\\\\\\": -13|MODULE FAILURE)\" | grep -q .; then" + cron_error_email: "{% if item.cron_error_mailto is defined and item.cron_error_mailto|length > 0 %}mail -s \"Cron Error - $(hostname)\" {{ item.cron_error_mailto }} < /tmp/cron_output.txt;{% endif %} fi" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" diff --git a/roles/cron/cron_drupal8/defaults/main.yml b/roles/cron/cron_drupal8/defaults/main.yml index 3868e7d8..5cc5f77f 100644 --- a/roles/cron/cron_drupal8/defaults/main.yml +++ b/roles/cron/cron_drupal8/defaults/main.yml @@ -22,6 +22,6 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=\\$?; if [ \"\\$rc\" -ne 0 ] || grep -iE 'error|fail|fatal|critical|exception' /tmp/cron_output.txt | grep -v -E '(\\\"rc\\\": -13|MODULE FAILURE)' | grep -q .; then" - cron_error_email: "{% if item.cron_error_mailto is defined and item.cron_error_mailto|length > 0 %}mail -s 'Cron Error - $(hostname)' {{ item.cron_error_mailto }} < /tmp/cron_output.txt;{% endif %} fi" + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ \"$rc\" -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\\\\\"rc\\\\\\\": -13|MODULE FAILURE)\" | grep -q .; then" + cron_error_email: "{% if item.cron_error_mailto is defined and item.cron_error_mailto|length > 0 %}mail -s \"Cron Error - $(hostname)\" {{ item.cron_error_mailto }} < /tmp/cron_output.txt;{% endif %} fi" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" From 097be2587dae5ef5d7db85c492c90c459e560abd Mon Sep 17 00:00:00 2001 From: Drazen Date: Fri, 5 Sep 2025 06:00:33 +0200 Subject: [PATCH 16/19] Fixing-cron-syntax-PR-devel-1.x --- roles/cron/cron_drupal7/defaults/main.yml | 4 ++-- roles/cron/cron_drupal8/defaults/main.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/cron/cron_drupal7/defaults/main.yml b/roles/cron/cron_drupal7/defaults/main.yml index 0239fc3e..97679627 100644 --- a/roles/cron/cron_drupal7/defaults/main.yml +++ b/roles/cron/cron_drupal7/defaults/main.yml @@ -19,6 +19,6 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ \"$rc\" -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\\\\\"rc\\\\\\\": -13|MODULE FAILURE)\" | grep -q .; then" - cron_error_email: "{% if item.cron_error_mailto is defined and item.cron_error_mailto|length > 0 %}mail -s \"Cron Error - $(hostname)\" {{ item.cron_error_mailto }} < /tmp/cron_output.txt;{% endif %} fi" + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ \"$rc\" -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then" + cron_error_email: "{% if entry.cron_error_mailto is defined and entry.cron_error_mailto|length > 0 %}mail -s \"Cron Error - $(hostname)\" {{ entry.cron_error_mailto }} < /tmp/cron_output.txt;{% else %}:;{% endif %} fi" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" diff --git a/roles/cron/cron_drupal8/defaults/main.yml b/roles/cron/cron_drupal8/defaults/main.yml index 5cc5f77f..2ab056d9 100644 --- a/roles/cron/cron_drupal8/defaults/main.yml +++ b/roles/cron/cron_drupal8/defaults/main.yml @@ -22,6 +22,6 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ \"$rc\" -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\\\\\"rc\\\\\\\": -13|MODULE FAILURE)\" | grep -q .; then" - cron_error_email: "{% if item.cron_error_mailto is defined and item.cron_error_mailto|length > 0 %}mail -s \"Cron Error - $(hostname)\" {{ item.cron_error_mailto }} < /tmp/cron_output.txt;{% endif %} fi" + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ \"$rc\" -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then" + cron_error_email: "{% if entry.cron_error_mailto is defined and entry.cron_error_mailto|length > 0 %}mail -s \"Cron Error - $(hostname)\" {{ entry.cron_error_mailto }} < /tmp/cron_output.txt;{% else %}:;{% endif %} fi" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" From fa5aef0dae4093bbce1baf7710929114929a0cc6 Mon Sep 17 00:00:00 2001 From: Drazen Date: Fri, 5 Sep 2025 06:22:28 +0200 Subject: [PATCH 17/19] Fixing-cron-syntax-PR-devel-1.x --- roles/cron/cron_drupal7/defaults/main.yml | 4 ++-- roles/cron/cron_drupal8/defaults/main.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/cron/cron_drupal7/defaults/main.yml b/roles/cron/cron_drupal7/defaults/main.yml index 97679627..26d995fa 100644 --- a/roles/cron/cron_drupal7/defaults/main.yml +++ b/roles/cron/cron_drupal7/defaults/main.yml @@ -19,6 +19,6 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ \"$rc\" -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then" - cron_error_email: "{% if entry.cron_error_mailto is defined and entry.cron_error_mailto|length > 0 %}mail -s \"Cron Error - $(hostname)\" {{ entry.cron_error_mailto }} < /tmp/cron_output.txt;{% else %}:;{% endif %} fi" + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ \"$rc\" -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\"rc\\\": -13|MODULE FAILURE)\" | grep -q .; then" + cron_error_email: "{% if item.cron_error_mailto is defined and item.cron_error_mailto|length > 0 %}mail -s \"Cron Error - \`hostname\`\" {{ item.cron_error_mailto }} < /tmp/cron_output.txt;{% else %}:;{% endif %} fi" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" diff --git a/roles/cron/cron_drupal8/defaults/main.yml b/roles/cron/cron_drupal8/defaults/main.yml index 2ab056d9..8c48dff8 100644 --- a/roles/cron/cron_drupal8/defaults/main.yml +++ b/roles/cron/cron_drupal8/defaults/main.yml @@ -22,6 +22,6 @@ drupal: # If defer is set to true, the Ansible target must be declared with defer_target. If using a group, include the index. For example, _ce_www_dev[0] defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" - cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ \"$rc\" -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E '(\"rc\": -13|MODULE FAILURE)' | grep -q .; then" - cron_error_email: "{% if entry.cron_error_mailto is defined and entry.cron_error_mailto|length > 0 %}mail -s \"Cron Error - $(hostname)\" {{ entry.cron_error_mailto }} < /tmp/cron_output.txt;{% else %}:;{% endif %} fi" + cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ \"$rc\" -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\"rc\\\": -13|MODULE FAILURE)\" | grep -q .; then" + cron_error_email: "{% if item.cron_error_mailto is defined and item.cron_error_mailto|length > 0 %}mail -s \"Cron Error - \`hostname\`\" {{ item.cron_error_mailto }} < /tmp/cron_output.txt;{% else %}:;{% endif %} fi" python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" From 252b6a4badec04ace8f9d2ef33b7455b893303a3 Mon Sep 17 00:00:00 2001 From: drazenCE <140631110+drazenCE@users.noreply.github.com> Date: Fri, 5 Sep 2025 06:29:09 +0200 Subject: [PATCH 18/19] Update main.yml --- roles/cron/cron_drupal7/defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/cron/cron_drupal7/defaults/main.yml b/roles/cron/cron_drupal7/defaults/main.yml index 491a66d3..c82c0254 100644 --- a/roles/cron/cron_drupal7/defaults/main.yml +++ b/roles/cron/cron_drupal7/defaults/main.yml @@ -20,5 +20,5 @@ drupal: defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ \"$rc\" -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\"rc\\\": -13|MODULE FAILURE)\" | grep -q .; then" - cron_error_email: "{% if item.cron_error_mailto is defined and item.cron_error_mailto|length > 0 %}mail -s \"Cron Error - \`hostname\`\" {{ item.cron_error_mailto }} < /tmp/cron_output.txt;{% else %}:;{% endif %} fi" - python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" \ No newline at end of file + cron_error_email: '{% if entry.cron_error_mailto is defined and entry.cron_error_mailto|length > 0 %}mail -s "Cron Error - $(hostname)" {{ entry.cron_error_mailto }} < /tmp/cron_output.txt;{% else %}:;{% endif %} fi' + python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'" From a9a023b46930b6771f00a79497df556936db6c80 Mon Sep 17 00:00:00 2001 From: drazenCE <140631110+drazenCE@users.noreply.github.com> Date: Fri, 5 Sep 2025 06:29:38 +0200 Subject: [PATCH 19/19] Update main.yml --- roles/cron/cron_drupal8/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/cron/cron_drupal8/defaults/main.yml b/roles/cron/cron_drupal8/defaults/main.yml index 8c48dff8..3a666b21 100644 --- a/roles/cron/cron_drupal8/defaults/main.yml +++ b/roles/cron/cron_drupal8/defaults/main.yml @@ -23,5 +23,5 @@ drupal: defer_target: "" drush_location: "{{ drush_bin }}" # you might specify another location, e.g. "{{ deploy_path }}/vendor/bin/drush" cron_error_filter: "> /tmp/cron_output.txt 2>&1; rc=$?; if [ \"$rc\" -ne 0 ] || grep -iE \"error|fail|fatal|critical|exception\" /tmp/cron_output.txt | grep -v -E \"(\\\"rc\\\": -13|MODULE FAILURE)\" | grep -q .; then" - cron_error_email: "{% if item.cron_error_mailto is defined and item.cron_error_mailto|length > 0 %}mail -s \"Cron Error - \`hostname\`\" {{ item.cron_error_mailto }} < /tmp/cron_output.txt;{% else %}:;{% endif %} fi" + cron_error_email: '{% if entry.cron_error_mailto is defined and entry.cron_error_mailto|length > 0 %}mail -s "Cron Error - $(hostname)" {{ entry.cron_error_mailto }} < /tmp/cron_output.txt;{% else %}:;{% endif %} fi' python_interpreter: "-e 'ansible_python_interpreter=/home/controller/ce-python/bin/python'"