saltstack-formulas / apache-formula

Set up and configure the Apache HTTP server
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
50 stars 285 forks source link

fix(package): avoid unnecessary state change #287

Closed noelmcloughlin closed 3 years ago

noelmcloughlin commented 3 years ago

PR progress checklist (to be filled in by reviewers)


What type of PR is this?

Primary type

Secondary type

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

Describe the changes you're proposing

This PR stops an unnecessary state from being triggered by adding on_fail condition.

Without this PR this happens:

         ID: apache-package-install-deps-pkg-installed
    Function: pkg.installed
        Name: libapache2-mod-security2
      Result: True
     Comment: All specified packages are already installed
     Started: 23:51:24.684213
    Duration: 7.745 ms
     Changes:
----------
          ID: apache-package-install-deps-pkg-installed
    Function: cmd.run
        Name: apt install libapache2-mod-security2 || true
      Result: True
     Comment: Command "apt install libapache2-mod-security2 || true" run
     Started: 23:51:24.700641
    Duration: 657.234 ms
     Changes:
              ----------
              pid:
                  26533
              retcode:
                  0
              stderr:

                  WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
              stdout:
                  Reading package lists...
                  Building dependency tree...
                  Reading state information...
                  libapache2-mod-security2 is already the newest version (2.9.2-1).
                  0 upgraded, 0 newly installed, 0 to remove and 33 not upgraded.

And rerun reports 1 changed state:

Succeeded: 28 (changed=1)
Failed:     0
-------------
Total states run:     

Pillar / config required to test the proposed changes

Debug log showing how the proposed changes work

Documentation checklist

Testing checklist

Additional context

noelmcloughlin commented 3 years ago

@SuperTux88 could you review this PR please?

noelmcloughlin commented 3 years ago

Thanks, I think we can remove that state. I remember having weirdness running VM on VirtualBox on Windows. This was probably a symptom. Eventually, I switched to Hyper-V and VM weirdness was gone (i.e. faulty network virtualization). Commit updated.

saltstack-formulas-travis commented 3 years ago

:tada: This PR is included in version 1.0.5 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: