From 9a63807bf11f727cfdf20bd28ab23b9bebee8f43 Mon Sep 17 00:00:00 2001 From: Arne Teuke Date: Thu, 24 Apr 2025 18:41:04 +0200 Subject: [PATCH] add installation --- manifests/main/config.pp | 1 + manifests/main/install.pp | 12 ++++++++++++ manifests/params.pp | 13 +++++++++---- 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 manifests/main/install.pp diff --git a/manifests/main/config.pp b/manifests/main/config.pp index ce142d7..b83a26c 100644 --- a/manifests/main/config.pp +++ b/manifests/main/config.pp @@ -6,4 +6,5 @@ class php_cd::main::config ( ) inherits php_cd::params { + include php_cd::main::install } diff --git a/manifests/main/install.pp b/manifests/main/install.pp new file mode 100644 index 0000000..3a3b06e --- /dev/null +++ b/manifests/main/install.pp @@ -0,0 +1,12 @@ +## php_cd::main::install.pp +# Module name: php_cd +# Author: Arne Teuke (arne_teuke@confdroid.com) +# @summary Class manages the module logic +############################################################################## +class php_cd::main::install ( + +) inherits php_cd::params { + package { $reqpackages: + ensure => $pkg_ensure, + } +} diff --git a/manifests/params.pp b/manifests/params.pp index 45202c2..a7ad6bd 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -2,16 +2,21 @@ # Module name: php_cd # Author: Arne Teuke (arne_teuke@confdroid.com) # @summary Class contains all class parameters for this module +# @param [string] reqpackages which packages to install +# @param [string] pkg_ensure which version of packages to install ############################################################################## class php_cd::params ( + String $reqpackages = 'php', + String $pkg_ensure = 'latest', + ) { # Facts - $fqdn = $facts['networking']['fqdn'] - $domain = $facts['networking']['domain'] - $os_name = $facts['os']['name'] - $os_release = $facts['os']['release']['major'] + $fqdn = $facts['networking']['fqdn'] + $domain = $facts['networking']['domain'] + $os_name = $facts['os']['name'] + $os_release = $facts['os']['release']['major'] # includes must be last include php_cd::main::config