Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
slapos.package
Commits
22c0ca32
Commit
22c0ca32
authored
Sep 29, 2022
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playbook/upgrader: make minute and hour cron period an option
parent
eb420ed4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
playbook/roles/ors/tasks/main.yml
playbook/roles/ors/tasks/main.yml
+4
-1
playbook/roles/upgrader/defaults/main.yml
playbook/roles/upgrader/defaults/main.yml
+2
-0
playbook/roles/upgrader/tasks/main.yml
playbook/roles/upgrader/tasks/main.yml
+1
-1
No files found.
playbook/roles/ors/tasks/main.yml
View file @
22c0ca32
...
...
@@ -17,9 +17,12 @@
register
:
vifib_cron
-
name
:
Install vifib-base playbook
shell
:
ansible-playbook vifib-base.yml
shell
:
ansible-playbook vifib-base.yml
--extra-vars '{"period_minute":"*/10", "period_hour":"*"}'
when
:
vifib_cron.rc !=
0
-
name
:
Remove old cron
cron
:
name="Launch ors playbook every 3 hours" state=absent
-
name
:
Install periodic cron
cron
:
name="Launch ors playbook periodically" minute="*/10" hour="*" job='cd /opt/upgrader/playbook && ansible-playbook ors.yml 2>> /opt/upgrader/latest_ors.log >> /opt/upgrader/latest_ors.log'
...
...
playbook/roles/upgrader/defaults/main.yml
0 → 100644
View file @
22c0ca32
period_minute
:
'
0'
period_hour
:
'
*/3'
playbook/roles/upgrader/tasks/main.yml
View file @
22c0ca32
...
...
@@ -66,7 +66,7 @@
chdir
:
/opt/upgrader/playbook-tmp/
-
name
:
Set Cron
cron
:
name="Launch Upgrader with ansible" minute="
0" hour="*/3
" job='rm -rf /opt/upgrader/playbook && cp -R /opt/upgrader/playbook-tmp /opt/upgrader/playbook && cd /opt/upgrader/playbook && PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin ansible-playbook upgrader-run.yml --extra-vars "upgrader_playbook={{ upgrader_playbook }} upgrade_kernel={{ upgrade_kernel | default(False) == True }}" -i hosts 2>>/opt/upgrader/latest_upgrade.log >> /opt/upgrader/latest_upgrade.log'
cron
:
name="Launch Upgrader with ansible" minute="
{{ period_minute }}" hour="{{ period_hour }}
" job='rm -rf /opt/upgrader/playbook && cp -R /opt/upgrader/playbook-tmp /opt/upgrader/playbook && cd /opt/upgrader/playbook && PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin ansible-playbook upgrader-run.yml --extra-vars "upgrader_playbook={{ upgrader_playbook }} upgrade_kernel={{ upgrade_kernel | default(False) == True }}" -i hosts 2>>/opt/upgrader/latest_upgrade.log >> /opt/upgrader/latest_upgrade.log'
-
cron
:
name="Launch Upgrader" state=absent
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment