Add ssl_certs_enabled variable and use it to avoid ssl certs when running on vagrant

This commit is contained in:
Víðir Valberg Guðmundsson 2022-11-15 23:05:52 +01:00
parent 42ebebc3f5
commit 5d0c913c2a
5 changed files with 8 additions and 9 deletions

View file

@ -1,12 +1,15 @@
---
- hosts: all
gather_facts: false
gather_facts: true
become: true
vars:
base_domain: data.coop
letsencrypt_email: admin@data.coop
ldap_dn: "dc=data,dc=coop"
vagrant: "{{ ansible_virtualization_role == 'guest' }}"
ssl_certs_enabled: "{{ vagrant == false }}"
services:
- nginx-proxy
- postfix

View file

@ -28,7 +28,7 @@
dest: "{{ mailu.volume_folder }}/certs/cert.pem"
state: hard
force: yes
when: ssl_certs_enabled
- name: hard link to Let's Encrypt TLS key
file:
@ -36,6 +36,7 @@
dest: "{{ mailu.volume_folder }}/certs/key.pem"
state: hard
force: yes
when: ssl_certs_enabled
- name: run mail server containers
docker_compose:

View file

@ -44,4 +44,5 @@
- /var/run/docker.sock:/var/run/docker.sock:ro
env:
NGINX_PROXY_CONTAINER: nginx-proxy
when: ssl_certs_enabled

View file

@ -1,11 +1,9 @@
---
- import_tasks: ssh-port.yml
tags: [change-ssh-port]
- import_tasks: virtualization.yml
tags: [gather-virtualization-facts]
- import_tasks: dell-apt-repo.yml
tags: [setup-dell-apt-repo]
when: ansible_virtualization_role != "guest"
when: vagrant == false
- import_tasks: upgrade.yml
tags: [do-full-system-upgrade]
- import_tasks: base.yml

View file

@ -1,4 +0,0 @@
---
- name: Determine if running in a VM
setup:
gather_subset: virtualization_role