Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit d57a0cf

Browse files
committed
create a webserver host for the machine ip
1 parent 180e444 commit d57a0cf

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

example.config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ apache_vhosts:
9797
extra_parameters: |
9898
ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/usr/share/php/pimpmylog"
9999
100+
- servername: "{{ vagrant_ip }}"
101+
documentroot: "/var/www/dashboard"
102+
100103
apache_remove_default_vhost: true
101104
apache_mods_enabled:
102105
- expires.load
@@ -125,6 +128,9 @@ nginx_hosts:
125128
root: "/usr/share/php/pimpmylog"
126129
is_php: true
127130

131+
- server_name: "{{ vagrant_ip }}"
132+
root: "/var/www/dashboard"
133+
128134
nginx_remove_default_vhost: true
129135

130136
# MySQL Databases and users. If build_makefile: is true, first database will

provisioning/tasks/dashboard.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
- name: Ensure the dashboard directory exists
2+
file:
3+
path: /var/www/dashboard
4+
state: directory
5+
mode: 0755
6+
17
- name: Copy dashboard page into place.
28
template:
39
src: ../templates/dashboard.html.j2
4-
dest: /var/www/html/index.html
5-
force: yes
10+
dest: /var/www/dashboard/index.html
611
mode: 0644

provisioning/templates/dashboard.html.j2

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
</head>
2121
<body>
2222
{% set xhprof_docroot = '/usr/share/php/xhprof_html' %}
23+
{% set dashboard_docroot = '/var/www/dashboard' %}
24+
{% set devtool_docroots = [adminer_install_dir, xhprof_docroot, pimpmylog_install_dir, dashboard_docroot] %}
2325

2426
{%- macro getServernameFromDocroot(path) -%}
2527
{%- if drupalvm_webserver == 'apache' -%}
@@ -38,7 +40,7 @@
3840
{%- endmacro -%}
3941

4042
{%- macro printSite(servername, docroot) -%}
41-
{%- if docroot not in [adminer_install_dir, xhprof_docroot, pimpmylog_install_dir] -%}
43+
{%- if docroot not in devtool_docroots -%}
4244
<tr>
4345
<td><a href="http://{{ servername }}">{{ servername }}</a></td>
4446
<td><code>{{ docroot }}</code></td>
@@ -53,7 +55,9 @@
5355
<ul class="section-host">
5456
{% if drupalvm_webserver == 'apache' -%}
5557
{%- for host in apache_vhosts -%}
56-
<li>{{ host.servername }} {{ vagrant_ip }}</li>
58+
{%- if host.documentroot != dashboard_docroot -%}
59+
<li>{{ host.servername }} {{ vagrant_ip }}</li>
60+
{%- endif -%}
5761
{% if host.serveralias is defined -%}
5862
{%- for alias in host.serveralias.split() -%}
5963
<li>{{ alias }} {{ vagrant_ip }}</li>
@@ -62,7 +66,9 @@
6266
{%- endfor -%}
6367
{%- elif drupalvm_webserver == 'nginx' -%}
6468
{%- for host in nginx_hosts -%}
65-
<li>{{ host.server_name }} {{ vagrant_ip }}</li>
69+
{%- if host.root != dashboard_docroot -%}
70+
<li>{{ host.server_name }} {{ vagrant_ip }}</li>
71+
{%- endif -%}
6672
{%- endfor -%}
6773
{%- endif %}
6874
</ul>

0 commit comments

Comments
 (0)