From 22f7e456b90ba8cb8cb9f3a84db6b90fc8df1539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Thu, 23 Feb 2017 13:35:20 +0100 Subject: [PATCH] Add option to define install options (#15) 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 --- manifests/init.pp | 1 + manifests/install.pp | 3 ++- manifests/params.pp | 1 + spec/classes/proxysql_spec.rb | 5 ++++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index cbfebb05..e8a62b69 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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, diff --git a/manifests/install.pp b/manifests/install.pp index 6c45bced..dd5263a9 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -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': diff --git a/manifests/params.pp b/manifests/params.pp index 6ea5f4ac..fd4b4a75 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -6,6 +6,7 @@ class proxysql::params { $package_name = 'proxysql' $package_ensure = 'installed' + $package_install_options = [] $service_name = 'proxysql' $service_ensure = 'running' diff --git a/spec/classes/proxysql_spec.rb b/spec/classes/proxysql_spec.rb index 960eb29a..aa6b28db 100644 --- a/spec/classes/proxysql_spec.rb +++ b/spec/classes/proxysql_spec.rb @@ -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',