Added drone role
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
---
|
||||
- name: add drone http site
|
||||
template:
|
||||
src: etc/apache2/sites-available/ci_domain.conf.j2
|
||||
dest: /etc/apache2/sites-available/{{ ci_domain}}.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
- name: disable default site and enable drone site
|
||||
block:
|
||||
- name: disable default site
|
||||
command:
|
||||
cmd: a2dissite 000-default.conf
|
||||
- name: enable drone site
|
||||
command:
|
||||
cmd: a2ensite {{ ci_domain }}.conf
|
||||
- name: run certbot
|
||||
command:
|
||||
cmd: certbot --apache --non-interactive --keep-until-expiring --no-eff-mail --email {{ admin_mail }} --redirect --renew-with-new-domains --agree-tos -d {{ ci_domain }}
|
||||
when: ansible_domain != 'dev'
|
||||
- include: ssl-dev.yml
|
||||
when ansible_domain == 'dev'
|
||||
- name: add drone https site
|
||||
template:
|
||||
src: etc/apache2/sites-available/ci_domain-le-ssl.conf.j2
|
||||
dest: /etc/apache2/sites-available/{{ ci_domain }}-le-ssl.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
- name: enable drone https site
|
||||
command:
|
||||
cmd: a2ensite {{ ci_domain }}-le-ssl.conf
|
||||
notify: restart apache
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
---
|
||||
-
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
- name: Ensure python OpenSSL dependencies are installed.
|
||||
pip:
|
||||
name: pyOpenSSL
|
||||
state: present
|
||||
|
||||
- name: Ensure directory exists for local self-signed TLS certs.
|
||||
file:
|
||||
path: /etc/letsencrypt/live/{{ ci_domain }}
|
||||
state: directory
|
||||
|
||||
- name: Generate an OpenSSL private key.
|
||||
openssl_privatekey:
|
||||
path: /etc/letsencrypt/live/{{ ci_domain }}/privkey.pem
|
||||
|
||||
- name: Generate an OpenSSL CSR.
|
||||
openssl_csr:
|
||||
path: /etc/ssl/private/{{ ci_domain }}.csr
|
||||
privatekey_path: /etc/letsencrypt/live/{{ ci_domain }}/privkey.pem
|
||||
common_name: "{{ ci_domain }}"
|
||||
|
||||
- name: Generate a Self Signed OpenSSL certificate.
|
||||
openssl_certificate:
|
||||
path: /etc/letsencrypt/live/{{ ci_domain }}/fullchain.pem
|
||||
privatekey_path: /etc/letsencrypt/live/{{ ci_domain }}/privkey.pem
|
||||
csr_path: /etc/ssl/private/{{ ci_domain }}.csr
|
||||
provider: selfsigned
|
||||
Reference in New Issue
Block a user