Been at this problem I have for nearly a week now and it's driving crazy!!! I hope it's simply a case of someone with some fresh eyes taking a look and showing me the error of my ways.
Before I continue with the Puppet deployment, for testing purposes, I just want to create a single user namely djc72uk on a single server. The servers name is lhcadvdeveye05 and you can see below that it has successfully generated a certificate:
# puppet agent --no-daemonize --verbose --onetime
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Applying configuration version '1569503223'
Notice: Applied catalog in 0.24 seconds
Looks all good here other than it's not applying the module I created namely accounts (see below within the puppet environment).
# puppet config print confdir
/etc/puppetlabs/puppet
# ll /etc/puppetlabs/puppet
total 48
drwxr-xr-x. 1 puppet puppet 4096 Sep 25 22:34 ./
drwxr-xr-x. 1 root root 4096 Sep 24 12:16 ../
-rw-r--r--. 1 puppet puppet 5487 Sep 23 22:22 auth.conf
-rw-r--r--. 1 puppet puppet 161 Sep 23 22:22 hiera.yaml
-rw-r--r--. 1 puppet puppet 697 Sep 25 22:34 puppet.conf
# more /etc/puppetlabs/puppet/puppet.conf
[master]
vardir = /opt/puppetlabs/server/data/puppetserver
logdir = /var/log/puppetlabs/puppetserver
rundir = /var/run/puppetlabs/puppetserver
pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid
codedir = /etc/puppetlabs/code
environmentpath = $codedir/environments
autosign = true
# puppet config print codedir
/etc/puppetlabs/code
# puppet config print environmentpath
/etc/puppetlabs/code/environments
# puppet config print modulepath
/etc/puppetlabs/code/environments/production/modules:/etc/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules
# puppet module list --tree
/etc/puppetlabs/code/environments/production/modules
└── accounts (???)
/etc/puppetlabs/code/modules (no modules installed)
/opt/puppetlabs/puppet/modules (no modules installed)
# puppet config print manifest
/etc/puppetlabs/code/environments/production/manifests
# ls -lR /etc/puppetlabs/code
/etc/puppetlabs/code:
total 8
drwxr-xr-x. 3 root root 4096 Sep 25 21:02 environments
drwxr-xr-x. 2 root root 4096 Sep 25 21:02 modules
/etc/puppetlabs/code/environments:
total 4
drwxr-xr-x. 5 root root 4096 Sep 25 20:47 production
/etc/puppetlabs/code/environments/production:
total 20
-rw-r--r--. 1 root root 808 Sep 25 20:47 environment.conf
-rw-r--r--. 1 root root 518 Sep 17 22:22 hiera.yaml
drwxr-xr-x. 2 root root 4096 Sep 24 20:34 manifests
drwxr-xr-x. 3 root root 4096 Sep 24 19:57 modules
/etc/puppetlabs/code/environments/production/manifests:
total 4
-rw-r--r--. 1 root root 40 Sep 24 20:34 site.pp
/etc/puppetlabs/code/environments/production/modules:
total 4
drwxr-x---. 5 root root 4096 Sep 25 21:18 accounts
/etc/puppetlabs/code/environments/production/modules/accounts:
total 12
drwxr-x---. 2 root root 4096 Sep 24 20:38 manifests
/etc/puppetlabs/code/environments/production/modules/accounts/manifests:
total 8
-rw-r-----. 1 root root 77 Sep 24 20:38 groups.pp
-rw-r-----. 1 root root 224 Sep 24 20:01 init.pp
/etc/puppetlabs/code/modules:
total 0
# more /etc/puppetlabs/code/environments/production/manifests/site.pp
node 'default' {
include accounts
}
# more /etc/puppetlabs/code/environments/production/modules/accounts/manifests/init.pp
class accounts {
include accounts::groups
user { 'djc72uk':
ensure => present,
home => '/home/djc72uk',
shell => '/bin/bash',
managehome => true,
gid => 'djc72uk',
}
}
# more /etc/puppetlabs/code/environments/production/modules/accounts/manifests/groups.pp
class accounts::groups {
group { 'djc72uk':
ensure => present,
}
}
My gut feel is that the site.pp file is in the wrong place and therefore not being read however, based on the above environment details, I'm struggling to see how that's possible.
Any help will be appreciated here.
Many Thanks,
Dan,