Skip to content

Commit

Permalink
Update to PDK 2.5.0
Browse files Browse the repository at this point in the history
- satisfy puppet-lint
  • Loading branch information
Phil Friderici committed Jun 23, 2022
1 parent cb8c1d2 commit f023846
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 24 deletions.
8 changes: 6 additions & 2 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/pupp

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash",
}
}
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"puppet.puppet-vscode",
"rebornix.Ruby"
]
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [],
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require:
- rubocop-rspec
AllCops:
DisplayCopNames: true
TargetRubyVersion: '2.4'
TargetRubyVersion: '2.5'
Include:
- "**/*.rb"
Exclude:
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ group :development do
gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "voxpupuli-puppet-lint-plugins", '>= 3.0', require: false
end
group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
Expand Down
36 changes: 18 additions & 18 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@
# @param nismaps_ou
# Path to OU where to load nismaps initially.
#
# @param nismaps_ou
# Path to OU where to load nismaps initially.
#
# @param user_search_path
# LDAP search path for user profiles. This will limit the scope where QAS will
# search for users when operating in RFC2307 mode.
Expand Down Expand Up @@ -115,6 +112,10 @@
# Integer for number of seconds vasypd will wait between checks for updated
# NIS Map information in Active Directory. See VAS.CONF(5).
#
# @param vas_conf_full_update_interval
# Integer for number of seconds vasypd will wait until it fully reloads all
# the NIS maps. See VAS.CONF(5)
#
# @param vas_conf_group_update_mode
# The value of group-update-mode in the [nss_vas] configuration section.
# This controls how directory searches will be handeled for group nss
Expand Down Expand Up @@ -482,7 +483,7 @@
String[1] $keytab_owner = 'root',
String[1] $keytab_group = 'root',
Stdlib::Filemode $keytab_mode = '0400',
Stdlib::Fqdn $vas_fqdn = $::fqdn,
Stdlib::Fqdn $vas_fqdn = $facts['networking']['fqdn'],
Optional[String[1]] $computers_ou = undef,
Optional[String[1]] $users_ou = undef,
String[1] $nismaps_ou = 'ou=nismaps,dc=example,dc=com',
Expand Down Expand Up @@ -587,7 +588,6 @@
Optional[Stdlib::HTTPSUrl] $api_users_allow_url = undef,
Optional[String[1]] $api_token = undef,
) {

if $facts['os']['family'] !~ /Debian|Suse|RedHat/ {
fail("Vas supports Debian, Suse, and RedHat. Detected osfamily is <${$facts['os']['family']}>")
}
Expand All @@ -603,28 +603,28 @@
default: { $gp_package_ensure = 'absent' }
}

case versioncmp($::vas_version, $vas_conf_libvas_use_server_referrals_version_switch) {
case versioncmp($facts['vas_version'], $vas_conf_libvas_use_server_referrals_version_switch) {
0, 1: { $vas_conf_libvas_use_server_referrals_default = false } # vas_version is equal (0) or greater (1)
default: { $vas_conf_libvas_use_server_referrals_default = true } # vas_version is smaller (-1)
}

case $vas::package_version {
installed: { $vasver = '' }
default: { $vasver = regsubst($vas::package_version, '-', '.') }
'installed': { $vasver = '' }
default: { $vasver = regsubst($package_version, '-', '.') }
}

$vas_conf_libvas_use_server_referrals_real = pick($vas_conf_libvas_use_server_referrals, $vas_conf_libvas_use_server_referrals_default)
$upm_search_path_real = pick_default($upm_search_path, $users_ou) # Define search paths
$join_domain_controllers_real = join($join_domain_controllers, ' ')
$kdcs_real = join(suffix($kdcs, ":${kdc_port}"), ' ')
$domain_realms_real = merge({"${vas_fqdn}" => $realm}, $domain_realms)
$domain_realms_real = merge( { "${vas_fqdn}" => $realm }, $domain_realms )
$once_file = '/etc/opt/quest/vas/puppet_joined'

# functionality
include ::nsswitch
include ::pam
include nsswitch
include pam

if "${::vas_version}" =~ /^3/ and ($::vas_version !=undef or $vasver <= $::vas_version) {
if "${facts['vas_version']}" =~ /^3/ and ($facts['vas_version'] !=undef or $vasver <= $facts['vas_version']) { # lint:ignore:only_variable_string lint:ignore:140chars
# vasgpd service only in VAS 3
service { 'vasgpd':
ensure => running,
Expand All @@ -649,10 +649,10 @@
}

if $manage_nis {
include ::nisclient
include nisclient

# Use nisdomainname if supplied, or nisclient::domainname as alternative. Use domain fact as fall back only.
$nisdomainname_real = pick($nisdomainname, $nisclient::domainname, $::domain)
$nisdomainname_real = pick($nisdomainname, $nisclient::domainname, $facts['networking']['domain'])

package { 'vasyp':
ensure => $package_version,
Expand Down Expand Up @@ -705,7 +705,7 @@
$users_allow_entries_real = $users_allow_entries
}

if $unjoin_vas == true and $::vas_domain != undef {
if $unjoin_vas == true and $facts['vas_domain'] != undef {
exec { 'vas_unjoin':
command => "$(sed 's/\\(.*\\)join.*/\\1unjoin/' /etc/opt/quest/vas/lastjoin) > /tmp/vas_unjoin.txt 2>&1 && rm -f ${once_file}",
onlyif => "/usr/bin/test -f ${keytab_path} && /usr/bin/test -f /etc/opt/quest/vas/lastjoin",
Expand All @@ -718,7 +718,7 @@
# no run if undef!
# We should probably have better sanity checks for $realm parameter instead of this.

if $realm != undef and $::vas_domain != undef and $::vas_domain != $realm {
if $realm != undef and $facts['vas_domain'] != undef and $facts['vas_domain'] != $realm {
# So we use the fact vas_domain to identify if vas is already joined to a AD
# server. It will make sure and check that ::vas_domain is not undef before doing this
# to prevent something from happening at first run.
Expand All @@ -729,7 +729,7 @@
# of the mismatching realm.

case $domain_change {
false: { fail("VAS domain mismatch, got <${::vas_domain}> but wanted <${realm}>") }
false: { fail("VAS domain mismatch, got <${facts['vas_domain']}> but wanted <${realm}>") }
default: {
# This command executes the result of the sed command, puts the log from
# the unjoin command into a log file and removes the once file to allow
Expand Down Expand Up @@ -832,7 +832,7 @@

case $sitenameoverride {
undef: { $s_opts = undef }
default: { $s_opts = "-s ${sitenameoverride}"}
default: { $s_opts = "-s ${sitenameoverride}" }
}

case $user_search_path {
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
}
],
"description": "Manage VAS - DELL Authentication Services / QAS / VAS",
"pdk-version": "2.4.0",
"template-url": "pdk-default#2.4.0",
"template-ref": "tags/2.4.0-0-gfa6b6d2"
"pdk-version": "2.5.0",
"template-url": "pdk-default#2.5.0",
"template-ref": "tags/2.5.0-0-g369d483"
}

0 comments on commit f023846

Please sign in to comment.