浏览代码

Use common domain variable instead of blog_domain

Luke Cyca 11 年前
父节点
当前提交
93e7b3e3bd

+ 3
- 3
roles/blog/tasks/blog.yml 查看文件

@@ -1,11 +1,11 @@
1 1
 - name: Create directory for blog HTML
2
-  file: state=directory path=/var/www/${blog_domain} group=www-data owner=www-data
2
+  file: state=directory path=/var/www/${domain} group=www-data owner=www-data
3 3
 
4 4
 - name: Configure the Apache HTTP server for the blog
5
-  template: src=etc_apache2_sites-available_blog.j2 dest=/etc/apache2/sites-available/${blog_domain} group=www-data owner=www-data
5
+  template: src=etc_apache2_sites-available_blog.j2 dest=/etc/apache2/sites-available/${domain} group=www-data owner=www-data
6 6
   notify: restart apache
7 7
 
8 8
 - name: Enable blog site
9
-  command: a2ensite ${blog_domain} creates=/etc/apache2/sites-enabled/${blog_domain}
9
+  command: a2ensite ${domain} creates=/etc/apache2/sites-enabled/${domain}
10 10
   notify: restart apache
11 11
 

+ 6
- 6
roles/blog/templates/etc_apache2_sites-available_blog.j2 查看文件

@@ -1,14 +1,14 @@
1 1
 <VirtualHost *:80>
2
-    ServerName {{ blog_domain }}
3
-    ServerAlias www.{{ blog_domain }}
2
+    ServerName {{ domain }}
3
+    ServerAlias www.{{ domain }}
4 4
 
5
-    Redirect / https://{{ blog_domain }}/
5
+    Redirect / https://{{ domain }}/
6 6
 </VirtualHost>
7 7
 
8 8
 
9 9
 <VirtualHost *:443>
10
-    ServerName {{ blog_domain }}
11
-    ServerAlias www.{{ blog_domain }}
10
+    ServerName {{ domain }}
11
+    ServerAlias www.{{ domain }}
12 12
 
13 13
     SSLEngine on
14 14
     SSLProtocol ALL -SSLv2
@@ -19,7 +19,7 @@
19 19
     SSLCertificateKeyFile   /etc/ssl/private/wildcard_private.key
20 20
     SSLCACertificateFile    /etc/ssl/certs/wildcard_ca.pem
21 21
 
22
-    DocumentRoot            "/var/www/{{ blog_domain }}"
22
+    DocumentRoot            "/var/www/{{ domain }}"
23 23
     DirectoryIndex          index.html
24 24
     Options                 -Indexes
25 25
 

+ 1
- 1
roles/mailserver/files/etc_dovecot_conf.d_20-imap.conf 查看文件

@@ -60,5 +60,5 @@ protocol imap {
60 60
 protocol lmtp {
61 61
   # Space separated list of plugins to load (default is global mail_plugins).
62 62
   mail_plugins = $mail_plugins sieve
63
-  postmaster_address = postmaster@TODO.com
63
+  postmaster_address = postmaster@{{domain}}
64 64
 }

+ 1
- 1
roles/mailserver/templates/etc_dovecot_conf.d_15-lda.conf.j2 查看文件

@@ -4,7 +4,7 @@
4 4
 
5 5
 # Address to use when sending rejection mails.
6 6
 # Default is postmaster@<your domain>.
7
-postmaster_address = postmaster@TODO.com
7
+postmaster_address = postmaster@{{domain}}
8 8
 
9 9
 # Hostname to use in various parts of sent mails, eg. in Message-Id.
10 10
 # Default is the system's real hostname.

+ 1
- 3
vars/defaults.yml 查看文件

@@ -4,10 +4,8 @@
4 4
 # reference of all the variables.
5 5
 ###############################################################################
6 6
 
7
-# # blog
8
-# blog_domain: TODO.com
9
-
10 7
 # # common
8
+# domain: TODO.com
11 9
 # main_user_name: TODO
12 10
 # admin_email: TODO@TODO.com
13 11
 # encfs_password: TODO

+ 1
- 3
vars/user.yml 查看文件

@@ -3,11 +3,9 @@
3 3
 # Uncomment and set your variables here. For a complete reference look at the
4 4
 # `vars/defaults.yml` file.
5 5
 ###############################################################################
6
-#
7
-# # blog
8
-# blog_domain: TODO.com
9 6
 
10 7
 # # common
8
+# domain: TODO.com
11 9
 # main_user_name: TODO
12 10
 # admin_email: TODO@TODO.com
13 11
 # encfs_password: TODO

正在加载...
取消
保存