Add ssl_certs_enabled variable and use it to avoid ssl certs when running on vagrant
This commit is contained in:
parent
42ebebc3f5
commit
5d0c913c2a
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -44,4 +44,5 @@
|
|||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
env:
|
||||
NGINX_PROXY_CONTAINER: nginx-proxy
|
||||
when: ssl_certs_enabled
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
---
|
||||
- name: Determine if running in a VM
|
||||
setup:
|
||||
gather_subset: virtualization_role
|
Loading…
Reference in a new issue