1
0
Fork 0

Use only "inventory_hostname"

This commit is contained in:
Sven Velt 2017-11-30 12:13:09 +01:00
parent c5a8d99a77
commit 0cf850beb2
3 changed files with 5 additions and 5 deletions

View file

@ -46,7 +46,7 @@ backend nodes
option httpchk HEAD / HTTP/1.1\r\nHost:localhost option httpchk HEAD / HTTP/1.1\r\nHost:localhost
#server worker_01 172.22.244.81:80 check #server worker_01 172.22.244.81:80 check
{% for host in groups['worker'] %} {% for host in groups['worker'] %}
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_default_ipv4'].address }}:80 check server {{ hostvars[host]['inventory_hostname'] }} {{ hostvars[host]['ansible_default_ipv4'].address }}:80 check
{% endfor %} {% endfor %}
listen stats listen stats

View file

@ -1,11 +1,11 @@
<VirtualHost *:80> <VirtualHost *:80>
ServerName {{ ansible_hostname }} ServerName {{ inventory_hostname }}
DocumentRoot /var/www/worker DocumentRoot /var/www/worker
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:4001/var/www/worker/$1 ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:4001/var/www/worker/$1
DirectoryIndex index.php index.xhtml index.html DirectoryIndex index.php index.xhtml index.html
ErrorLog ${APACHE_LOG_DIR}/worker_{{ ansible_hostname }}.error.log ErrorLog ${APACHE_LOG_DIR}/worker_{{ inventory_hostname }}.error.log
CustomLog ${APACHE_LOG_DIR}/worker_{{ ansible_hostname }}.access.log combined CustomLog ${APACHE_LOG_DIR}/worker_{{ inventory_hostname }}.access.log combined
</VirtualHost> </VirtualHost>

View file

@ -1 +1 @@
<h1>{{ ansible_hostname }}</h1> <h1>{{ inventory_hostname }}</h1>