mirror of
https://github.com/lemeow125/ansible-playbooks.git
synced 2025-05-17 20:08:20 +08:00
Update playbooks
This commit is contained in:
parent
46250f9a99
commit
2150c17f24
14 changed files with 315 additions and 9 deletions
34
roles/files/debian/setup/scripts/acme_scripts/cloudflare.sh
Normal file
34
roles/files/debian/setup/scripts/acme_scripts/cloudflare.sh
Normal file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Read CF_Token and ACME_Email from .env
|
||||
source ".env"
|
||||
|
||||
/root/.acme.sh/acme.sh --upgrade --auto-upgrade
|
||||
/root/.acme.sh/acme.sh --register-account -m noehbernasol0@gmail.com
|
||||
|
||||
# Array of domains
|
||||
domains=("*.06222001.xyz" "06222001.xyz")
|
||||
legacy_domains=()
|
||||
all_domains=("${domains[@]}" "${legacy_domains[@]}")
|
||||
|
||||
# Whether to force update or not
|
||||
force_update=false
|
||||
echo "===== Force update domains: " $force_update " ====="
|
||||
|
||||
# Loop through the domains and execute the commands for each one
|
||||
for domain in "${all_domains[@]}"
|
||||
do
|
||||
|
||||
# Issue the certificate using acme.sh
|
||||
echo "====== Registering domain:" $domain " ======"
|
||||
if $force_update ; then
|
||||
/root/.acme.sh/acme.sh --force --issue --dns dns_cf --keylength 4096 -d "$domain" --server letsencrypt
|
||||
else
|
||||
/root/.acme.sh/acme.sh --issue --dns dns_cf --keylength 4096 -d "$domain" --server letsencrypt
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
echo "===== Reloading firewall ====="
|
||||
service nginx reload
|
||||
echo "===== Done ====="
|
34
roles/files/debian/setup/scripts/acme_scripts/duckdns.sh
Normal file
34
roles/files/debian/setup/scripts/acme_scripts/duckdns.sh
Normal file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Read DuckDNS_Token and ACME_Email from .env
|
||||
source ".env"
|
||||
|
||||
/root/.acme.sh/acme.sh --upgrade --auto-upgrade
|
||||
/root/.acme.sh/acme.sh --register-account -m noehbernasol0@gmail.com
|
||||
|
||||
# Array of main domains
|
||||
domains=("*.keannu1.duckdns.org" "keannu1.duckdns.org")
|
||||
legacy_domains=()
|
||||
all_domains=("${domains[@]}" "${legacy_domains[@]}")
|
||||
|
||||
# Whether to force update or not
|
||||
force_update=false
|
||||
echo "===== Force update domains: " $force_update " ====="
|
||||
|
||||
# Loop through the domains and execute the commands for each one
|
||||
for domain in "${all_domains[@]}"
|
||||
do
|
||||
|
||||
# Issue the certificate using acme.sh
|
||||
echo "====== Registering domain:" $domain " ======"
|
||||
if $force_update ; then
|
||||
/root/.acme.sh/acme.sh --insecure --force --issue --dns dns_duckdns -d "$domain"
|
||||
else
|
||||
/root/.acme.sh/acme.sh --insecure --issue --dns dns_duckdns -d "$domain"
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
echo "===== Reloading firewall ====="
|
||||
service nginx reload
|
||||
echo "===== Done ====="
|
Loading…
Add table
Add a link
Reference in a new issue