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

Existing salt.formulas configurations broken by recent pull request #201

Closed
xenophonf opened this issue Feb 16, 2016 · 1 comment
Closed

Comments

@xenophonf
Copy link
Contributor

Pull request #200 changed how this formula manage formulas on Salt masters in a backwards-incompatible way. This causes the salt.formulas SLS to fail on masters that use the old-style format of the salt_formulas:list Pillar key, which mapped environments to lists of formulas to be cloned, with errors similar to the following:

local:
    Data failed to compile:
----------
    Rendering SLS 'development:salt.formulas' failed: Jinja variable 'list object' has no attribute 'items'

I like the idea of overriding the baseurl parameter on a per-formula basis (previously, it could only be overridden on a per-environment basis). I would propose that this formula adopt a gitfs_remotes-style override mechanism. For example:

salt_formulas:
  git_opts:
    default:
      baseurl: https://github.com/saltstack-formulas
  list:
    base:
      - openssh-formula
      - salt-formula
      - users-formula
    dev:
      - openssh-formula:
          baseurl: git@github.com:irtnog
      - salt-formula:
          baseurl: git@github.com:irtnog
      - users-formula:
          baseurl: git@github.com:irtnog

This would preserve backwards compatibility while still affording end users the ability to override the formula's base URL on a case-by-case basis. In the meantime I think that #200 should be reverted---and the original behavior of the salt.formulas SLS restored.

@GMAzrael
Copy link

Gents,

I am seeing the following when the file is rendering:


/srv/formulas/{'salt-formula-jenkins': {'baseurl': 'https://github.com/salt-formulas'}}:
  git.latest:
    - name: https://github.com/saltstack-formulas/{'salt-formula-jenkins': {'baseurl': 'https://github.com/salt-formulas'}}.git
    - target: /srv/formulas/{'salt-formula-jenkins': {'baseurl': 'https://github.com/salt-formulas'}}
    - require:
      - file: /srv/formulas
    - unless: test -e /srv/formulas/{'salt-formula-jenkins': {'baseurl': 'https://github.com/salt-formulas'}}

Are the loops processing the overrides properly instead of passing the entire dictionary?

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

No branches or pull requests

3 participants