fix bugs&add roles
This commit is contained in:
@ -1,22 +1,27 @@
|
||||
- name: Install OpenSSL
|
||||
zypper:
|
||||
name: openssl
|
||||
state: present
|
||||
|
||||
- name: Create SSL directory
|
||||
file:
|
||||
path: "{{ ssl_cert_path }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0755'
|
||||
|
||||
- name: Generate Self-Signed SSL Certificate
|
||||
command: >
|
||||
openssl req -x509 -nodes -days 365
|
||||
-newkey rsa:2048
|
||||
-keyout {{ ssl_cert_path }}/{{ ssl_key_file }}
|
||||
-out {{ ssl_cert_path }}/{{ ssl_cert_file }}
|
||||
-subj "{{ ssl_subject }}"
|
||||
args:
|
||||
creates: "{{ ssl_cert_path }}/{{ ssl_cert_file }}"
|
||||
- name: Install OpenSSL
|
||||
zypper:
|
||||
name: openssl
|
||||
state: present
|
||||
|
||||
- name: Create SSL directory
|
||||
file:
|
||||
path: "{{ ssl_cert_path }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0755'
|
||||
|
||||
- name: Generate private key
|
||||
community.crypto.openssl_privatekey:
|
||||
path: "{{ ssl_cert_path }}/{{ ssl_key_file }}"
|
||||
size: 2048
|
||||
type: RSA
|
||||
mode: '0600'
|
||||
|
||||
- name: Generate Self-Signed SSL Certificate
|
||||
community.crypto.x509_certificate:
|
||||
path: "{{ ssl_cert_path }}/{{ ssl_cert_file }}"
|
||||
privatekey_path: "{{ ssl_cert_path }}/{{ ssl_key_file }}"
|
||||
subject: "{{ ssl_subject }}"
|
||||
provider: "openssl"
|
||||
days: 365
|
@ -1,4 +1,4 @@
|
||||
ssl_cert_path: "/etc/nginx/ssl"
|
||||
ssl_cert_file: "proxy.crt"
|
||||
ssl_key_file: "proxy.key"
|
||||
ssl_cert_path: "/etc/nginx/ssl"
|
||||
ssl_cert_file: "proxy.crt"
|
||||
ssl_key_file: "proxy.key"
|
||||
ssl_subject: "/C=RU/ST=Some-State/L=Some-City/O=Your Company/CN={{ proxy.proxy_domain }}"
|
Reference in New Issue
Block a user