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

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

Merged
merged 5 commits into from
Mar 23, 2022

Conversation

myii
Copy link
Member

@myii myii commented Mar 30, 2021

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

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

  • 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

@myii myii requested review from dafyddj and a team as code owners March 30, 2021 19:56
@myii myii force-pushed the feat/add-freebsd-support branch from 6fa6354 to f17158a Compare April 5, 2021 18:01
@myii
Copy link
Member Author

myii commented Apr 5, 2021

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

@myii myii force-pushed the feat/add-freebsd-support branch 2 times, most recently from adb640a to 7b349da Compare April 19, 2021 23:30
vault/package/install.sls Outdated Show resolved Hide resolved
@myii myii force-pushed the feat/add-freebsd-support branch from 7b349da to 4091eb3 Compare March 23, 2022 07:32
@myii myii requested a review from dafyddj March 23, 2022 07:33
@myii myii force-pushed the feat/add-freebsd-support branch from 4091eb3 to 208e31b Compare March 23, 2022 07:36
@myii
Copy link
Member Author

myii commented Mar 23, 2022

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

@myii
Copy link
Member Author

myii commented Mar 23, 2022

@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
Copy link
Member Author

myii commented Mar 23, 2022

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?
  • Exits when it doesn't find the service in the service -e command output.

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

@dafyddj dafyddj merged commit 1fb02e2 into saltstack-formulas:master Mar 23, 2022
@dafyddj
Copy link
Contributor

dafyddj commented Mar 23, 2022

Approved. Thanks both for the work on this.

We should report that inspec issue, yes? @myii

@saltstack-formulas-travis

🎉 This PR is included in version 1.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants