Skip to content

Commit

Permalink
Add option to define install options (#15)
Browse files Browse the repository at this point in the history
The package_install_options parameter will be given to the package
resource in install_option.
https://docs.puppet.com/puppet/latest/type.html#package-attribute-install_options
  • Loading branch information
jfroche authored and roidelapluie committed Feb 23, 2017
1 parent 887ae22 commit 22f7e45
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
class proxysql (
String $package_name = $::proxysql::params::package_name,
String $package_ensure = $::proxysql::params::package_ensure,
Array[String] $package_install_options = $::proxysql::params::package_install_options,

String $service_name = $::proxysql::params::service_name,
String $service_ensure = $::proxysql::params::service_ensure,
Expand Down
3 changes: 2 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
class proxysql::install {

package { $::proxysql::package_name:
ensure => $::proxysql::package_ensure,
ensure => $::proxysql::package_ensure,
install_options => $::proxysql::package_install_options,
}

file { 'proxysql-datadir':
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class proxysql::params {
$package_name = 'proxysql'
$package_ensure = 'installed'
$package_install_options = []

$service_name = 'proxysql'
$service_ensure = 'running'
Expand Down
5 changes: 4 additions & 1 deletion spec/classes/proxysql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@

it { is_expected.to contain_class('mysql::client').with(bindings_enable: false) }

it { is_expected.to contain_package('proxysql').with_ensure('installed') }
it do
is_expected.to contain_package('proxysql').with(ensure: 'installed',
install_options: [])
end

it do
is_expected.to contain_file('proxysql-config-file').with(ensure: 'file',
Expand Down

0 comments on commit 22f7e45

Please sign in to comment.