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
Ivan Tyagov
slapos.package
Commits
d1e5311d
Commit
d1e5311d
authored
Sep 10, 2024
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
playbook/ors: adapt playbook to new amarisoft version format
parent
b47c4bbf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
11 deletions
+21
-11
playbook/roles/amarisoft-upgrade/tasks/main.yml
playbook/roles/amarisoft-upgrade/tasks/main.yml
+19
-9
playbook/roles/ors/tasks/main.yml
playbook/roles/ors/tasks/main.yml
+2
-2
No files found.
playbook/roles/amarisoft-upgrade/tasks/main.yml
View file @
d1e5311d
...
@@ -21,26 +21,36 @@
...
@@ -21,26 +21,36 @@
register
:
license_expiration
register
:
license_expiration
when
:
certificate.stat.exists == True
when
:
certificate.stat.exists == True
-
name
:
Get license version
-
name
:
Get current version
shell
:
'
/opt/amarisoft/get-license-info
-v
||
echo
0000-00-00'
shell
:
'
/opt/amarisoft/get-license-info
-v
||
echo
0000-00-00.0
|
cut
-d.
-f1'
register
:
license_version
register
:
current_version
when
:
certificate.stat.exists == True
-
name
:
Get current version timestamp
shell
:
'
/opt/amarisoft/get-license-info
-v
|
grep
"\."
||
echo
0000-00-00.0
|
cut
-d.
-f2'
register
:
current_timestamp
when
:
certificate.stat.exists == True
when
:
certificate.stat.exists == True
-
debug
:
-
debug
:
msg
:
"
[{{
ansible_date_time.date
}}
{{
ansible_date_time.time
}}]
License
will
expire
on
{{
license_expiration.stdout
}},
current
version
is
{{
license_version
.stdout
}}"
msg
:
"
[{{
ansible_date_time.date
}}
{{
ansible_date_time.time
}}]
License
will
expire
on
{{
license_expiration.stdout
}},
current
version
is
{{
current_version.stdout
}}-{{
current_timestamp
.stdout
}}"
when
:
certificate.stat.exists == True
when
:
certificate.stat.exists == True
-
name
:
Get new amarisoft version if available
-
name
:
Get new amarisoft version if available
shell
:
"
networkcache-download
-c
/opt/amarisoft/shacache.cfg
-k
key-private:amarisoft
'
version<=
\"
{{
license_expiration.stdout
}}
\"
'
'version>>
\"
{{
license_version.stdout
}}
\"
'
'cn==
\"
{{
cn
}}
\"
'
--list
|
grep
version
|
cut
-d
\\\"
-f4"
shell
:
"
networkcache-download
-c
/opt/amarisoft/shacache.cfg
-k
key-private:amarisoft
'
cn==
\"
{{
cn
}}
\"
'
'version<=
\"
{{
license_expiration.stdout
}}
\"
'
'version>>
\"
{{
current_version.stdout
}}
\"
'
'timestamp>>
\"
{{
current_timestamp.stdout
}}
\"
'
--list
|
grep
version
|
cut
-d
\\\"
-f4"
register
:
new_version
register
:
new_version
when
:
certificate.stat.exists == True
when
:
certificate.stat.exists == True
-
name
:
Get new amarisoft timestamp
shell
:
"
networkcache-download
-c
/opt/amarisoft/shacache.cfg
-k
key-private:amarisoft
'cn==
\"
{{
cn
}}
\"
'
'version<=
\"
{{
license_expiration.stdout
}}
\"
'
'version>>
\"
{{
current_version.stdout
}}
\"
'
'timestamp>>
\"
{{
current_timestamp.stdout
}}
\"
'
--list
|
grep
timestamp
|
cut
-d
\\\"
-f4"
register
:
new_timestamp
when
:
(certificate.stat.exists == True) and (new_version.stdout != "")
-
debug
:
-
debug
:
msg
:
"
[{{
ansible_date_time.date
}}
{{
ansible_date_time.time
}}]
Found
new
version:
{{
new_version.stdout
}}"
msg
:
"
[{{
ansible_date_time.date
}}
{{
ansible_date_time.time
}}]
Found
new
version:
{{
new_version.stdout
}}"
when
:
(certificate.stat.exists == True) and (new_version.stdout != "")
when
:
(certificate.stat.exists == True) and (new_version.stdout != "")
-
name
:
Download nonce to decrypt new amarisoft version
-
name
:
Download nonce to decrypt new amarisoft version
shell
:
"
networkcache-download
-c
/opt/amarisoft/shacache.cfg
-k
file-private:amarisoft
'version<=
\"
{{
license_expiration.stdout
}}
\"
'
'version>>
\"
{{
license_version
.stdout
}}
\"
'
--list
|
grep
nonce
|
cut
-d
\\\"
-f4
>
{{
install_folder
}}/download/nonce"
shell
:
"
networkcache-download
-c
/opt/amarisoft/shacache.cfg
-k
file-private:amarisoft
'version<=
\"
{{
license_expiration.stdout
}}
\"
'
'version>>
\"
{{
current_version.stdout
}}
\"
'
'timestamp>>
\"
{{
current_timestamp
.stdout
}}
\"
'
--list
|
grep
nonce
|
cut
-d
\\\"
-f4
>
{{
install_folder
}}/download/nonce"
register
:
nonce
register
:
nonce
when
:
(certificate.stat.exists == True) and (new_version.stdout != "")
when
:
(certificate.stat.exists == True) and (new_version.stdout != "")
...
@@ -48,11 +58,11 @@
...
@@ -48,11 +58,11 @@
when
:
(certificate.stat.exists == True) and (new_version.stdout != "")
when
:
(certificate.stat.exists == True) and (new_version.stdout != "")
-
name
:
Download new amarisoft version
-
name
:
Download new amarisoft version
shell
:
"
networkcache-download
-c
/opt/amarisoft/shacache.cfg
-k
file-private:amarisoft
'version<=
\"
{{
license_expiration.stdout
}}
\"
'
'version>>
\"
{{
license_version
.stdout
}}
\"
'
>
{{
install_folder
}}/download/amarisoft.tar.gz.enc"
shell
:
"
networkcache-download
-c
/opt/amarisoft/shacache.cfg
-k
file-private:amarisoft
'version<=
\"
{{
license_expiration.stdout
}}
\"
'
'version>>
\"
{{
current_version.stdout
}}
\"
'
'timestamp>>
\"
{{
current_timestamp
.stdout
}}
\"
'
>
{{
install_folder
}}/download/amarisoft.tar.gz.enc"
when
:
(certificate.stat.exists == True) and (new_version.stdout != "")
when
:
(certificate.stat.exists == True) and (new_version.stdout != "")
-
name
:
Download encrypted symmetric key for new amarisoft version
-
name
:
Download encrypted symmetric key for new amarisoft version
shell
:
"
networkcache-download
-c
/opt/amarisoft/shacache.cfg
-k
key-private:amarisoft
'
version<=
\"
{{
license_expiration.stdout
}}
\"
'
'version>>
\"
{{
license_version.stdout
}}
\"
'
'cn==
\"
{{
cn
}}
\"
'
>
{{
install_folder
}}/download/symmetric_key.bin.enc"
shell
:
"
networkcache-download
-c
/opt/amarisoft/shacache.cfg
-k
key-private:amarisoft
'
cn==
\"
{{
cn
}}
\"
'
'version<=
\"
{{
license_expiration.stdout
}}
\"
'
'version>>
\"
{{
current_version.stdout
}}
\"
'
'timestamp>>
\"
{{
current_timestamp.stdout
}}
\"
'
>
{{
install_folder
}}/download/symmetric_key.bin.enc"
when
:
(certificate.stat.exists == True) and (new_version.stdout != "")
when
:
(certificate.stat.exists == True) and (new_version.stdout != "")
-
name
:
Create directory if it does not exist
-
name
:
Create directory if it does not exist
...
@@ -131,7 +141,7 @@
...
@@ -131,7 +141,7 @@
ignore_errors
:
True
ignore_errors
:
True
-
name
:
Move amarisoft folder
-
name
:
Move amarisoft folder
shell
:
'
mv
{{
install_folder
}}/_{{
version
}}
{{
install_folder
}}/v{{
version
}}'
shell
:
'
mv
{{
install_folder
}}/_{{
version
}}
{{
install_folder
}}/v{{
version
}}
.{{
new_timestamp.stdout
}}
'
when
:
(certificate.stat.exists == True) and (new_version.stdout != "")
when
:
(certificate.stat.exists == True) and (new_version.stdout != "")
-
name
:
Remove extraction folder
-
name
:
Remove extraction folder
...
...
playbook/roles/ors/tasks/main.yml
View file @
d1e5311d
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
when
:
(monitor_path is succeeded) and (playbook_report | bool)
when
:
(monitor_path is succeeded) and (playbook_report | bool)
-
name
:
Check Amarisoft version
-
name
:
Check Amarisoft version
shell
:
'
find
/opt/amarisoft
-maxdepth
1
|
grep
"^/opt/amarisoft/v[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}$"
|
cut
-d/
-f4
|
sort
|
tail
-n1'
shell
:
'
find
/opt/amarisoft
-maxdepth
1
|
grep
"^/opt/amarisoft/v[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}
.[0-9]*
$"
|
cut
-d/
-f4
|
sort
|
tail
-n1'
register
:
amarisoft_version
register
:
amarisoft_version
ignore_errors
:
yes
ignore_errors
:
yes
...
@@ -101,7 +101,7 @@
...
@@ -101,7 +101,7 @@
copy
:
src=rm-tmp-lte dest=/opt/amarisoft owner=root mode=770
copy
:
src=rm-tmp-lte dest=/opt/amarisoft owner=root mode=770
-
name
:
Get Amarisoft path
-
name
:
Get Amarisoft path
shell
:
'
find
/opt/amarisoft
-maxdepth
1
|
grep
"^/opt/amarisoft/v[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}$"
|
sort
|
tail
-n1'
shell
:
'
find
/opt/amarisoft
-maxdepth
1
|
grep
"^/opt/amarisoft/v[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}
.[0-9]*
$"
|
sort
|
tail
-n1'
register
:
amarisoft_path
register
:
amarisoft_path
-
name
:
Check if lteenb has capabilities
-
name
:
Check if lteenb has capabilities
...
...
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