Skip to content

Commit

Permalink
add support for managing individual plugin versions
Browse files Browse the repository at this point in the history
currently on the  remote_execution/cockpit plugin class has support
for managing the plugin version. all other plugins are tied to the
`foreman::plugin_version`. this change adds the same `ensure` parameter
to all plugin classes allowing for granular state management.
  • Loading branch information
UiP9AV6Y committed Oct 14, 2024
1 parent b1a2286 commit 5527093
Show file tree
Hide file tree
Showing 73 changed files with 383 additions and 39 deletions.
10 changes: 9 additions & 1 deletion manifests/plugin/acd.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# Installs foreman_acd plugin
class foreman::plugin::acd {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::acd (
Optional[String[1]] $ensure = undef,
) {
include foreman::plugin::tasks
include foreman::plugin::remote_execution

foreman::plugin { 'acd':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/ansible.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# Installs foreman_ansible plugin
class foreman::plugin::ansible {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::ansible (
Optional[String[1]] $ensure = undef,
) {
include foreman::plugin::tasks

foreman::plugin { 'ansible':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/azure.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Installs foreman_azure_rm plugin
class foreman::plugin::azure {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::azure (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'azure_rm':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/bootdisk.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Installs foreman_bootdisk plugin
class foreman::plugin::bootdisk {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::bootdisk (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'bootdisk':
version => $ensure,
}
}
13 changes: 11 additions & 2 deletions manifests/plugin/datacenter.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Installs foreman_datacenter plugin
class foreman::plugin::datacenter {
foreman::plugin { 'datacenter': }
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::datacenter (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'datacenter':
version => $ensure,
}
}
3 changes: 3 additions & 0 deletions manifests/plugin/default_hostgroup.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# @summary This class installs the default_hostgroup plugin and optionally manages the configuration file
#
# @param hostgroups An array of hashes of hostgroup names and facts to add to the configuration
# @param ensure Specify the package state, or absent/purged to remove it
#
class foreman::plugin::default_hostgroup (
Optional[String[1]] $ensure = undef,
Array[Hash[String, Hash]] $hostgroups = [],
) {
if empty($hostgroups) {
Expand All @@ -12,6 +14,7 @@
}

foreman::plugin { 'default_hostgroup':
version => $ensure,
config => $config,
config_file => "${foreman::plugin_config_dir}/default_hostgroup.yaml",
}
Expand Down
13 changes: 11 additions & 2 deletions manifests/plugin/dhcp_browser.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Installs foreman_dhcp_browser plugin
class foreman::plugin::dhcp_browser {
foreman::plugin { 'dhcp_browser': }
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::dhcp_browser (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'dhcp_browser':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/discovery.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
#
# This class installs discovery plugin and images
#
class foreman::plugin::discovery {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::discovery (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'discovery':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/dlm.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Installs foreman_dlm plugin
class foreman::plugin::dlm {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::dlm (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'dlm':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/expire_hosts.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Installs foreman_expire_hosts plugin
class foreman::plugin::expire_hosts {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::expire_hosts (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'expire_hosts':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/git_templates.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
#
# This class installs git_templates plugin
#
class foreman::plugin::git_templates {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::git_templates (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'git_templates':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/google.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Installs foreman_google plugin
class foreman::plugin::google {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::google (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'google':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/hdm.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# @summary Install the Hiera Data Manager (HDM) plugin
#
class foreman::plugin::hdm {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::hdm (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'hdm':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/host_extra_validator.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Installs foreman_host_extra_validator plugin
class foreman::plugin::host_extra_validator {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::host_extra_validator (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'host_extra_validator':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/kernel_care.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Installs foreman_kernel_care plugin
class foreman::plugin::kernel_care {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::kernel_care (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'kernel_care':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/kubevirt.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Installs foreman_kubevirt plugin
class foreman::plugin::kubevirt {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::kubevirt (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'kubevirt':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/leapp.pp
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# Installs foreman_leapp plugin
class foreman::plugin::leapp {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::leapp (
Optional[String[1]] $ensure = undef,
) {
include foreman::plugin::remote_execution
include foreman::plugin::ansible

foreman::plugin { 'leapp':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/monitoring.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Installs foreman_monitoring plugin
class foreman::plugin::monitoring {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::monitoring (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'monitoring':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/netbox.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
#
# This class installs netbox plugin
#
class foreman::plugin::netbox {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::netbox (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'netbox':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/omaha.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Installs foreman_omaha plugin
class foreman::plugin::omaha {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::omaha (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'omaha':
version => $ensure,
}
}
13 changes: 11 additions & 2 deletions manifests/plugin/openscap.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
#
# === Parameters:
#
class foreman::plugin::openscap {
foreman::plugin { 'openscap': }
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::openscap (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'openscap':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/ovirt_provision.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# @summary install the ovirt_provision plugin
class foreman::plugin::ovirt_provision {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::ovirt_provision (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'ovirt_provision':
version => $ensure,
package => $foreman::params::plugin_prefix.regsubst(/foreman[_-]/, 'ovirt_provision_plugin'),
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/proxmox.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# = Foreman Proxmox plugin
class foreman::plugin::proxmox {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::proxmox (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'fog_proxmox':
version => $ensure,
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/puppet.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
#
# This class installs puppet plugin
#
class foreman::plugin::puppet {
#
# === Advanced parameters:
#
# $ensure:: Specify the package state, or absent/purged to remove it
#
class foreman::plugin::puppet (
Optional[String[1]] $ensure = undef,
) {
foreman::plugin { 'puppet':
version => $ensure,
}
}
Loading

0 comments on commit 5527093

Please sign in to comment.