Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] apache.config.vhosts.standard: mapping error when "enabled: false" #302

Closed
genaumann opened this issue Apr 30, 2021 · 3 comments · Fixed by #303
Closed

[BUG] apache.config.vhosts.standard: mapping error when "enabled: false" #302

genaumann opened this issue Apr 30, 2021 · 3 comments · Fixed by #303

Comments

@genaumann
Copy link
Contributor

genaumann commented Apr 30, 2021

Your setup

Formula commit hash / release tag

Current commit hash: 3c21740ba52fa5c2b5cf39cddce6a42d13d17988

Versions reports (master & minion)

Salt Version:
          Salt: 3003
 
Dependency Versions:
          cffi: 1.14.2
      cherrypy: unknown
      dateutil: 2.7.3
     docker-py: Not Installed
         gitdb: 2.0.5
     gitpython: 2.1.11
        Jinja2: 2.10
       libgit2: 0.27.7
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 0.5.6
  msgpack-pure: Not Installed
  mysql-python: 1.3.10
     pycparser: 2.20
      pycrypto: 2.6.1
  pycryptodome: 3.6.1
        pygit2: 0.27.4
        Python: 3.7.3 (default, Jan 22 2021, 20:04:44)
  python-gnupg: Not Installed
        PyYAML: 3.13
         PyZMQ: 17.1.2
         smmap: 2.0.5
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.1
 
System Versions:
          dist: debian 10 buster
        locale: UTF-8
       machine: x86_64
       release: 4.19.0-16-amd64
        system: Linux
       version: Debian GNU/Linux 10 buster

Pillar / config used

apache:
  sites:
    test.example.com-80:
      ServerName: test.example.com
      enabled: false
      template_file: salt://apache/vhosts/redirect.tmpl
      port: '80'
      interface: '*'
      RedirectMatch: true
      RedirectSource: '/'
      RedirectTarget: 'https://test.example.com'
      ErrorLog: ${APACHE_LOG_DIR}/error.log
      CustomLog: ${APACHE_LOG_DIR}/access.log
      DocumentRoot: false


Bug details

Describe the bug

When a site configuration is to be deactivated (enabled: false), the state apache.config.vhosts.standard throws the following error:
failed: mapping values are not allowed in this context

When I change the value to enabled: true , the state will run without any errors.

Log at salt-master:

pillar.get: Default () is of type 'str', must be a dict or list to merge. Merge will be skipped.

@genaumann genaumann added the bug label Apr 30, 2021
@myii
Copy link
Member

myii commented Apr 30, 2021

@genaumann Thanks for this report. Bug confirmed locally using Kitchen. Tracked it down to this line:

- name: a2dissite {{ id }}{{ apache.confext }}:

Please remove the trailing colon which shouldn't be there. That's working at my end. I'll push through a PR in the meantime.

@myii
Copy link
Member

myii commented Apr 30, 2021

@genaumann Fix proposed in #303, please confirm there and we'll get that merged.

@myii myii closed this as completed in #303 Apr 30, 2021
saltstack-formulas-travis pushed a commit that referenced this issue Apr 30, 2021
## [1.1.3](v1.1.2...v1.1.3) (2021-04-30)

### Bug Fixes

* **config/vhosts/standard:** remove erroneous trailing colon ([dedb9e2](dedb9e2)), closes [#302](#302)

### Continuous Integration

* **kitchen+gitlab:** adjust matrix to add `3003` [skip ci] ([3c21740](3c21740))
* **vagrant:** add FreeBSD 13.0 [skip ci] ([298fdf4](298fdf4))
* **vagrant:** use pre-salted boxes & conditional local settings [skip ci] ([f354ace](f354ace))
@saltstack-formulas-travis

🎉 This issue has been resolved in version 1.1.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants