From 4ebf0a623d7275f5c519a2892e2e3f4dd4df926f Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 28 Sep 2019 21:47:56 +0200 Subject: [PATCH] old-style roles are gone --- modules/deprecated/manifests/init.pp | 1 - .../lib/puppet/parser/functions/has_role.rb | 20 ------------------- modules/roles/templates/sso_rp/ca.crl.erb | 1 - modules/ssh/templates/authorized_keys.erb | 1 - 4 files changed, 23 deletions(-) delete mode 100644 modules/puppetmaster/lib/puppet/parser/functions/has_role.rb diff --git a/modules/deprecated/manifests/init.pp b/modules/deprecated/manifests/init.pp index f3a8afe9c..f29c76565 100644 --- a/modules/deprecated/manifests/init.pp +++ b/modules/deprecated/manifests/init.pp @@ -3,5 +3,4 @@ class deprecated { $localinfo = yamlinfo('*') $nodeinfo = nodeinfo($::fqdn) $allnodeinfo = allnodeinfo('sshRSAHostKey ipHostNumber', 'purpose mXRecord physicalHost purpose') - $roles = hiera('roles') } diff --git a/modules/puppetmaster/lib/puppet/parser/functions/has_role.rb b/modules/puppetmaster/lib/puppet/parser/functions/has_role.rb deleted file mode 100644 index eef31b984..000000000 --- a/modules/puppetmaster/lib/puppet/parser/functions/has_role.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Puppet::Parser::Functions - newfunction(:has_role, :type => :rvalue) do |args| - role = args[0] - roles = lookupvar('deprecated::roles') - fqdn = lookupvar('fqdn') - if not roles.include?(role) - err "Failed to look up missing role #{role}" - return false - end - case roles[role] - when Hash then roles[role].include?(fqdn) - else roles[role].map{ |k| - case k - when Hash then k.keys.first - else k - end - }.include?(fqdn) - end - end -end diff --git a/modules/roles/templates/sso_rp/ca.crl.erb b/modules/roles/templates/sso_rp/ca.crl.erb index a10d51eb4..ecdf1c48a 100644 --- a/modules/roles/templates/sso_rp/ca.crl.erb +++ b/modules/roles/templates/sso_rp/ca.crl.erb @@ -11,7 +11,6 @@ end crl = [] -roles = scope.lookupvar('deprecated::roles') ['diabelli.debian.org'].each do |node| c = getcrl(node) next if c.nil? diff --git a/modules/ssh/templates/authorized_keys.erb b/modules/ssh/templates/authorized_keys.erb index efb9391be..311144a29 100644 --- a/modules/ssh/templates/authorized_keys.erb +++ b/modules/ssh/templates/authorized_keys.erb @@ -1,6 +1,5 @@ <% allnodeinfo = scope.lookupvar('deprecated::allnodeinfo') - roles = scope.lookupvar('deprecated::roles') %> # local admin -- 2.20.1