Skip to content

[BUG] vhost proxy.tmpl doesn' add DocumentRoot  #382

@miquelbonastredreivip

Description

@miquelbonastredreivip

Your setup

Formula commit hash / release tag

tag v1.2.2

Versions reports (master & minion)

Using masterless setup, only salt-minion:

salt-minion --versions-report
Salt Version:
          Salt: 3005
 
Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: 2.6.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 2.10
       libgit2: 0.26.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 0.5.6
  msgpack-pure: Not Installed
  mysql-python: 1.3.10
     pycparser: Not Installed
      pycrypto: Not Installed
  pycryptodome: 3.4.7
        pygit2: 0.26.2
        Python: 3.6.9 (default, Dec  8 2021, 21:08:43)
  python-gnupg: 0.4.1
        PyYAML: 3.12
         PyZMQ: 17.1.2
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.2.5
 
System Versions:
          dist: ubuntu 18.04 Bionic Beaver
        locale: UTF-8
       machine: x86_64
       release: 4.15.0-167-generic
        system: Linux
       version: Ubuntu 18.04 Bionic Beaver

Pillar / config used

apache:
  modules:
    enabled:
      - proxy
      - proxy_http
  sites:
    00-default:
      ServerName: www.name.test
      port: 80
      enabled: true
      template_file: salt://apache/config/vhosts/proxy.tmpl
      DocumentRoot: /var/www/test

      ProxyRoute:
        00_rule:
          ProxyPassSource: '/proxy'
          ProxyPassTarget: 'http://127.0.0.1:8080/proxy'
          ProxyPassReverseSource: '/proxy'
          ProxyPassReverseTarget: 'http://127.0.0.1:8080/proxy'

Bug details

Describe the bug

When using the template vhost proxy.tmpl, the generate apache configuration
does not include any DocumentRoot.

Even if DocumentRoot is explicitly specified in the pilar config, the template ignores
the directive.

Steps to reproduce the bug

No special actions required to reproduce, just configuring a simple vhost.

Expected behaviour

The generated "sites-available/00-default.conf" file should contain
a DocumentRoot directive.

Attempts to fix the bug

As a workaround, I'm adding the DocumentRoot with Formula_Append.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions