I would have expected to find more information about adding an existing
host to Foreman. The only things that I've been able to find are a ruby
script that I can't get to work (
https://github.com/lzap/foreman-client-tools), and a script created as part
of this installer script
https://github.com/ohadlevy/astapor/blob/master/foreman_server.sh from
which I assumed I could do this in Fedora
rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-fedora-20.noarch.rpm
<http://www.google.com/url?q=http%3A%2F%2Fyum.puppetlabs.com%2Fpuppetlabs-release-fedora-20.noarch.rpm&sa=D&sntz=1&usg=AFQjCNH6nyYosMmpnYKFFmjFB2uEK9pb4A>
yum install -y augeas puppet git policycoreutils-python
augtool -s set /files/etc/puppet/puppet.conf/agent/server foreman.domain.net
augtool -s set /files/etc/puppet/puppet.conf/main/pluginsync true
augtool -s set /files/etc/puppet/puppet.conf/agent/listen true
if ! grep -q -P '^path /run' /etc/puppet/auth.conf; then
perl -0777 -p -i -e 's/\n\n((#.*\n)path /\s\n)/\n\npath /run\nauth
any\nmethod save\nallow foreman.domain.net\n\n$1/' /etc/puppet/auth.conf;
fi
puppet agent --test
but that just results in the error:
Info: Creating a new SSL key for client.domain.net
Error: Could not request certificate: getaddrinfo: Name or service not known
Exiting; failed to retrieve certificate and waitforcert is disabled
This error is probably related to the PuppetCA which in my case is the same
host as Foreman. I'm okay with going in and dealing with the certificates
for the master and agent manually if that's what you're supposed to do, but
I don't know if that's something that Foreman prefers to take control of
and I'd rather not break everything again.
Am I missing something? Is there a document somewhere that describes this
workflow?
Thanks,
Geoff