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

feat(context): pass nginx to snippets and server_config contexts #271

Merged
merged 1 commit into from
Jan 4, 2021

Conversation

sticky-note
Copy link
Member

@sticky-note sticky-note commented Nov 9, 2020

PR progress checklist (to be filled in by reviewers)

  • Changes to documentation are appropriate (or tick if not required)
  • Changes to tests are appropriate (or tick if not required)
  • Reviews completed

What type of PR is this?

Primary type

  • [build] Changes related to the build system
  • [chore] Changes to the build process or auxiliary tools and libraries such as documentation generation
  • [ci] Changes to the continuous integration configuration
  • [feat] A new feature
  • [fix] A bug fix
  • [perf] A code change that improves performance
  • [refactor] A code change that neither fixes a bug nor adds a feature
  • [revert] A change used to revert a previous commit
  • [style] Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)

Secondary type

  • [docs] Documentation changes
  • [test] Adding missing or correcting existing tests

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

Describe the changes you're proposing

pass nginx to snippets and server_config contexts

Pillar / config required to test the proposed changes

Debug log showing how the proposed changes work

Documentation checklist

  • Updated the README (e.g. Available states).
  • Updated pillar.example.

Testing checklist

  • Included in Kitchen (i.e. under state_top).
  • Covered by new/existing tests (e.g. InSpec, Serverspec, etc.).
  • Updated the relevant test pillar.

Additional context

Copy link

@vutny vutny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be useful, thanks.

Copy link
Member

@aboe76 aboe76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no issues

@myii
Copy link
Member

myii commented Dec 9, 2020

Shouldn't be a problem however we have had a report about memory issues when passing full dicts by context:

Something we need to consider in the long run.

@aboe76
Copy link
Member

aboe76 commented Dec 9, 2020

@myii I think you are right, about that considering the memory issues. especially on large configurations.

@sticky-note
Copy link
Member Author

sticky-note commented Dec 14, 2020

That's exactly why I waited for a review @myii
At which number of vhosts can we consider a large deployment ?
The idea a making a local copy of nginx map, popping nginx:servers:managed and passing that copy to each templates seems attractive. Will it be sufficient?

@sticky-note
Copy link
Member Author

@vutny @myii @aboe76,
Seems to consume significantly less RAM on sls rendering with:

{%- set _nginx = nginx.copy() %}
{%- do _nginx.pop('snippets') %}
{%- do _nginx.pop('servers') %}

@myii Ok to merge like that ?

Copy link
Member

@noelmcloughlin noelmcloughlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated PR looks fine to me.
I done something similar in saltstack-formulas/apache-formula#299

@sticky-note sticky-note merged commit 9ce0e98 into saltstack-formulas:master Jan 4, 2021
@sticky-note sticky-note deleted the feat/context branch January 4, 2021 22:50
@saltstack-formulas-travis

🎉 This PR is included in version 2.5.0 🎉

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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants