Last active
May 31, 2017 14:54
-
-
Save reidmv/1457d3795a82b9dd7fbdc41cee48bca4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# <modulepath>/aix_reload/examples/test.pp | |
user { 'newuser007': | |
ensure => present, | |
provider => aix_reload, | |
before => Notify['foo'], | |
} | |
notify { 'foo': } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# <modulepath>/aix_reload/lib/puppet/provider/user/aix_reload.rb | |
Puppet::Type.type(:user).provide(:aix_reload, :parent => :aix, :source => :aix) do | |
# To fully duplicate and encompass the behavior of the parent provider, we need to manually | |
# ingest a bit of it. | |
[:@checks, :@commands, :@confine_collection, :@declared_features, :@options].each do |var| | |
instance_variable_set(var, Puppet::Type::User.provider(:aix).instance_variable_get(var)) | |
end | |
def create | |
super | |
Puppet::Application.stop! | |
pid = Process.pid | |
at_exit { system '/opt/puppetlabs/bin/puppet agent -t </dev/null >/dev/null 2>&1 &' if Process.pid == pid } | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# site.pp | |
case $facts['os']['name'] | |
# I don't know if the capitalization here is right; I don't have an AIX box handy | |
# to test | |
'aix': { | |
# By putting this in site.pp, any user resource that doesn't specify a provider | |
# will use the one specified here by default. | |
User { | |
provider => aix_reload, | |
} | |
} | |
default: { | |
# intentionally left empty | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment