Add lego certificate service to ansible
This commit is contained in:
parent
5246a6b101
commit
068a8e2cd7
13 changed files with 212 additions and 0 deletions
roles/lego/files/node002
16
roles/lego/files/node002/db.serguzim.me
Executable file
16
roles/lego/files/node002/db.serguzim.me
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
domain="db.serguzim.me"
|
||||
|
||||
docker compose run --rm app "$1" "$domain"
|
||||
|
||||
_install() {
|
||||
install --owner=postgres --group=postgres --mode=600 \
|
||||
"/opt/services/_certificates/$domain.$1" \
|
||||
"/var/lib/postgresql/server.$1"
|
||||
}
|
||||
|
||||
_install crt
|
||||
_install key
|
||||
|
||||
sudo -u postgres pg_ctl -D /var/lib/postgres/data/ reload
|
17
roles/lego/files/node002/registry.serguzim.me
Executable file
17
roles/lego/files/node002/registry.serguzim.me
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
domain="registry.serguzim.me"
|
||||
|
||||
docker compose run --rm app "$1" "$domain"
|
||||
|
||||
_install() {
|
||||
install --owner=root --group=root --mode=600 \
|
||||
"/opt/services/_certificates/$domain.$1" \
|
||||
"/opt/services/harbor/server.$1"
|
||||
}
|
||||
|
||||
_install crt
|
||||
_install key
|
||||
|
||||
export HARBOR_BUNDLE_DIR=/opt/services/harbor
|
||||
$HARBOR_BUNDLE_DIR/data/install.sh
|
Reference in a new issue