diff --git a/README.md b/README.md index 5fbe28c..c71e28d 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,9 @@ ansible-pull \ * Launches a new LXD container called **newodoocontainer**, that uses a LXD profile to download and setup Odoo v14. -* Creates a DNS alias for **externo.agofer.net** called - **newodoocontainer.agofer.net**. +* Creates a DNS alias for **externo.agofer.net** or **externo2.agofer.net** + (see role variables in `local.yml` file), called + **.agofer.net**. * Registers this container in the existing Nginx Proxy container. * Requests an SSL certificate to _Let's Encrypt_ for the new domain, storing the certificates in the Nginx Proxy container. @@ -33,4 +34,7 @@ A container called **nginx** should exist, with these packages already installed lxc exec nginx -- apt -y install nginx certbot python3-certbot-nginx ``` -This container should listen to external connections, in order to allow **Let's Encrypt** certificates to be assigned and renewed. It's strongly suggested to protect it using **fail2ban**, Geo-IP restrictions, or other security measures. \ No newline at end of file +This container should listen to external connections, in order to allow +**Let's Encrypt** certificates to be assigned and renewed. It's strongly +suggested to protect it using **fail2ban**, Geo-IP restrictions, or +other security measures. diff --git a/local.yml b/local.yml index 51b42fd..bd7b05e 100644 --- a/local.yml +++ b/local.yml @@ -16,6 +16,7 @@ - lxchost vars: dominio: agofer.net + dnsalias: externo2 - hosts: nginx gather_facts: yes diff --git a/roles/lxchost/tasks/main.yml b/roles/lxchost/tasks/main.yml index 3a09cc1..37a9e4d 100644 --- a/roles/lxchost/tasks/main.yml +++ b/roles/lxchost/tasks/main.yml @@ -27,5 +27,5 @@ - name: Register DNS CNAME alias using Dreamhost API uri: - url: 'https://api.dreamhost.com/?key={{ apikey }}&cmd=dns-add_record&record={{ container }}.{{ dominio }}&type=CNAME&value=externo.{{ dominio }}.' + url: 'https://api.dreamhost.com/?key={{ apikey }}&cmd=dns-add_record&record={{ container }}.{{ dominio }}&type=CNAME&value={{ dnsalias }}.{{ dominio }}.'