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

Add support for FreeBSD #612

Merged
merged 1 commit into from
May 5, 2021
Merged

Add support for FreeBSD #612

merged 1 commit into from
May 5, 2021

Conversation

smortex
Copy link
Member

@smortex smortex commented May 3, 2021

Pull Request (PR) description

Make this module usable on FreeBSD.

While here, sort operating system lists in alphabetical order for
consistency.

For now, open as a draft so that I can gather early review while I point other modules to this branch and validate it works as expected. When I am confident with this change, I'll update it.

This Pull Request (PR) fixes the following issues

n/a

@bastelfreak bastelfreak added the enhancement New feature or request label May 3, 2021
@bastelfreak
Copy link
Member

looks quite good. Let's see what CI says

Make this module usable on FreeBSD.

While here, sort operating system lists in alphabetical order for
consistency.
@bastelfreak bastelfreak marked this pull request as ready for review May 3, 2021 08:56
@bastelfreak
Copy link
Member

@smortex do you want to add more here or is it ready for merge?

@smortex
Copy link
Member Author

smortex commented May 3, 2021

It is currently not working, but I suspect this is not FreeBSD-related… I am testing with this simple manifest:

class { 'python':
  version => '38',
}

class { 'puppetboard':
}

This apply without error, noting happen on subsequent runs, but the requirements from requirements.txt are not installed. chowning / chmoding the requirements.txt file allows Puppet to trigger the update. I will have access to a convenient machine for testing tomorrow. If the problem is not tied to FreeBSD, I think it is mergeable, otherwise more work is indeed needed.

@smortex
Copy link
Member Author

smortex commented May 5, 2021

I confirm the issue: on Linux the behavior is as expected, but on FreeBSD deployment of the requirements does not work.

I have a working workaround: instead of the trick with managing a resource for the requirements.txt file and auditing changes of it's content, use a python script, executed from the virtualenv which tries to load all dependencies listed in requirements.txt as an unless parameter for the pip install exec (The script for checking dependencies).

@bastelfreak do you prefer that we investigate this is a dedicated PR? If so, this can be merged 😉

@smortex

This comment has been minimized.

@bastelfreak
Copy link
Member

bastelfreak commented May 5, 2021

where exactly is the issue on FreeBSD? In puppetboard, in python::pyvenv? I'm not sure if we should merge this if some (important) features don't work on the desired platform.

@smortex
Copy link
Member Author

smortex commented May 5, 2021

I am currently investigating it: when trying to reproduce the issue with a minimal case, it is actually working as expected. I guess it's the way I test that trigger the issue.

Never used audit before and there are some surprises :-D

@smortex
Copy link
Member Author

smortex commented May 5, 2021

@bastelfreak just re-tested from scratch and it works as expected… I must have screwed something on my other test machine 😒

romain@agrajag ~/Projects % cat > test.pp << EOT
class { 'python':
  version => '38',
}

class { 'puppetboard':
  apache_confd   => '/usr/local/etc/apache24/extra/',
  apache_service => 'apache24',
  python_version => '3.8',
}
EOT
romain@agrajag ~/Projects % git clone https://github.com/voxpupuli/puppet-puppetboard
romain@agrajag ~/Projects/puppet-puppetboard % cd puppet-puppetboard
romain@agrajag ~/Projects/puppet-puppetboard % bundle
romain@agrajag ~/Projects/puppet-puppetboard % bundle exec rake spec_prep
romain@agrajag ~/Projects/puppet-puppetboard % cd spec/fixtures/modules/python
romain@agrajag ~/Projects/puppet-puppetboard/spec/fixtures/modules/python % git remote add smortex https://github.com/smortex/puppet-python
romain@agrajag ~/Projects/puppet-puppetboard/spec/fixtures/modules/python % git fetch smortex
romain@agrajag ~/Projects/puppet-puppetboard/spec/fixtures/modules/python % git checkout freebsd
romain@agrajag ~/Projects/puppet-puppetboard/spec/fixtures/modules/python % cd ../../../..
romain@agrajag ~/Projects/puppet-puppetboard % puppet apply -t ../test.pp --modulepath spec/fixtures/modules
romain@agrajag ~/Projects/puppet-puppetboard % ls /srv/puppetboard/virtenv-puppetboard/lib/python3.8/site-packages
# What is expected \o/

This can be merged, thanks!

@bastelfreak
Copy link
Member

thanks! can you maybe add that as an example to the puppetboard module and add freebsd to the metadata.json in that module?

@bastelfreak bastelfreak merged commit 3c31b13 into voxpupuli:master May 5, 2021
@smortex
Copy link
Member Author

smortex commented May 5, 2021

Yeah, it's one of the next move for me, but even more work needed because we do actually do not need the python module to manage puppetboard on FreeBSD because it's as simple as installing a package 😉.

That being said, this module was ideal for testing these changes quickly ^_^

Thanks!

@smortex smortex deleted the freebsd branch May 5, 2021 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants