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
Lu Xu
slapos.package
Commits
342527e9
Commit
342527e9
authored
8 years ago
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
obs/slapos: Setup crontab as early as possible for the upgrade.
parent
ffdc83d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
playbook/roles/upgrader/tasks/main.yml
playbook/roles/upgrader/tasks/main.yml
+9
-7
No files found.
playbook/roles/upgrader/tasks/main.yml
View file @
342527e9
...
...
@@ -58,21 +58,23 @@
current_upgrade_signature
-
name
:
Do upgrade
shell
:
ansible-playbook {{ upgrader_playbook }} -i hosts 2>>/opt/upgrader/latest_upgrade.log >> /opt/upgrader/latest_upgrade.log
shell
:
ansible-playbook {{ upgrader_playbook }} -i hosts 2>>/opt/upgrader/latest_upgrade.log >> /opt/upgrader/latest_upgrade.log
when
:
(upgrade_after > lookup('file', '/opt/upgrader/last-upgrade')|int ) and (lookup('file', '/opt/upgrader/next-upgrade-signature') != lookup('file', '/opt/upgrader/current-upgrade-signature'))
args
:
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 && ansible-playbook upgrader-run.yml --extra-vars "upgrader_playbook={{ upgrader_playbook }}" -i hosts 2>>/opt/upgrader/latest_upgrade.log >> /opt/upgrader/latest_upgrade.log'
-
cron
:
name="Launch Upgrader" state=absent
-
name
:
Upgrade Current Upgrade Signature
shell
:
cat /opt/upgrader/next-upgrade-signature > /opt/upgrader/current-upgrade-signature
when
:
(upgrade_after > lookup('file', '/opt/upgrader/last-upgrade')|int ) and (lookup('file', '/opt/upgrader/next-upgrade-signature') != lookup('file', '/opt/upgrader/current-upgrade-signature'))
-
shell
:
echo {{ ansible_date_time.epoch }} > /opt/upgrader/last-upgrade
when
:
(upgrade_after > lookup('file', '/opt/upgrader/last-upgrade')|int )
-
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 && ansible-playbook upgrader-run.yml --extra-vars "upgrader_playbook={{ upgrader_playbook }}" -i hosts 2>>/opt/upgrader/latest_upgrade.log >> /opt/upgrader/latest_upgrade.log'
-
cron
:
name="Launch Upgrader" state=absent
when
:
(upgrade_after > lookup('file', '/opt/upgrader/last-upgrade')|int )
-
include
:
remove-legacy.yml
This diff is collapsed.
Click to expand it.
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