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 OpenBSD support. #567

Merged
merged 1 commit into from
Mar 12, 2015
Merged

Add OpenBSD support. #567

merged 1 commit into from
Mar 12, 2015

Conversation

buzzdeee
Copy link
Contributor

This is a first step in OpenBSD support, tested with mysql-server-5.1.73p0v0 package on OpenBSD 5.6-current, using the following configuration stored in hiera.

mysql::server::root_password: topsecret
mysql::server::manage_config_file: true
mysql::server::purge_conf_dir: true
mysql::server::package_ensure: present
mysql::server::service_enabled: true
mysql::server::remove_default_accounts: true
mysql::server::users:
  'dashboard@localhost':
    ensure: present
    max_connections_per_hour: 0
    max_queries_per_hour: 0
    max_updates_per_hour: 0
    max_user_connections: 0
    password_hash: '*TOPSECRETTOPSECRETTOPSECRET'
mysql::server::grants:
  'dashboard@localhost/dashboard_production.*':
    ensure: present
    options:
      - GRANT
    privileges:
      - ALL
    table: 'dashboard_production.*'
    user: dashboard@localhost
mysql::server::databases:
  dashboard_production:
    ensure: present
    charset: utf8
mysql::server::override_options:
  mysqld:
    user: _mysql
    datadir: /var/mysql

The odds are that I have to use the mysql::server::override_options :(
Fixing that, is for another diff, in order to keep this one clean and easier to review.

The change to server/service.pp is because there is no 'mysql' user and group, but _mysql user and _mysql group.
Another solution would be to add a $mysqlgroup variable to mysql::params list and use that.
However, the $mysql::params::log_error file is owned by _mysql:_mysql on my OpenBSD system instead of the root_group.

This is only a first step, that allowed me to create a database.

  • Further steps I'd look into would be:
    • get rid of the currently required usage of override_options
    • introduce a $mysqluser and $mysqlgroup to params.pp and use those throughout the classes
    • in other places, i.e. the backup config, there the group root is hardcoded, but on OpenBSD there is no group root, but wheel, so use the $root_group there

@tphoney
Copy link
Contributor

tphoney commented Mar 11, 2015

ping @buzzdeee this needs a rebase and the commits need squashed. Thanks for the effort you have put in.

@buzzdeee
Copy link
Contributor Author

Thanks for pinging, I'll take care as soon as I find time. ETOOMANYPULLREQUESTS ;)

@tphoney
Copy link
Contributor

tphoney commented Mar 11, 2015

I hear ya !!

@buzzdeee
Copy link
Contributor Author

squashed and rebased, Travis seems to be happy.
Got a little merge conflict when rebasing in manifests/server/service.pp, but a test just showed, still seems to work for me.

cheers,
Sebastian

@igalic
Copy link
Contributor

igalic commented Mar 12, 2015

thanks a lot @buzzdeee!

igalic added a commit that referenced this pull request Mar 12, 2015
@igalic igalic merged commit facb57a into puppetlabs:master Mar 12, 2015
owner => 'mysql',
group => 'mysql',
owner => $mysqluser,
group => $::mysql::server::root_group,
Copy link
Contributor

Choose a reason for hiding this comment

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

@buzzdeee @igalic The group change breaks idempotency on non-debian systems (example). I'm assuming this change was needed for OpenBSD support, but this should be refactored to leave the group 'mysql' for other OSes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry for that, I'm looking into it

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @buzzdeee .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no problem, I introduced it, I should at least come up with a proposal to fix it. I kind of feel responsible for the sh*t I produce, ;) see #691

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

Successfully merging this pull request may close these issues.

4 participants