summaryrefslogtreecommitdiffstats
path: root/xci/playbooks/manage-ssl-certs.yml
blob: d0c5c51818398999c4153af7c8662591c8439639 (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
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2018 SUSE Linux GmbH and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
- name: Install required pip packages for SSL
  pip:
    name: pyOpenSSL
    state: present
    extra_args: "{{ extra_args | default(omit) }}"

- name: Generate XCI private key
  openssl_privatekey:
    path: /etc/ssl/private/xci.key
    size: 2048

- name: Generate XCI certificate request
  openssl_csr:
    privatekey_path: /etc/ssl/private/xci.key
    path: /etc/ssl/private/xci.csr
    common_name: "{{ xci_ssl_subject }}"

- name: Generate XCI self signed certificate
  openssl_certificate:
    path: /etc/ssl/certs/xci.crt
    privatekey_path: /etc/ssl/private/xci.key
    csr_path: /etc/ssl/private/xci.csr
    provider: selfsigned
    selfsigned_not_after: 20800101000000Z