I would like to provide installation and rollback for any module. Here are
was I've tried but not work,
At modules/katie/manifests/init.pp
class katie::add {
tag 'add'
user {'katie':
ensure => present,
}
}
class katie::remove {
tag 'remove'
user {'katie':
ensure => absent,
}
}
class katie {
include katie::remove, katie::remove
}
test command,
[[email protected] ~]# puppet agent --test --tags add
Info: Retrieving plugin
Info: Loading facts in /var/lib/puppet/lib/facter/pip_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/python_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
Info: Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb
Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
Duplicate declaration: User[katie] is already declared in file
/etc/puppet/modules/katie/manifests/init.pp:5; cannot redeclare at
/etc/puppet/modules/katie/manifests/init.pp:12 on node centos.local
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
[[email protected] ~]#
If this is not the way to go, is there any alternative to get the
install/rollback?
Thanks you,
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.