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
Rafael Monnerat
slapos.package
Commits
35824342
Commit
35824342
authored
Jun 15, 2015
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playbook: Introduce timebased upgrade schedule
Now 'upgrader' should do also date comparation.
parent
db0d2246
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
2 deletions
+17
-2
playbook/roles/upgrader/tasks/main.yml
playbook/roles/upgrader/tasks/main.yml
+11
-2
playbook/settings/upgrader.yml
playbook/settings/upgrader.yml
+2
-0
playbook/upgrader-run.yml
playbook/upgrader-run.yml
+3
-0
playbook/vifib.yml
playbook/vifib.yml
+1
-0
No files found.
playbook/roles/upgrader/tasks/main.yml
View file @
35824342
---
---
-
stat
:
path=/opt/upgrader/last-upgrade
register
:
last_upgrade
-
shell
:
echo 1 > /opt/upgrader/last-upgrade
when
:
last_upgrade.stat.exists == False
-
file
:
path=/opt/upgrader/ state=directory mode=0755
-
file
:
path=/opt/upgrader/ state=directory mode=0755
-
shell
:
rm -rf /opt/upgrader/playbook/
-
shell
:
rm -rf /opt/upgrader/playbook/
...
@@ -34,13 +40,16 @@
...
@@ -34,13 +40,16 @@
-
name
:
Do upgrade
-
name
:
Do upgrade
shell
:
ansible-playbook {{ upgrader_playbook }} -i hosts >> /opt/upgrader/latest_upgrade.log
shell
:
ansible-playbook {{ upgrader_playbook }} -i hosts >> /opt/upgrader/latest_upgrade.log
when
:
lookup('file', '/opt/upgrader/next-upgrade-signature') != lookup('file', '/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')
)
args
:
args
:
chdir
:
/opt/upgrader/playbook/
chdir
:
/opt/upgrader/playbook/
-
name
:
Upgrade Current Upgrade Signature
-
name
:
Upgrade Current Upgrade Signature
shell
:
cat /opt/upgrader/next-upgrade-signature > /opt/upgrader/current-upgrade-signature
shell
:
cat /opt/upgrader/next-upgrade-signature > /opt/upgrader/current-upgrade-signature
when
:
lookup('file', '/opt/upgrader/next-upgrade-signature') != lookup('file', '/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 ) and (lookup('file', '/opt/upgrader/next-upgrade-signature') != lookup('file', '/opt/upgrader/current-upgrade-signature'))
-
name
:
Set Cron
-
name
:
Set Cron
cron
:
name="Launch Upgrader" minute="0" hour="*/3" job='ansible-playbook upgrader-run.yml --with-vars "upgrader-playbook={{ upgrader_playbook }}" -i hosts >> /opt/upgrader/latest_upgrade.log'
cron
:
name="Launch Upgrader" minute="0" hour="*/3" job='ansible-playbook upgrader-run.yml --with-vars "upgrader-playbook={{ upgrader_playbook }}" -i hosts >> /opt/upgrader/latest_upgrade.log'
playbook/settings/upgrader.yml
0 → 100644
View file @
35824342
---
upgrade_after
:
1434474611
playbook/upgrader-run.yml
View file @
35824342
...
@@ -2,6 +2,9 @@
...
@@ -2,6 +2,9 @@
hosts
:
127.0.0.1
hosts
:
127.0.0.1
connection
:
local
connection
:
local
vars_files
:
-
settings/upgrader.yml
roles
:
roles
:
-
upgrader
-
upgrader
playbook/vifib.yml
View file @
35824342
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
vars_files
:
vars_files
:
-
settings/vifib.yml
-
settings/vifib.yml
-
settings/upgrader.yml
vars_prompt
:
vars_prompt
:
-
name
:
"
computer_name"
-
name
:
"
computer_name"
...
...
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