Smartproxy

Puppet

API

Getting puppet server state...

[root@foreman01 ~]# curl -s --cert /etc/puppetlabs/puppet/ssl/certs/foreman01.build.pem --key /etc/puppetlabs/puppet/ssl/private_keys/foreman01.build.pem -kL https://puppet.build:8140/status/v1/services | jq '.["status-service"]["state"]'
"running"

...and active alerts

[root@foreman01 ~]# curl -s --cert /etc/puppetlabs/puppet/ssl/certs/foreman01.build.pem --key /etc/puppetlabs/puppet/ssl/private_keys/foreman01.build.pem -kL https://puppet.build:8140/status/v1/services | jq '.["status-service"]["active_alerts"]'
[]

Import only specific classes

Create file /usr/share/foreman/config/ignored_environments.yml

:filters:
  - !ruby/regexp '/^(?!roles::|foreman_scap_client).*$/'

Refresh puppet classes

To be triggered from Jenkins for autodeploy after tests

/usr/local/bin/r10k deploy environment -pv
/usr/bin/hammer proxy import-classes --id 3

To get the puppet smartproxy id, hammer proxy list, to check result, hammer puppet-class list