puppetlabs / puppetserver-helm-chart

The Helm Chart for Puppet Server
Apache License 2.0
51 stars 56 forks source link

Foreman Support #107

Open orelops opened 2 years ago

orelops commented 2 years ago

Use Case

Hi all ! i am using foreman with puppetserver for reports and class management, it might be nice to include it.

Describe the Solution You Would Like

i create a new file named '95-foreman-config.sh' which includes

 # Add node.rb (classes) and foreman.rb (reports)
curl https://raw.githubusercontent.com/theforeman/puppet-puppetserver_foreman/master/files/enc.rb > /etc/puppetlabs/puppet/node.rb
curl https://raw.githubusercontent.com/theforeman/puppet-puppetserver_foreman/master/files/report.rb > /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/reports/foreman.rb

# Add config in puppet.conf
reports = puppetdb,foreman
external_nodes = /etc/puppetlabs/puppet/node.rb
node_terminus  = exec

# Create a new configuration file at /etc/puppetlabs/puppet/foreman.yaml 
cat > /etc/puppetlabs/puppet/foreman.yaml << EOF
# Update for your Foreman and Puppet server hostname(s)
:url: "https://foreman.example.com"
:ssl_ca: "/etc/puppetlabs/puppet/ssl/certs/ca.pem"
:ssl_cert: "/etc/puppetlabs/puppet/ssl/certs/puppet.example.com.pem"
:ssl_key: "/etc/puppetlabs/puppet/ssl/private_keys/puppet.example.com.pem"

# Advanced settings
:puppetdir: "/opt/puppetlabs/server/data/puppetserver"
:puppetuser: "puppet"
:facts: true
:timeout: 10
:threads: null
 EOF
chmod +x /etc/puppetlabs/puppet/node.rb

And then i rebuild with the Dockerfile.

Xtigyro commented 2 years ago

Thanks for the proposition, @orelops! Please feel free to send our way a PR - I'll be happy to review and merge it, afterwards. 🙇‍♂️