Merge branch 'master' of github.com:tconstans/ansible_apache_vhost

This commit is contained in:
2021-09-23 23:25:50 +02:00
4 changed files with 33 additions and 0 deletions

26
tasks/dns.yml Normal file
View File

@@ -0,0 +1,26 @@
---
- name: setup dns names
block:
- name: create ovh DNS A record
ovh_dns:
domain: opendoor.fr
name: "{{ apache_server_name }}"
type: A
value: "{{ apache_server_ip }}"
- name: create ovh DNS CNAME
ovh_dns:
domain: opendoor.fr
name: "{{ item }}"
type: CNAME
value: "{{ apache_server_name }}"
loop:
"{{ apache_server_alias }}"
when: apache_server_alias is defined
delegate_to: localhost
become: false
environment:
OVH_ENDPOINT: ovh-eu
OVH_APPLICATION_KEY: "{{ lookup( 'keepass', 'opendoor/ovh_application_key', 'password' ) }}"
OVH_APPLICATION_SECRET: "{{ lookup( 'keepass', 'opendoor/ovh_application_secret', 'password' ) }}"
OVH_CONSUMER_KEY: "{{ lookup( 'keepass', 'opendoor/ovh_consumer_key', 'password' ) }}"

View File

@@ -44,6 +44,10 @@
- "{{ apache_base_dir }}/session"
- "{{ apache_base_dir }}/wsdlcache"
- name: dns setup
include_tasks: dns.yml
when: apache_use_dns is defined
- name: generate cert
import_tasks: certbot.yml
when: apache_use_certbot