Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drush
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ansible
Roles
drush
Commits
07a60f4c
Commit
07a60f4c
authored
3 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
ansible/playbooks/general#106
Configure cron tasks to utilize healthchecks
parent
9bcbcf7b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tasks/config-8.yml
+20
-3
20 additions, 3 deletions
tasks/config-8.yml
tasks/config-9.yml
+1
-1
1 addition, 1 deletion
tasks/config-9.yml
tasks/main.yml
+3
-0
3 additions, 0 deletions
tasks/main.yml
with
24 additions
and
4 deletions
tasks/config-8.yml
+
20
−
3
View file @
07a60f4c
...
...
@@ -123,6 +123,11 @@
tags
:
-
DrushUpdateAliases
-
set_fact
:
healthcheckping1
:
"
{{
lookup('healthchecks',
'',
base_url='https://healthchecks.lakedrops.com',
api_key=healthchecks.api,
host=inventory_hostname,
user='root',
jobname=['Run
Drush
Cron
on
@',
inventory_hostname,
drushSubkey]|join(''),
schedule=[drush_cron_core.minute|default('*'),drush_cron_core.hour|default('*'),drush_cron_core.day|default('*'),drush_cron_core.month|default('*'),drush_cron_core.weekday|default('*')]|join('
'),
channels=healthchecks.channels|join(','))
}}"
tags
:
-
cron
-
name
:
Install cron for core:cron
cron
:
name
:
Run Drush Cron on @{{ inventory_hostname }}{{ drushSubkey }}
...
...
@@ -131,12 +136,18 @@
weekday
:
'
{{
drush_cron_core.weekday|default(omit)
}}'
hour
:
'
{{
drush_cron_core.hour|default(omit)
}}'
minute
:
'
{{
drush_cron_core.minute|default(omit)
}}'
job
:
'
{{
composer_home_path
}}/vendor/bin/drush
-y
@{{
inventory_hostname
}}{{
drushSubkey
}}
core:cron
>/dev/null
2>&1'
job
:
'
{{
composer_home_path
}}/vendor/bin/drush
-y
@{{
inventory_hostname
}}{{
drushSubkey
}}
core:cron
>/dev/null
2>&1
&&
{{
healthcheckping1
}}
'
disabled
:
'
{{
crons_disabled|default(false)
}}'
when
:
drush_cron_core.active
tags
:
-
cron
-
set_fact
:
healthcheckping2
:
"
{{
lookup('healthchecks',
'',
base_url='https://healthchecks.lakedrops.com',
api_key=healthchecks.api,
host=inventory_hostname,
user='root',
jobname=['Run
Drush
Translation
Refresh
on
@',
inventory_hostname,
drushSubkey]|join(''),
schedule=[drush_cron_translation.minute|default('*'),drush_cron_translation.hour|default('*'),drush_cron_translation.day|default('*'),drush_cron_translation.month|default('*'),drush_cron_translation.weekday|default('*')]|join('
'),
channels=healthchecks.channels|join(','))
}}"
when
:
drush_cron_translation.active
tags
:
-
cron
-
name
:
Install cron for translation refresh
cron
:
name
:
Run Drush Translation Refresh on @{{ inventory_hostname }}{{ drushSubkey }}
...
...
@@ -145,12 +156,18 @@
weekday
:
'
{{
drush_cron_translation.weekday|default(omit)
}}'
hour
:
'
{{
drush_cron_translation.hour.refresh
}}'
minute
:
'
{{
drush_cron_translation.minute.refresh
}}'
job
:
'
{{
composer_home_path
}}/vendor/bin/drush
-y
@{{
inventory_hostname
}}{{
drushSubkey
}}
l10n-update-refresh
>/dev/null
2>&1'
job
:
'
{{
composer_home_path
}}/vendor/bin/drush
-y
@{{
inventory_hostname
}}{{
drushSubkey
}}
l10n-update-refresh
>/dev/null
2>&1
&&
{{
healthcheckping2
}}
'
disabled
:
'
{{
crons_disabled|default(false)
}}'
when
:
drush_cron_translation.active
tags
:
-
cron
-
set_fact
:
healthcheckping3
:
"
{{
lookup('healthchecks',
'',
base_url='https://healthchecks.lakedrops.com',
api_key=healthchecks.api,
host=inventory_hostname,
user='root',
jobname=['Run
Drush
Translation
Update
on
@',
inventory_hostname,
drushSubkey]|join(''),
schedule=[drush_cron_translation.minute|default('*'),drush_cron_translation.hour|default('*'),drush_cron_translation.day|default('*'),drush_cron_translation.month|default('*'),drush_cron_translation.weekday|default('*')]|join('
'),
channels=healthchecks.channels|join(','))
}}"
when
:
drush_cron_translation.active
tags
:
-
cron
-
name
:
Install cron for translation update
cron
:
name
:
Run Drush Translation Update on @{{ inventory_hostname }}{{ drushSubkey }}
...
...
@@ -159,7 +176,7 @@
weekday
:
'
{{
drush_cron_translation.weekday|default(omit)
}}'
hour
:
'
{{
drush_cron_translation.hour["update"]
}}'
minute
:
'
{{
drush_cron_translation.minute["update"]
}}'
job
:
'
{{
composer_home_path
}}/vendor/bin/drush
-y
@{{
inventory_hostname
}}{{
drushSubkey
}}
l10n-update
>/dev/null
2>&1'
job
:
'
{{
composer_home_path
}}/vendor/bin/drush
-y
@{{
inventory_hostname
}}{{
drushSubkey
}}
l10n-update
>/dev/null
2>&1
&&
{{
healthcheckping3
}}
'
disabled
:
'
{{
crons_disabled|default(false)
}}'
when
:
drush_cron_translation.active
tags
:
...
...
This diff is collapsed.
Click to expand it.
tasks/config-9.yml
+
1
−
1
View file @
07a60f4c
...
...
@@ -73,7 +73,7 @@
weekday
:
'
{{
drush_cron_core.weekday|default(omit)
}}'
hour
:
'
{{
drush_cron_core.hour|default(omit)
}}'
minute
:
'
{{
drush_cron_core.minute|default(omit)
}}'
job
:
cd {{ webRoot }} && /usr/local/bin/drush -y {{ drushAlias }} core:cron >/dev/null 2>&1
job
:
cd {{ webRoot }} && /usr/local/bin/drush -y {{ drushAlias }} core:cron >/dev/null 2>&1
&& {{ lookup('healthchecks', '', base_url='https://healthchecks.lakedrops.com', api_key=healthchecks.api, host=inventory_hostname, user='root', jobname=['Run Drush Cron on', drushAlias]|join(' '), schedule=[drush_cron_core.minute|default('*'),drush_cron_core.hour|default('*'),drush_cron_core.day|default('*'),drush_cron_core.month|default('*'),drush_cron_core.weekday|default('*')]|join(' '), channels=healthchecks.channels|join(',')) }}
disabled
:
'
{{
crons_disabled|default(false)
}}'
when
:
drush_cron_core.active and not drupal.docker|default(false)
tags
:
...
...
This diff is collapsed.
Click to expand it.
tasks/main.yml
+
3
−
0
View file @
07a60f4c
...
...
@@ -13,6 +13,9 @@
with_items
:
'
{{
drupal_settings|default([])
}}'
loop_control
:
loop_var
:
drupal
tags
:
-
cron
-
DrushUpdateAliases
when
:
drupal.create_drush_aliases|default(true) and (limit_site is not defined or limit_site == 'no' or drupal.id is not defined or limit_site == drupal.id)
when
:
not excluded_roles or "drush" not in excluded_roles
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment