saltstack-formulas / vault-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
15 stars 59 forks source link

feat(freebsd): add FreeBSD support (recover abandoned PR #32) #54

Closed myii closed 2 years ago

myii 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

Build upon the work done in #32, adding FreeBSD (Vagrant) testing in GitHub Actions.

Pillar / config required to test the proposed changes

Debug log showing how the proposed changes work

Documentation checklist

Testing checklist

Additional context

myii commented 3 years ago

Updated the PR to use the new pre-salted Vagrant boxes as introduced here:

myii commented 2 years ago

@dafyddj Finalised this PR; would you mind reviewing again and merging if all OK?

myii commented 2 years ago

@dafyddj So we're getting a failure here:

-----> Verifying <install-binary-freebsd-130-master-py3>...
       Loaded install_binary 
[...] WARN: Cannot find a UUID for your node.

Profile:   vault formula (install_binary)
Version:   (not specified)
Target:    ssh://vagrant@127.0.0.1:2222
Target ID:

  File /usr/local/bin/vault
     ✔  is expected to be a file
     ✔  is expected to be executable
  Command: `/usr/local/bin/vault -version`
     ✔  exit_status is expected to eq 0
     ✔  stderr is expected to be empty
     ✔  stdout is expected to match /^Vault v1.1.0 \('36aa8c8dd1936e10ebd7a4c1d412ae0e6f7900bd'\)/
  Service vault
     ×  is expected not to be installed
     expected Service vault not to be installed
     ✔  is expected not to be enabled
     ✔  is expected not to be running
  File /etc/vault/conf.d/config.json
     ✔  is expected not to be a file

Looks like we've got a regression, introduced by this commit in InSpec:

When I run it through BSDInit, it still works. So must be an issue with the newly introduced class FreeBSD10Init < ServiceManager.

myii commented 2 years ago

Adding these lines back in gets it working:

    def info(service_name)
      cmd = inspec.command("#{service_ctl} -e")
      return nil if cmd.exit_status != 0

      # search for the service

      srv = %r{^.*/(#{service_name}$)}.match(cmd.stdout)
      return nil if srv.nil? || srv[0].nil?

So our FreeBSD failures are a false-positive; this PR can still be merged, @dafyddj.

dafyddj commented 2 years ago

Approved. Thanks both for the work on this.

We should report that inspec issue, yes? @myii

saltstack-formulas-travis commented 2 years ago

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

The release is available on GitHub release

Your semantic-release bot :package::rocket:

myii commented 2 years ago

We should report that inspec issue, yes? @myii

Already added the fix to our fork on InSpec:

Which is working out fine:

Reported the issue and sent through a PR: