Started some basic desktop enviroment installs

This commit is contained in:
Gregory Ballantine 2023-12-07 23:51:18 -05:00
parent 8b2d05c38d
commit 56a7ed0155
11 changed files with 178 additions and 0 deletions

16
manifests/dm.pp Normal file
View File

@ -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,
}
}
}

30
manifests/init.pp Normal file
View File

@ -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
}
}

16
manifests/kde.pp Normal file
View File

@ -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,
}
}
}

16
manifests/mate.pp Normal file
View File

@ -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,
}
}
}

33
manifests/params.pp Normal file
View File

@ -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',
}
}

2
pdk.yaml Normal file
View File

@ -0,0 +1,2 @@
---
ignore: []

View File

@ -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

13
spec/classes/dm_spec.rb Normal file
View File

@ -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

13
spec/classes/kde_spec.rb Normal file
View File

@ -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

13
spec/classes/mate_spec.rb Normal file
View File

@ -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

View File

@ -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