|
|
---
|
|
|
|
|
|
- name: Set-up fixtures
|
|
|
hosts: localhost
|
|
|
connection: local
|
|
|
gather_facts: false
|
|
|
tasks:
|
|
|
|
|
|
- name: Initialise CA hierarchy
|
|
|
command: "gimmecert init"
|
|
|
args:
|
|
|
creates: "tests/data/.gimmecert/ca/level1.cert.pem"
|
|
|
chdir: "tests/data/"
|
|
|
|
|
|
- name: Generate server private keys and certificates
|
|
|
command:
|
|
|
args:
|
|
|
chdir: "tests/data/"
|
|
|
creates: "tests/data/.gimmecert/server/{{ item.name }}.cert.pem"
|
|
|
argv:
|
|
|
- "gimmecert"
|
|
|
- "server"
|
|
|
- "{{ item.name }}"
|
|
|
- "{{ item.fqdn }}"
|
|
|
with_items:
|
|
|
- name: mail-server_smtp
|
|
|
fqdn: mail-server
|
|
|
|
|
|
- name: Set-up link to generated X.509 material
|
|
|
file:
|
|
|
src: ".gimmecert"
|
|
|
dest: "tests/data/x509"
|
|
|
state: link
|
|
|
|
|
|
- name: Prepare
|
|
|
hosts: all
|
|
|
gather_facts: false
|
|
@@ -59,7 +91,7 @@
|
|
|
|
|
|
- name: Deploy CA certificate
|
|
|
copy:
|
|
|
src: tests/data/x509/ca.cert.pem
|
|
|
src: tests/data/x509/ca/level1.cert.pem
|
|
|
dest: /usr/local/share/ca-certificates/testca.crt
|
|
|
owner: root
|
|
|
group: root
|
|
@@ -78,7 +110,7 @@
|
|
|
|
|
|
- name: Deploy CA certificate
|
|
|
copy:
|
|
|
src: tests/data/x509/ca.cert.pem
|
|
|
src: tests/data/x509/ca/level1.cert.pem
|
|
|
dest: /usr/local/share/ca-certificates/testca.crt
|
|
|
owner: root
|
|
|
group: root
|
|
@@ -88,7 +120,7 @@
|
|
|
|
|
|
- name: Deploy SMTP private key and certificate
|
|
|
copy:
|
|
|
src: "tests/data/x509/{{ item }}"
|
|
|
src: "tests/data/x509/server/{{ item }}"
|
|
|
dest: "/etc/ssl/{{ item }}"
|
|
|
owner: root
|
|
|
group: root
|