Browse Source

Add fullchain template

python3
Andrea Cimbalo 7 years ago
parent
commit
b0c90d61ba
6 changed files with 81 additions and 46 deletions
  1. +34
    -0
      files/lilik_ca_v1.pub
  2. +32
    -0
      files/lilik_ca_x1.pub
  3. +0
    -33
      files/test_vpn_ca.crt
  4. +10
    -12
      roles/openvpn/tasks/main.yaml
  5. +1
    -1
      roles/openvpn/templates/openvpn.j2
  6. +4
    -0
      templates/fullchain.j2

+ 34
- 0
files/lilik_ca_v1.pub View File

@ -0,0 +1,34 @@
-----BEGIN CERTIFICATE-----
MIIF1zCCA7+gAwIBAgIJAKFj/QEDXD7LMA0GCSqGSIb3DQEBCwUAMF0xCzAJBgNV
BAYTAklUMRAwDgYDVQQIDAdUdXNjYW55MREwDwYDVQQHDAhGbG9yZW5jZTEOMAwG
A1UECgwFTElMaUsxGTAXBgNVBAMMEExJTGlLIFJvb3QgQ0EgWDEwHhcNMTgwMzMw
MTc0MTEzWhcNMjMwMzI5MTc0MTEzWjBcMQswCQYDVQQGEwJJVDEQMA4GA1UECAwH
VHVzY2FueTERMA8GA1UEBwwIRmxvcmVuY2UxDjAMBgNVBAoMBUxJTGlLMRgwFgYD
VQQDDA9MSUxpSyBTU0wgQ0EgVjEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK
AoICAQDcPVOj0z1tJSi743YlUq16NWV3pnDv5WUdRO+GDvSRo0ewIAkNwLSBCJYK
z2kOtsfm5ajHWlti3SJJwf4UBVwuQFSZoQ7pbUl86MhE49TvLBujeCddRl7aC2N6
VpnESeJV0c3Et5dCXhLxRhru6C4UJhmohWCaYDE/1iCRjc+Of+D8m2Sv+pZ044ng
kt2UlLIuV+KldfuNjcdnOVcvIbAOHu3cq36k0qk0FwXE+nDAYJFoeYqlo3hnpgd1
KqSPzzlofabUwwlnx8W5tibF2dkNqJwd/eukO2JMsh7A9wksU2eOq4+dd66xJJnt
d3LTxUTI9Eqr2n/q5vAlTw92R0UJbUSLWyqpMRpVzLDedQJWmiZ2z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qsxkvVqPBX7wr7fGUoibwZigA64w2gY4tjewocTJZrlZupqe
hct4a/A/vRJqCQqTGSjJdbmwau0wv8N45bgQq3R2y5ERqu5/pc1n+yVrWV7KZeOb
bXja/U2PzzYS9CdLAgMBAAGjUDBOMB0GA1UdDgQWBBR59Xeu/85H4hAhxF6bjnHs
RBw8gzAfBgNVHSMEGDAWgBR59Xeu/85H4hAhxF6bjnHsRBw8gzAMBgNVHRMEBTAD
AQH/MA0GCSqGSIb3DQEBCwUAA4ICAQA2z+RrzF5WRwAHAECP7cOLZr1Py7qZjMeh
pAMxP4YUYKKPjvsEIdR9ZXDCVBt6BaiVRoUJfdhq+6idb7/sYgv3QL3wfXonMpFY
eB9mpDcV2i7ei+VhJVUTAs+F4HBZgXvu3pdy2WRyNheMCl4NqWJj6MVLR+xRjaJ4
G/0HxnI1/rJs3GA2baXwFFgDOa8wV8iC23yDz0mlFqjpkh3u5LAYR3Le9xL7MOdd
G+v2whzX8DDjQskkUlvt6BqSH9OGWC3yYqSG/LDFu3HkdyCyUyBlsfh9LvAu3jvA
GCcS7F86GaE/wroPpM34U99lI96ieTN2WC1LteLxa73TLV02JiZAVbqCRSzmf1Ti
dDelWXTZ95dyMnytB2iECwSYrHeANfnkBh45rjvWeNPMaFOPuYbfJaag/88IJbTF
NbDlHWbXY5TJzF9E0usNABdZ00TJWqJSGIJpnKO8iTK7wKrWS7CvRhR8GEDYRFRt
FT1T2q/0cufBF1flTndz5g0mkoJxlV/pOCh7eKGLZYFjXSbs8pS8gWjkqmAlT5q6
6e/Ov0gITxSYiNeLRKtBii0U7IRaVDcGS1DzF7Kve4VMKooXQyaQ0BbhpcTpxSKc
ACnFg6fDKmdXpOM75BMAOf+j08UolT/FhAuQ+YmOeAezcMejmQX+qUb+hEh35B+0
0F7Syw/qWg==
-----END CERTIFICATE-----

+ 10
- 12
roles/openvpn/tasks/main.yaml View File

@ -86,18 +86,16 @@
register: set_pub_key
when: not openvpn_cert_key.stat.exists
- name: copy vpn ca public key
copy:
src: lilik_ca_x1.pem
dest: /etc/openvpn/lilik_ca_x1.pem
- name: copy vpn ca public key
copy:
src: lilik_ca_v1.pem
dest: /etc/openvpn/lilik_ca_v1.pem
- name: create fullchain
command: "cat /etc/openvpn/lilik_ca_x1.pem /etc/openvpn/lilik_ca_v1.pem > /etc/openvpn/ca.crt"
- set_fact:
certificates:
- files/lilik_ca_x1.pub
- files/lilik_ca_v1.pub
- name: create vpn fullchain
template:
src: fullchain.j2
dest: /etc/openvpn/fullchain.crt
notify: reload openvpn
- name: write openvpn configuration
template:


+ 1
- 1
roles/openvpn/templates/openvpn.j2 View File

@ -6,7 +6,7 @@ config openvpn 'vpn'
option dev 'tun'
option server '10.8.0.0 255.255.255.0'
option keepalive '10 120'
option ca '/etc/openvpn/ca.crt'
option ca '/etc/openvpn/fullchain.crt'
option cert '/etc/openvpn/openvpn.cert'
option key '/etc/openvpn/openvpn.key'
option dh '/etc/openvpn/dh2048.pem'


+ 4
- 0
templates/fullchain.j2 View File

@ -0,0 +1,4 @@
{% for certificate in certificates %}
{% include certificate %}
{% endfor %}

Loading…
Cancel
Save