Skip to content

Add support for FreeBSD as a target#60

Open
Godwottery wants to merge 23 commits into
PowerDNS:masterfrom
Godwottery:master
Open

Add support for FreeBSD as a target#60
Godwottery wants to merge 23 commits into
PowerDNS:masterfrom
Godwottery:master

Conversation

@Godwottery
Copy link
Copy Markdown

FreeBSD was not supported as an installation target.
There are a number of differences which are taken card of by these changes.

Comment thread tasks/database-mysql.yml Outdated
Comment thread tasks/database-mysql.yml Outdated

- name: Install the MySQL dependencies on FreeBSD
pkgng:
name: "mysql56-client"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the most stable name to depend on? Is there no number-free variant that will be stable over more years?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I think yes. FreeBSD provides a separate port for both the server and the client portion of both MySQL and PostgreSQL. When building from source, you can specify a different version.

I went with the version that is default in the source:
https://svnweb.freebsd.org/ports/head/Mk/bsd.default-versions.mk?view=markup

I guess one could extract it into a variable, so that all these dependencies could be included in the vars/ directory. This would have the benefit of helping those people who build their own packages.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand correctly that the powerdns package does not depend on the mysql client package?

Copy link
Copy Markdown
Author

@Godwottery Godwottery Jun 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does have databases/mysql56-client as a dependency. See: https://www.freshports.org/dns/powerdns/
If you use the default packages that are built by the FreeBSD-team, it will be pulled in as a dependency while installing powerdns.
This would only install the client in the case where you "forgot" to install it the normal way, otherwise it would already find it there.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into this a little more, and it seems that there is also a similar problem with the python version, which comes in two flavors: py27- vs py36-
I will take another look at this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use the default packages that are built by the FreeBSD-team, it will be pulled in as a dependency while installing powerdns.

Then we should think about not hardcoding mysql56-client in this role. If we remove it, the role will work for most users for many years. But if we keep it in, it might break on the next FreeBSD release.

Copy link
Copy Markdown
Author

@Godwottery Godwottery Jun 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked this against a Fedora machine, where is also broke because it needed other packages.
Since this would have created yet another do-when block, I extracted it into a separate variable.

Having it hardcoded in the vars/FreeBSD.yml file does not seem to much, the default is rarely changes. If someone builds their own packages, they can override it in the playbook.

Edit: this should also open up for using mariadb instead of mysql for those who are so inclined.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per comment by RvdE(#60 (comment)), I removed the installation of dependencies for FreeBSD, but left them for the Linux flavours.

Comment thread vars/FreeBSD.yml Outdated
default_pdns_debug_symbols_package_name: "pdns-server-dbg"

# List of PowerDNS Authoritative Server Backends packages on Debian
default_pdns_backends_packages:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this list for Debian in vars/FreeBSD.yml?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I understand it was copied from the Debian file, but it doesn't make sense for FreeBSD)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conditionals from tasks/install-FreeBSD.yml break is the variables are not defined.
name: Install the PowerDNS Authoritative Server debug symbols ... when: pdns_install_debug_symbols_package
name: Install the PowerDNS Authoritative Server backends ... when: pdns_backends_packages is defined

That was the only way I found (within the time I put into it) to solve the issue. There is almost certainly a better way.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked some more, and my other suggestion would be to change the conditionals to
when: not pdns_install_debug_symbols_package_name and set the default to be false.
When a package name is entered, it logs that the feature isnt supported. That was along the lines I had in mind.

@RvdE
Copy link
Copy Markdown

RvdE commented Jun 18, 2019

Hi. I'm the maintainer for dns/powerdns (and dns/powerdns-recursor) on FreeBSD.

If dns/powerdns is installed using pkg (or manually by using make install from the port's directory) it will install everything it depends on automatically. If you install from FreeBSD's repo you'll get the MySQL, PgSql and SQLite3 backends. So IMO there's no need to add any dependencies in the yaml for FreeBSD.

@Godwottery
Copy link
Copy Markdown
Author

I have looked at the test-failures, and do not believe that they are caused by my changes.
If someone wants me to correct something, I would need help in finding the cause.

@pieterlexis
Copy link
Copy Markdown
Contributor

I have looked at the test-failures, and do not believe that they are caused by my changes.

Looks like we're trying to test on an ancient ubuntu :-). #62 should take care of that

@Godwottery
Copy link
Copy Markdown
Author

Looks like we're trying to test on an ancient ubuntu :-). #62 should take care of that

Any chance of someone rerunning the tests to see if they pass? I do not know how to trigger the tests without an extra commit, and I don't have any changes.

@pieterlexis
Copy link
Copy Markdown
Contributor

you should be able to rebase on master and push, that'll retrigger the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants