saltstack-formulas / maven-formula

A minimalistic way to install just the maven distribution without any dependencies
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
4 stars 10 forks source link

Deliver example settings.xml & essential updates for older salt versions #15

Closed noelmcloughlin closed 7 years ago

noelmcloughlin commented 7 years ago

This PR adds an example maven-setttings.xml file to the formula. Maven is quite useless without settings.xml file anyway so this is useful starting point for future idea here. The Jinja template example requires end-user to update two variables in settings.sls.

This PR addresses following issues seen when tested on older Salt version-

  1. Salt 2015.8.8 (Beryllium) generates "Requisite declaration XXXXXXXXXXX in SLS sqlplus is not formed as a single key dictionary" errors on requires-

       Solution: Prefix requisite-type to all requires (i.e. - **cmd**: download-maven-archive ).
  2. . Salt generates warnings on Fedora regarding saltstack/salt#39751

       Solution: Remove "user: root" and "group: root" from archive.extracted state.
  3. Source_hash handling has issues in salt 2016.11.0 and earlier.

     Solution: Only check source_hash on newer Salt version as interim measure. Twooster on #salt IRC suggested "{% if grains['saltversioninfo'] <= [2016, 11, 6] %}" to workaround version-check issue on opensuse/salt 2016.3.
  4. On older Salt version the formula is broken as archive.extracted "name" exists.

    Solution: Reintroduce "if_missing" parameter to archive.extracted as recommended solution for older Salt.  This fixes formula on old Salt.
  5. Getting "recursive requisite" error on fedora/ubuntu for statename {{ xxxxx }}

    Solution: Seemingly fixed by renaming state to avoid ID clash- -{{ archive_file }}: +maven-remove-prev-archive:

  6. Bug in maven.env state: https://github.com/saltstack-formulas/maven-formula/issues/14

    Solution: Fixed in this PR

Tested successfuly (no pillars):

whiteinge commented 7 years ago

This looks good to me. 👍 Especially since this fixes some breakages. Thanks!

noelmcloughlin commented 7 years ago

Thanks @whiteinge appreciated.