fix bugs&add roles
This commit is contained in:
parent
9b72646537
commit
1dabbe0f6f
@ -25,7 +25,7 @@ siteB:
|
|||||||
site_ip: "192.168.0.62"
|
site_ip: "192.168.0.62"
|
||||||
|
|
||||||
proxy:
|
proxy:
|
||||||
proxy_domain: "proxy.example.com"
|
proxy_domain: "siteproxy.vlad"
|
||||||
proxy_ip: "192.168.0.63"
|
proxy_ip: "192.168.0.63"
|
||||||
|
|
||||||
siteA_h2: "Новое сообщение для SiteA"
|
siteA_h2: "Новое сообщение для SiteA"
|
||||||
|
@ -1,22 +1,27 @@
|
|||||||
- name: Install OpenSSL
|
- name: Install OpenSSL
|
||||||
zypper:
|
zypper:
|
||||||
name: openssl
|
name: openssl
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Create SSL directory
|
- name: Create SSL directory
|
||||||
file:
|
file:
|
||||||
path: "{{ ssl_cert_path }}"
|
path: "{{ ssl_cert_path }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: Generate Self-Signed SSL Certificate
|
- name: Generate private key
|
||||||
command: >
|
community.crypto.openssl_privatekey:
|
||||||
openssl req -x509 -nodes -days 365
|
path: "{{ ssl_cert_path }}/{{ ssl_key_file }}"
|
||||||
-newkey rsa:2048
|
size: 2048
|
||||||
-keyout {{ ssl_cert_path }}/{{ ssl_key_file }}
|
type: RSA
|
||||||
-out {{ ssl_cert_path }}/{{ ssl_cert_file }}
|
mode: '0600'
|
||||||
-subj "{{ ssl_subject }}"
|
|
||||||
args:
|
- name: Generate Self-Signed SSL Certificate
|
||||||
creates: "{{ ssl_cert_path }}/{{ ssl_cert_file }}"
|
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_path: "/etc/nginx/ssl"
|
||||||
ssl_cert_file: "proxy.crt"
|
ssl_cert_file: "proxy.crt"
|
||||||
ssl_key_file: "proxy.key"
|
ssl_key_file: "proxy.key"
|
||||||
ssl_subject: "/C=RU/ST=Some-State/L=Some-City/O=Your Company/CN={{ proxy.proxy_domain }}"
|
ssl_subject: "/C=RU/ST=Some-State/L=Some-City/O=Your Company/CN={{ proxy.proxy_domain }}"
|
20
ansible/roles/ssl_certificate_cmd/tasks/main.yml
Normal file
20
ansible/roles/ssl_certificate_cmd/tasks/main.yml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
- 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 }}"
|
4
ansible/roles/ssl_certificate_cmd/vars/main.yml
Normal file
4
ansible/roles/ssl_certificate_cmd/vars/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
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 }}"
|
Loading…
Reference in New Issue
Block a user