Skip to content

[BUG] Environment variable setting doesnt work #59

Closed

Description

@B1ue-W01f

Your setup

Running on debian.

Formula commit hash / release tag

n/a

Versions reports (master & minion)

n/a

Pillar / config used

prometheus:
  wanted:
    component:
      - node_exporter
  pkg:
    component:
      node_exporter:
        name: prometheus-node-exporter
        environ:
          args:
            collector.systemd: true
            collector.filesystem.ignored-mount-points: '^/(var|media|dev|run)($|/)'

Bug details

Describe the bug

The macro within the files directory does not export the correct function to allow the environ state to operate when an environ arg is set. See:

https://github.com/saltstack-formulas/prometheus-formula/blob/fa96aabba76128ebca85b76631bf04ec8daaeb90/prometheus/config/environ.sls

Expecting to import 'concat_environ' which does not exist in the referenced file.

Steps to reproduce the bug

Run a highstate with the above pillar

Expected behaviour

Environ arguments should be set

Activity

  1. myii commented on Jun 24, 2021

    @myii
    Contributor

    Reproduced locally using Kitchen with the pillar modified as above for default-debian-10-master-py3:

           local:
               Data failed to compile:
           ----------
               Rendering SLS 'base:prometheus.config.environ' failed: Jinja variable the template 'prometheus/files/macros.jinja' (imported on line 7) does not export the requested
     name 'concat_environ'
    >>>>>> ------Exception-------
    >>>>>> Class: Kitchen::ActionFailed
    >>>>>> Message: 1 actions failed.
    >>>>>>     Converge failed on instance <default-debian-10-master-py3>.  Please see .kitchen/logs/default-debian-10-master-py3.log for more details
    >>>>>> ----------------------
    >>>>>> Please see .kitchen/logs/kitchen.log for more details
    >>>>>> Also try running `kitchen diagnose --all` for configuration
  2. myii commented on Jun 24, 2021

    @myii
    Contributor

    From our discussions in the #formulas channel on Slack, we're pretty sure that concat_environ needs to be changed to concat_args in all places.

  3. saltstack-formulas-travis commented on Jul 9, 2021

    @saltstack-formulas-travis

    🎉 This issue has been resolved in version 5.5.1 🎉

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions