1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
domains=(
  linkpeek.com
  dev.linkpeek.com
  remarkbox.com
  demo.remarkbox.com
  faq.remarkbox.com
  meta.remarkbox.com
  my.remarkbox.com
  ovis.remarkbox.com
  westworld2.com
)

# regen certificates.
letsencrypt certonly --webroot -w /www -d remarkbox.com -d www.remarkbox.com
letsencrypt certonly --webroot -w /www -d linkpeek.com -d www.linkpeek.com
letsencrypt certonly --webroot -w /www -d dev.linkpeek.com 
letsencrypt certonly --webroot -w /www -d faq.remarkbox.com
letsencrypt certonly --webroot -w /www -d meta.remarkbox.com
letsencrypt certonly --webroot -w /www -d my.remarkbox.com
letsencrypt certonly --webroot -w /www -d demo.remarkbox.com
letsencrypt certonly --webroot -w /www -d ovis.remarkbox.com
letsencrypt certonly --webroot -w /www -d westworld2.com

# copy certificate links to a known file.
for domain in ${domains[*]}; do
    echo "$domain"
    cp /etc/letsencrypt/live/$domain/fullchain.pem /etc/letsencrypt/live/$domain/crt.crt
    cp /etc/letsencrypt/live/$domain/privkey.pem /etc/letsencrypt/live/$domain/key.key
done

# use minionfs to stage all certificates onto the salt master.
salt-call cp.push_dir "/etc/letsencrypt/live/" glob='*.crt'
salt-call cp.push_dir "/etc/letsencrypt/live/" glob='*.key'