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

refactor(map and defaults): Update the map.jinja file and add yaml maps #134

Merged
merged 12 commits into from
Mar 22, 2020
Merged

Conversation

absmith82
Copy link
Contributor

@absmith82 absmith82 commented Mar 20, 2020

This changes the map.jinja file to be more like the standard template. It also adds defaults, osfamlymap, osfingermap, and osmap yaml files for easy mapping of the proper packages and settings for each OS and version of the OS.

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

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

This changes the map.jinja file to be more like the standard template.  It also adds defaults, osfamlymap, osfingermap, and osmap yaml files for easy mapping of the proper packages and settings for each OS and version of the OS.
@myii
Copy link
Member

myii commented Mar 20, 2020

@absmith82 Thanks for starting this, it's a very useful PR. An initial comment: all of these files need to be moved to the zabbix directory, including replacing the current map.jinja. Also, this repo now uses semantic-release, so the commit messages need to be formatted accordingly. Please see the link to that from the README.

@absmith82
Copy link
Contributor Author

You are right,

Sorry I was careless and just uploaded the files to the wrong place after testing on my test server. I'll check the readme and reformat the commit message and fix the file structure.

Thanks

@absmith82 absmith82 changed the title Updated the map.jinja file and added yaml maps refactor(map and defaults)Updated the map.jinja file and added yaml maps Mar 21, 2020
@absmith82 absmith82 changed the title refactor(map and defaults)Updated the map.jinja file and added yaml maps refactor(map and defaults): Update the map.jinja file and add yaml maps Mar 21, 2020
@myii
Copy link
Member

myii commented Mar 21, 2020

@absmith82 I've run some tests to compare the map that is produced before and after this PR. The results need to be identical for a successful conversion. I've been able to fix things at my end, so I'll append a commit to this PR in a little while, so that you can look over the changes made. Once we're happy with that, we can squash the whole PR to fix the commit message, so that we get semantic-release working -- changing the title of the PR isn't enough, unfortunately.

@absmith82
Copy link
Contributor Author

absmith82 commented Mar 21, 2020 via email

* Avoid issues with template:
  - `[ERROR   ] Unable to manage file: Jinja variable 'tpldir' is undefined`
@myii
Copy link
Member

myii commented Mar 21, 2020

Thanks for the update. I've been looking at the Travis ci tests and it looks like the tests are failing because of repo issues. But any updates to make it the same as before would be fine with me. I literally just the old map.jinja values and translated then into the different yaml map files I may have changed the postgres packages due to the old ones being virtual packages.

Issues

@absmith82 It's easiest to cover the situation by looking at the diffs. For all of the diffs, due to the nature of how I was generating the changes, anything with a minus (-) at the beginning is something which isn't quite right. It needs to be changed back to the corresponding line(s) with a plus (+), or shouldn't be there at all:

Resolution

See 3d324d9...b7c0977 for the changes that have been added to this PR.

  1. Fixed map.jinja:
    1. Only the pillar lookup should be merged, not the whole pillar
    2. Used the latest structure from the template-formula
  2. Fixed osfamilymap.yaml:
    1. Added a space after the dash in each list entry
    2. Resolved minor formatting
  3. Modified osmap.yaml:
    1. Used the latest structure from the template-formula
  4. Fixed osfingermap.yaml:
    1. Removed the PostgreSQL entries for Ubuntu 18.04 and 16.04 -- these can be tackled in a subsequent PR, this PR should be a pure refactor only
    2. Used the latest structure from the template-formula

Result

All of the platforms are now passing:

Remaining steps

After confirming the changes, the commits need to be fixed so that semantic-release runs properly. The easiest way to do that is squashing the commits when merging this PR.

@myii
Copy link
Member

myii commented Mar 21, 2020

@absmith82 So just to confirm, all of the platforms are passing for this PR:

The only thing remaining is the commitlint, so if you're OK with the changes that I've added, I'll squash and merge this PR, fixing the commit message at the same time.

@absmith82
Copy link
Contributor Author

I have no problems with the changes you made. Most were formatting mistakes I made so if you can squash the commit to fix the commitlint test that would be great.

@myii myii merged commit badd17e into saltstack-formulas:master Mar 22, 2020
@myii
Copy link
Member

myii commented Mar 22, 2020

Thanks @absmith82, merged and released successfully:

@myii
Copy link
Member

myii commented Mar 22, 2020

@absmith82 One more thing, you may want to send through a PR regarding the osfinger changes for Ubuntu 18.04 and 16.04. That can now be considered for inclusion as a new fix/feature.

@myii
Copy link
Member

myii commented Mar 22, 2020

@absmith82 Just got reminded that #123 already contains the suggestion for updating all of the platforms to 3.0, so it might be worth working with that in mind for any new PR.

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

Successfully merging this pull request may close these issues.

2 participants