From 56a7ed015507934f1d828450051af71d7ea2aa86 Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Thu, 7 Dec 2023 23:51:18 -0500 Subject: [PATCH] Started some basic desktop enviroment installs --- manifests/dm.pp | 16 ++++++++++++++++ manifests/init.pp | 30 ++++++++++++++++++++++++++++++ manifests/kde.pp | 16 ++++++++++++++++ manifests/mate.pp | 16 ++++++++++++++++ manifests/params.pp | 33 +++++++++++++++++++++++++++++++++ pdk.yaml | 2 ++ spec/classes/desktop_spec.rb | 13 +++++++++++++ spec/classes/dm_spec.rb | 13 +++++++++++++ spec/classes/kde_spec.rb | 13 +++++++++++++ spec/classes/mate_spec.rb | 13 +++++++++++++ spec/classes/params_spec.rb | 13 +++++++++++++ 11 files changed, 178 insertions(+) create mode 100644 manifests/dm.pp create mode 100644 manifests/init.pp create mode 100644 manifests/kde.pp create mode 100644 manifests/mate.pp create mode 100644 manifests/params.pp create mode 100644 pdk.yaml create mode 100644 spec/classes/desktop_spec.rb create mode 100644 spec/classes/dm_spec.rb create mode 100644 spec/classes/kde_spec.rb create mode 100644 spec/classes/mate_spec.rb create mode 100644 spec/classes/params_spec.rb diff --git a/manifests/dm.pp b/manifests/dm.pp new file mode 100644 index 0000000..958af1a --- /dev/null +++ b/manifests/dm.pp @@ -0,0 +1,16 @@ +# @summary A short summary of the purpose of this class +# +# A description of what this class does +# +# @example +# include desktop::dm +class desktop::dm ( + Boolean $display_manager_manage = $desktop::display_manager_manage, + String $display_manager_package = $desktop::display_manager_package, +) { + if $display_manager_manage { + package { $display_manager_package: + ensure => present, + } + } +} diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..d2d3e1d --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,30 @@ +# @summary A short summary of the purpose of this class +# +# A description of what this class does +# +# @example +# include desktop +class desktop ( + Boolean $display_manager_manage = $desktop::params::display_manager_manage, + String $display_manager_package = $desktop::params::display_manager_package, + + Boolean $all_desktop_install = $desktop::params::all_desktop_install, + + Boolean $mate_desktop_install = $desktop::params::mate_desktop_install, + String $mate_desktop_package = $desktop::params::mate_desktop_package, + + Boolean $kde_desktop_install = $desktop::params::kde_desktop_install, + String $kde_desktop_package = $desktop::params::kde_desktop_package, +) inherits desktop::params { + if $desktop::display_manager_manage { + contain desktop::dm + } + + if $desktop::mate_desktop_install { + contain desktop::mate + } + + if $desktop::kde_desktop_install { + contain desktop::kde + } +} diff --git a/manifests/kde.pp b/manifests/kde.pp new file mode 100644 index 0000000..15a00a8 --- /dev/null +++ b/manifests/kde.pp @@ -0,0 +1,16 @@ +# @summary A short summary of the purpose of this class +# +# A description of what this class does +# +# @example +# include desktop::kde +class desktop::kde ( + Boolean $kde_desktop_install = $desktop::kde_desktop_install, + String $kde_desktop_package = $desktop::kde_desktop_package, +) { + if $kde_desktop_install { + package { $kde_desktop_package: + ensure => present, + } + } +} diff --git a/manifests/mate.pp b/manifests/mate.pp new file mode 100644 index 0000000..f3c7137 --- /dev/null +++ b/manifests/mate.pp @@ -0,0 +1,16 @@ +# @summary A short summary of the purpose of this class +# +# A description of what this class does +# +# @example +# include desktop::mate +class desktop::mate ( + Boolean $mate_desktop_install = $desktop::mate_desktop_install, + String $mate_desktop_package = $desktop::mate_desktop_package, +) { + if $mate_desktop_install { + package { $mate_desktop_package: + ensure => present, + } + } +} diff --git a/manifests/params.pp b/manifests/params.pp new file mode 100644 index 0000000..2d7cf37 --- /dev/null +++ b/manifests/params.pp @@ -0,0 +1,33 @@ +# @summary A short summary of the purpose of this class +# +# A description of what this class does +# +# @example +# include desktop::params +class desktop::params { + # Display manager variables + $display_manager_manage = true + $display_manager_package = $facts['os']['family'] ? { + 'Debian' => 'gdm3', + default => 'gdm', + } + + # Common variables + $all_desktop_install = false + + # MATE desktop variables + $mate_desktop_install = $all_desktop_install + $mate_desktop_package = $facts['os']['family'] ? { + 'RedHat' => 'mate-desktop', + 'Debian' => 'mate-desktop-environment', + 'FreeBSD' => 'mate', + } + + # KDE desktop variables + $kde_desktop_install = $all_desktop_install + $kde_desktop_package = $facts['os']['family'] ? { + 'RedHat' => 'kde-desktop', + 'Debian' => 'kde-plasma-desktop', + 'FreeBSD' => 'kde5', + } +} diff --git a/pdk.yaml b/pdk.yaml new file mode 100644 index 0000000..4bef4bd --- /dev/null +++ b/pdk.yaml @@ -0,0 +1,2 @@ +--- +ignore: [] diff --git a/spec/classes/desktop_spec.rb b/spec/classes/desktop_spec.rb new file mode 100644 index 0000000..7cd0af0 --- /dev/null +++ b/spec/classes/desktop_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'desktop' do + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile.with_all_deps } + end + end +end diff --git a/spec/classes/dm_spec.rb b/spec/classes/dm_spec.rb new file mode 100644 index 0000000..13bc3e2 --- /dev/null +++ b/spec/classes/dm_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'desktop::dm' do + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile.with_all_deps } + end + end +end diff --git a/spec/classes/kde_spec.rb b/spec/classes/kde_spec.rb new file mode 100644 index 0000000..922b404 --- /dev/null +++ b/spec/classes/kde_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'desktop::kde' do + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile.with_all_deps } + end + end +end diff --git a/spec/classes/mate_spec.rb b/spec/classes/mate_spec.rb new file mode 100644 index 0000000..106e440 --- /dev/null +++ b/spec/classes/mate_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'desktop::mate' do + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile.with_all_deps } + end + end +end diff --git a/spec/classes/params_spec.rb b/spec/classes/params_spec.rb new file mode 100644 index 0000000..af41bd8 --- /dev/null +++ b/spec/classes/params_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'desktop::params' do + on_supported_os.each do |os, os_facts| + context "on #{os}" do + let(:facts) { os_facts } + + it { is_expected.to compile.with_all_deps } + end + end +end