New User / New setup

39 views
Skip to first unread message

Keyzer Suze

unread,
Nov 8, 2019, 12:55:17 PM11/8/19
to Puppet Users
Hi

Having another go at puppet :)
Bulidng a Centos 8 with puppet install
I have built the VM
and I have added int he puppet repo 



[puppet]
name=Puppet Repository el 8 - $basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppet-release
enabled=1
gpgcheck=1




So I have installed puppet 

yum install puppetserver

setup the CA

I can 
puppet agent --test
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Caching catalog for puppet.yieldbroker.com
Info: Applying configuration version '1573187965'
Notice: Applied catalog in 0.01 seconds


I have plans of moving to R10K, I had used this before - but stopping using puppet for quite a while.

Now I want to install puppetdb, and I would like to make puppet do it. I am having some difficulty in setting that up.

I don't want to setup puppet master as I believe /etc/puppet will be reconfigure when I install R10K. so I want o use a manual manifest and apply with puppet agent or puppet apply.

So I have this

cat manifest.pp
node 'puppet' {
  # Configure puppetdb and its underlying database
  class { 'puppetdb':
  }
  # Configure the Puppet master to use puppetdb
  class { 'puppetdb::master::config':
  }
}


when when i run 

puppet apply -v  --noop manifest.pp
Error: Evaluation Error: Error while evaluating a Resource Statement, Could not find declared class puppetdb (file: /root/puppet/puppetdb/manifest.pp, line: 3, column: 3) on node puppet.yieldbroker.com


so whats next, I presume this is because the puppetDB rpm is not install, but chicken egg

So how do I do this ?

A


gramsa49

unread,
Nov 11, 2019, 9:55:24 PM11/11/19
to Puppet Users
It looks like you're attempting to apply manifest.pp not using the agent.  
The apply is looking for the class/type definitions locally, which don't exist.

Why not update manifest/site.pp on the puppet master for the applicable environment, then use puppet agent -t?

On my PM, I use Hiera to manage the classes and configuration keys:

agrams@puppet:~/puppet/control-repo$ cat manifests/site.pp
hiera_include
('classes')


agrams@puppet:~/puppet/control-repo$ cat data/app/puppetmaster.yaml
---
# Include the following classes
classes
:
 
- puppetdb
 
- puppetdb::master::config
 
- r10k
 
- r10k::webhook
 
- r10k::webhook::config
# Class parameter values
r10k::remote: 'g...@git.x.org:puppet/control-repo.git'
r10k
::webhook::config::use_mcollective: false
r10k
::webhook::config::public_key_path: '/etc/puppetlabs/puppet/ssl/certs/puppet.x.org.pem'
r10k
::webhook::config::private_key_path: '/etc/puppetlabs/puppet/ssl/private_keys/puppet.x.org.pem'
r10k
::webhook::config::user: 'puppet'
r10k
::webhook::config::generate_types: true
r10k
::webhook::config::r10k_deploy_arguments: '-pv'
r10k
::webhook::config::pass: >
    ENC
[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQEw...
r10k
::webhook::ruby_bin: '/usr/bin/ruby'
r10k
::webhook::user: 'root'
r10k
::webhook::group: 'root'

Axton

Keyzer Suze

unread,
Nov 12, 2019, 6:44:48 PM11/12/19
to puppet...@googlegroups.com
Hi

Yes thanks for that - sort of where i got to I ended up using this 
# /etc/puppetlabs/code/environments/production/manifests/site.pp
lookup('classes', {merge => deep}).include

in my site.pp

and I created a role called puppet-server which I applied via yaml

cat data/nodes/puppet.xxx.com.yaml
---
# for node puppet.yieldbroker.com


message: "This node is using puppet.xxx.com data"

# setup the role
classes:
 - role::puppet_server

thanks 


--
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 puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/5aea9aca-3bdb-48f5-9ada-3fe4fc6d5744%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages