summaryrefslogtreecommitdiffstats
path: root/roles/httpd/certificate/tasks/main.yml
blob: afae3243eb3b482bdbf308851897ac606f848360 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Expected vars
# - name...
# - SSLCertificateChainFile:
# - cert:
# - key:

- name: Copy over SSLCertificateChainFile if defined
  copy: >
    src={{private}}/files/httpd/{{SSLCertificateChainFile}}
    dest=/etc/pki/tls/certs/{{SSLCertificateChainFile}}
    owner=root
    group=root
    mode=0644
  when: SSLCertificateChainFile is defined
  notify:
  - reload proxyhttpd
  tags:
  - httpd
  - httpd/certificate

- name: Copy {{name}}.cert
  copy: >
    src={{item}}
    dest=/etc/pki/tls/certs/{{item | basename}}
    owner=root
    group=root
    mode=0644
  with_first_found:
  - "{{private}}/files/httpd/{{cert}}.cert"
  - "{{private}}/files/httpd/{{name}}.cert"
  notify:
  - reload proxyhttpd
  tags:
  - httpd
  - httpd/certificate

- name: Copy {{name}}.key
  copy: >
    src={{item}}
    dest=/etc/pki/tls/private/{{item | basename}}
    owner=root
    group=root
    mode=0600
  with_first_found:
  - "{{private}}/files/httpd/{{key}}.key"
  - "{{private}}/files/httpd/{{name}}.key"
  notify:
  - reload proxyhttpd
  tags:
  - httpd
  - httpd/certificate