I need to create a cronjob for renewal lets encrypt certificates. The final command should looks like this:
certbot certonly --no-eff-email -m my@mail.com --redirect --agree-tos --non-interactive --standalone -d mydomain.com -d www.mydomain.com -d domain1.mydomain.com -d domain1a.mydomain.com -d domain2.mydomain.com -d domain2a.mydomain.com
I have the following variables:
nginx:
vhost:
- name: mydomain.com
server_name:
- mydomain.com
- www.mydomain.com
...
...
- name: domain1.mydomain.com
server_name:
- domain1.mydomain.com
- domain1a.mydomain.com
...
...
- name: domain2.mydomain.com
server_name:
- domain2.mydomain.com
- domain2a.mydomain.com
...
...
...
How can I get this values from nginx.vhost.server_name of each vhost in one command?