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
Carlos Ramos Carreño
slapos.package
Commits
afd5401a
Commit
afd5401a
authored
Sep 17, 2024
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ors-amarisoft: fixup for
d1e5311d
parent
d1e5311d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
33 deletions
+38
-33
playbook/roles/amarisoft-upgrade/tasks/main.yml
playbook/roles/amarisoft-upgrade/tasks/main.yml
+35
-30
playbook/roles/ors/files/init-sdr
playbook/roles/ors/files/init-sdr
+2
-2
playbook/sha256sum
playbook/sha256sum
+1
-1
No files found.
playbook/roles/amarisoft-upgrade/tasks/main.yml
View file @
afd5401a
...
@@ -32,120 +32,125 @@
...
@@ -32,120 +32,125 @@
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
{{
current_version.stdout
}}
-
{{
current_timestamp.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
'cn==
\"
{{
cn
}}
\"
'
'version<=
\"
{{
license_expiration.stdout
}}
\"
'
'
version>>
\"
{{
current_version.stdout
}}
\"
'
'timestamp>>
\"
{{
current_timestamp.stdout
}}
\"
'
--list
|
grep
version
|
cut
-d
\\\"
-f4"
shell
:
"
networkcache-download
-c
/opt/amarisoft/shacache.cfg
-k
key-private:amarisoft
'cn==
\"
{{
cn
}}
\"
'
'version<=
\"
{{
license_expiration.stdout
}}
\"
'
'
timestamp>=
\"
0
\"
'
'version>>
\"
0
\"
'
'timestamp>>
\"
0
\"
'
--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
-
name
:
Get new amarisoft timestamp
if available
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"
shell
:
"
networkcache-download
-c
/opt/amarisoft/shacache.cfg
-k
key-private:amarisoft
'cn==
\"
{{
cn
}}
\"
'
'version<=
\"
{{
license_expiration.stdout
}}
\"
'
'
timestamp>=
\"
0
\"
'
'version>>
\"
0
\"
'
'timestamp>>
\"
0
\"
'
--list
|
grep
timestamp
|
cut
-d
\\\"
-f4"
register
:
new_timestamp
register
:
new_timestamp
when
:
(certificate.stat.exists == True) and (new_version.stdout != "")
when
:
certificate.stat.exists == True
-
set_fact
:
new_version_found=False
-
set_fact
:
new_version_found=True
when
:
new_version.stdout > current_version.stdout or (new_version.stdout == current_version.stdout and new_timestamp.stdout > current_timestamp.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
version
{{
new_version.stdout
}}.{{
new_timestamp
.stdout
}}"
when
:
(certificate.stat.exists == True) and (new_version.stdout != "")
when
:
certificate.stat.exists == True
-
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>>
\"
{{
current_version.stdout
}}
\"
'
'timestamp>>
\"
{{
current
_timestamp.stdout
}}
\"
'
--list
|
grep
nonce
|
cut
-d
\\\"
-f4
>
{{
install_folder
}}/download/nonce"
shell
:
"
networkcache-download
-c
/opt/amarisoft/shacache.cfg
-k
file-private:amarisoft
'version
==
\"
{{
new_version.stdout
}}
\"
'
'timestamp==
\"
{{
new
_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
_found == True
)
-
set_fact
:
version="{{ new_version.stdout }}"
-
set_fact
:
version="{{ new_version.stdout }}"
when
:
(certificate.stat.exists == True) and (new_version
.stdout != ""
)
when
:
(certificate.stat.exists == True) and (new_version
_found == True
)
-
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>>
\"
{{
current_version.stdout
}}
\"
'
'timestamp>>
\"
{{
current
_timestamp.stdout
}}
\"
'
>
{{
install_folder
}}/download/amarisoft.tar.gz.enc"
shell
:
"
networkcache-download
-c
/opt/amarisoft/shacache.cfg
-k
file-private:amarisoft
'version
==
\"
{{
new_version.stdout
}}
\"
'
'timestamp==
\"
{{
new
_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
_found == True
)
-
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
'cn==
\"
{{
cn
}}
\"
'
'version
<=
\"
{{
license_expiration.stdout
}}
\"
'
'version>>
\"
{{
current_version.stdout
}}
\"
'
'timestamp>>
\"
{{
current
_timestamp.stdout
}}
\"
'
>
{{
install_folder
}}/download/symmetric_key.bin.enc"
shell
:
"
networkcache-download
-c
/opt/amarisoft/shacache.cfg
-k
key-private:amarisoft
'cn==
\"
{{
cn
}}
\"
'
'version
==
\"
{{
new_version.stdout
}}
\"
'
'timestamp==
\"
{{
new
_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
_found == True
)
-
name
:
Create directory if it does not exist
-
name
:
Create directory if it does not exist
file
:
path={{ install_folder }}/{{ version }} state=directory mode=0755
file
:
path={{ install_folder }}/{{ version }} state=directory mode=0755
when
:
(certificate.stat.exists == True) and (new_version
.stdout != ""
)
when
:
(certificate.stat.exists == True) and (new_version
_found == True
)
-
name
:
Create directory if it does not exist
-
name
:
Create directory if it does not exist
file
:
path={{ install_folder }}/_{{ version }} state=directory mode=0755
file
:
path={{ install_folder }}/_{{ version }} state=directory mode=0755
when
:
(certificate.stat.exists == True) and (new_version
.stdout != ""
)
when
:
(certificate.stat.exists == True) and (new_version
_found == True
)
-
name
:
Decrypt key
-
name
:
Decrypt key
shell
:
'
openssl
pkeyutl
-decrypt
-in
{{
install_folder
}}/download/symmetric_key.bin.enc
-inkey
/opt/private-key/{{
cn
}}.key
-out
/opt/private-key/symmetric_key-{{
version
}}.key'
shell
:
'
openssl
pkeyutl
-decrypt
-in
{{
install_folder
}}/download/symmetric_key.bin.enc
-inkey
/opt/private-key/{{
cn
}}.key
-out
/opt/private-key/symmetric_key-{{
version
}}.key'
when
:
(certificate.stat.exists == True) and (new_version
.stdout != ""
)
when
:
(certificate.stat.exists == True) and (new_version
_found == True
)
-
name
:
Decrypt archive
-
name
:
Decrypt archive
script
:
encrypt-data.sh /opt/private-key/symmetric_key-{{ version }}.key {{ install_folder }}/download/nonce decrypt {{ install_folder }}/download/amarisoft.tar.gz.enc {{ install_folder }}/amarisoft.tar.gz
script
:
encrypt-data.sh /opt/private-key/symmetric_key-{{ version }}.key {{ install_folder }}/download/nonce decrypt {{ install_folder }}/download/amarisoft.tar.gz.enc {{ install_folder }}/amarisoft.tar.gz
when
:
(certificate.stat.exists == True) and (new_version
.stdout != ""
)
when
:
(certificate.stat.exists == True) and (new_version
_found == True
)
-
name
:
Extract archive
-
name
:
Extract archive
unarchive
:
unarchive
:
src
:
"
{{
install_folder
}}/amarisoft.tar.gz"
src
:
"
{{
install_folder
}}/amarisoft.tar.gz"
dest
:
"
{{
install_folder
}}"
dest
:
"
{{
install_folder
}}"
when
:
(certificate.stat.exists == True) and (new_version
.stdout != ""
)
when
:
(certificate.stat.exists == True) and (new_version
_found == True
)
-
name
:
Extract lteenb archive
-
name
:
Extract lteenb archive
unarchive
:
unarchive
:
src
:
"
{{
install_folder
}}/{{
version
}}/lteenb-linux-{{
version
}}.tar.gz"
src
:
"
{{
install_folder
}}/{{
version
}}/lteenb-linux-{{
version
}}.tar.gz"
dest
:
"
{{
install_folder
}}/_{{
version
}}"
dest
:
"
{{
install_folder
}}/_{{
version
}}"
when
:
(certificate.stat.exists == True) and (new_version
.stdout != ""
)
when
:
(certificate.stat.exists == True) and (new_version
_found == True
)
-
name
:
Extract ltemme archive
-
name
:
Extract ltemme archive
unarchive
:
unarchive
:
src
:
"
{{
install_folder
}}/{{
version
}}/ltemme-linux-{{
version
}}.tar.gz"
src
:
"
{{
install_folder
}}/{{
version
}}/ltemme-linux-{{
version
}}.tar.gz"
dest
:
"
{{
install_folder
}}/_{{
version
}}"
dest
:
"
{{
install_folder
}}/_{{
version
}}"
when
:
(certificate.stat.exists == True) and (new_version
.stdout != ""
)
when
:
(certificate.stat.exists == True) and (new_version
_found == True
)
-
name
:
Extract trx_sdr archive
-
name
:
Extract trx_sdr archive
unarchive
:
unarchive
:
src
:
"
{{
install_folder
}}/{{
version
}}/trx_sdr-linux-{{
version
}}.tar.gz"
src
:
"
{{
install_folder
}}/{{
version
}}/trx_sdr-linux-{{
version
}}.tar.gz"
dest
:
"
{{
install_folder
}}/_{{
version
}}"
dest
:
"
{{
install_folder
}}/_{{
version
}}"
when
:
(certificate.stat.exists == True) and (new_version
.stdout != ""
)
when
:
(certificate.stat.exists == True) and (new_version
_found == True
)
-
name
:
Create a symbolic link for lteenb
-
name
:
Create a symbolic link for lteenb
file
:
file
:
src
:
"
lteenb-linux-{{
version
}}"
src
:
"
lteenb-linux-{{
version
}}"
dest
:
"
{{
install_folder
}}/_{{
version
}}/enb"
dest
:
"
{{
install_folder
}}/_{{
version
}}/enb"
state
:
link
state
:
link
when
:
(certificate.stat.exists == True) and (new_version
.stdout != ""
)
when
:
(certificate.stat.exists == True) and (new_version
_found == True
)
-
name
:
Create a symbolic link for ltemme
-
name
:
Create a symbolic link for ltemme
file
:
file
:
src
:
"
ltemme-linux-{{
version
}}"
src
:
"
ltemme-linux-{{
version
}}"
dest
:
"
{{
install_folder
}}/_{{
version
}}/mme"
dest
:
"
{{
install_folder
}}/_{{
version
}}/mme"
state
:
link
state
:
link
when
:
(certificate.stat.exists == True) and (new_version
.stdout != ""
)
when
:
(certificate.stat.exists == True) and (new_version
_found == True
)
-
name
:
Create a symbolic link for trx_sdr
-
name
:
Create a symbolic link for trx_sdr
file
:
file
:
src
:
"
trx_sdr-linux-{{
version
}}"
src
:
"
trx_sdr-linux-{{
version
}}"
dest
:
"
{{
install_folder
}}/_{{
version
}}/trx_sdr"
dest
:
"
{{
install_folder
}}/_{{
version
}}/trx_sdr"
state
:
link
state
:
link
when
:
(certificate.stat.exists == True) and (new_version
.stdout != ""
)
when
:
(certificate.stat.exists == True) and (new_version
_found == True
)
-
name
:
Copy trx_sdr libraries
-
name
:
Copy trx_sdr libraries
shell
:
'
cp
{{
install_folder
}}/_{{
version
}}/trx_sdr/*.so*
{{
install_folder
}}/_{{
version
}}/enb/'
shell
:
'
cp
{{
install_folder
}}/_{{
version
}}/trx_sdr/*.so*
{{
install_folder
}}/_{{
version
}}/enb/'
when
:
(certificate.stat.exists == True) and (new_version
.stdout != ""
)
when
:
(certificate.stat.exists == True) and (new_version
_found == True
)
-
name
:
Copy libraries to mme
-
name
:
Copy libraries to mme
shell
:
'
cp
{{
install_folder
}}/{{
version
}}/libs/*.so*
{{
install_folder
}}/_{{
version
}}/mme/'
shell
:
'
cp
{{
install_folder
}}/{{
version
}}/libs/*.so*
{{
install_folder
}}/_{{
version
}}/mme/'
when
:
(certificate.stat.exists == True) and (new_version
.stdout != ""
)
when
:
(certificate.stat.exists == True) and (new_version
_found == True
)
ignore_errors
:
True
ignore_errors
:
True
-
name
:
Copy libraries to mme
-
name
:
Copy libraries to mme
shell
:
'
cp
{{
install_folder
}}/{{
version
}}/libs/linux/*.so*
{{
install_folder
}}/_{{
version
}}/mme/'
shell
:
'
cp
{{
install_folder
}}/{{
version
}}/libs/linux/*.so*
{{
install_folder
}}/_{{
version
}}/mme/'
when
:
(certificate.stat.exists == True) and (new_version
.stdout != ""
)
when
:
(certificate.stat.exists == True) and (new_version
_found == True
)
ignore_errors
:
True
ignore_errors
:
True
-
name
:
Move amarisoft folder
-
name
:
Move amarisoft folder
shell
:
'
mv
{{
install_folder
}}/_{{
version
}}
{{
install_folder
}}/v{{
version
}}.{{
new_timestamp.stdout
}}'
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
_found == True
)
-
name
:
Remove extraction folder
-
name
:
Remove extraction folder
file
:
file
:
path
:
"
{{
install_folder
}}/{{
version
}}"
path
:
"
{{
install_folder
}}/{{
version
}}"
state
:
absent
state
:
absent
when
:
(certificate.stat.exists == True) and (new_version
.stdout != ""
)
when
:
(certificate.stat.exists == True) and (new_version
_found == True
)
playbook/roles/ors/files/init-sdr
View file @
afd5401a
#!/bin/bash
#!/bin/bash
OLD_AMARISOFT_PATH
=
"/opt/amarisoft/
$(
ls
-1
/opt/amarisoft |
grep
"^v2021-[0-9]
\{
2
\}
-[0-9]
\{
2
\}
$"
|
sort
|
tail
-n1
)
"
OLD_AMARISOFT_PATH
=
"/opt/amarisoft/
$(
ls
-1
/opt/amarisoft |
grep
"^v2021-[0-9]
\{
2
\}
-[0-9]
\{
2
\}
.[0-9]*
$"
|
sort
|
tail
-n1
)
"
AMARISOFT_PATH
=
"/opt/amarisoft/
$(
ls
-1
/opt/amarisoft |
grep
"^v[0-9]
\{
4
\}
-[0-9]
\{
2
\}
-[0-9]
\{
2
\}
$"
|
sort
|
tail
-n1
)
"
AMARISOFT_PATH
=
"/opt/amarisoft/
$(
ls
-1
/opt/amarisoft |
grep
"^v[0-9]
\{
4
\}
-[0-9]
\{
2
\}
-[0-9]
\{
2
\}
.[0-9]*
$"
|
sort
|
tail
-n1
)
"
export
PATH
=
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:
$PATH
"
export
PATH
=
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:
$PATH
"
$AMARISOFT_PATH
/trx_sdr/sdr_util version
&&
exit
;
$AMARISOFT_PATH
/trx_sdr/sdr_util version
&&
exit
;
...
...
playbook/sha256sum
View file @
afd5401a
923f60fc3e28c6ac4828dbbf9ac09e5e255d46f9c63619e060bf4cced6cdd45f
-
a3959abc72e7e6f50a709b7f5af6adc7a18c45dadb5fa9bab09b435689248856
-
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