saltstack-formulas / redis-formula

Redis state
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
40 stars 185 forks source link

feat(arch): add support for archlinux & log/service vars #86

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

The formula does not support Archlinux and does not ensure log-dir and systemd-file is correct across all OS.

          ID: redis_service
    Function: service.running
        Name: redis
      Result: False
     Comment: Attempt 1: Returned a result of "False", with the following comment: "Job for redis.service failed because a timeout was exceeded.
              See "systemctl status redis.service" and "journalctl -xe" for details."
              Attempt 2: Returned a result of "False", with the following comment: "Job for redis.service failed because a timeout was exceeded.
              See "systemctl status redis.service" and "journalctl -xe" for details."
              Job for redis.service failed because a timeout was exceeded.
              See "systemctl status redis.service" and "journalctl -xe" for details.
     Started: 12:44:03.065380
    Duration: 307713.744 ms
     Changes:

Describe the changes you're proposing

Ensure user, group, log-directory exist because the package state does not do everything (i.e. Arch, Suse) and archive state does none of these things. Those states should always run. This PR fixes that.

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

Okay, both commits verified on archlinux.

          ID: redis_service_simple
    Function: file.replace
        Name: /lib/systemd/system/redis.service
      Result: True
     Comment: Changes were made
     Started: 23:18:29.492816
    Duration: 36.398 ms
     Changes:
              ----------
              diff:
                  ---
                  +++
                  @@ -3,7 +3,7 @@
                   After=network.target

                   [Service]
                  -Type=notify
                  +Type=simple
                   User=redis
                   Group=redis
                   ExecStart=/usr/bin/redis-server /etc/redis.conf
----------
          ID: redis_service_simple
    Function: cmd.run
        Name: systemctl daemon-reload
      Result: True
     Comment: Command "systemctl daemon-reload" run
     Started: 23:18:29.529773
    Duration: 228.732 ms
     Changes:
              ----------
              pid:
                  15760
              retcode:
                  0
              stderr:
              stdout:
----------
          ID: redis_overcommit_memory
    Function: sysctl.present
        Name: vm.overcommit_memory
      Result: True
     Comment: Sysctl value vm.overcommit_memory = 1 is already set
     Started: 23:18:29.760242
    Duration: 18.91 ms
     Changes:
----------
          ID: redis_service
    Function: service.running
        Name: redis
      Result: True
     Comment: Service redis has been enabled, and is running
     Started: 23:18:29.779856
    Duration: 406.399 ms
     Changes:
              ----------
              redis:
                  True

Summary for local
-------------
Succeeded: 11 (changed=3)
Failed:     0
noelmcloughlin commented 3 years ago

I will selfie merge as PR is open for 7 months. No CI is setup. Looks good to me.

saltstack-formulas-travis commented 3 years ago

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

The release is available on GitHub release

Your semantic-release bot :package::rocket: