Vagrant-based testing environment #111

Merged
valberg merged 15 commits from vagrant into main 2022-11-25 13:07:10 +00:00
5 changed files with 8 additions and 9 deletions
Showing only changes of commit 253a21432e - Show all commits

View file

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

View file

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

View file

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

View file

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

View file

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