Pārlūkot izejas kodu

postfixadmin certificate

master
vecāks
revīzija
c7e0fbcac6
4 mainītis faili ar 17 papildinājumiem un 25 dzēšanām
  1. +3
    -0
      defaults/main.yml
  2. +12
    -14
      tasks/main.yml
  3. +2
    -3
      templates/apache2-vhost.conf.j2
  4. +0
    -8
      templates/apache2_default_vhost.conf.j2

+ 3
- 0
defaults/main.yml Parādīt failu

@@ -1,3 +1,6 @@
postfixadmin_mysql_host: localhost
postfixadmin_mysql_database: postfixadmin
postfixadmin_mysql_username: postfixadmin
postfixadmin_server_name: "{{inventory_hostname}}"
postfixadmin_certificate_fullchain_file: /etc/ssl/certs/ssl-cert-snakeoil.pem
postfixadmin_certificate_private_key_file: /etc/ssl/private/ssl-cert-snakeoil.key

+ 12
- 14
tasks/main.yml Parādīt failu

@@ -19,7 +19,7 @@
debconf:
name: postfixadmin
question: postfixadmin/dbconfig-{{item}}
answer: false
answer: 'false'
vtype: boolean
with_items:
- install
@@ -63,24 +63,17 @@
# url: http://localhost/postfixadmin/setup.php
# dest: /var/www/html/postfixadmin-setup-report.html

- name: apache2 default vhost config
- name: apache2 vhost config
template:
src: apache2_default_vhost.conf.j2
dest: /etc/apache2/sites-available/000-default.conf
src: apache2-vhost.conf.j2
dest: /etc/apache2/sites-available/postfixadmin.conf
notify:
- apache2 reload

- name: apache2 default-ssl vhost config
template:
src: apache2_default-ssl_vhost.conf.j2
dest: /etc/apache2/sites-available/default-ssl.conf
notify:
- apache2 reload

- name: apache2 default-ssl vhost enable
- name: apache2 vhost enable
file:
src: ../sites-available/default-ssl.conf
dest: /etc/apache2/sites-enabled/default-ssl.conf
src: ../sites-available/postfixadmin.conf
dest: /etc/apache2/sites-enabled/postfixadmin.conf
state: link
notify:
- apache2 reload
@@ -92,5 +85,10 @@
notify:
- apache2 reload

- name: disable postfixadmin apache2 config
file:
path: /etc/apache2/conf-enabled/postfixadmin.conf
state: absent

- name: flush handlers
meta: flush_handlers

templates/apache2_default-ssl_vhost.conf.j2 → templates/apache2-vhost.conf.j2 Parādīt failu

@@ -8,9 +8,8 @@
CustomLog ${APACHE_LOG_DIR}/access.log combined

SSLEngine on

SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
SSLCertificateFile "{{postfixadmin_certificate_fullchain_file}}"
SSLCertificateKeyFile "{{postfixadmin_certificate_private_key_file}}"

<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars

+ 0
- 8
templates/apache2_default_vhost.conf.j2 Parādīt failu

@@ -1,8 +0,0 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost

Redirect / https://{{inventory_hostname}}/

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Notiek ielāde…
Atcelt
Saglabāt