Configure Foreman

  1. Bring /etc/foreman under git control

    Act as with /etc/puppet

  2. Configure foreman

    /etc/foreman/settings.yaml

    ---
    #your default puppet server - can be overridden in the host level
    #if none specified, plain "puppet" will be used.
    #:puppet_server: puppet
    :unattended: true
    :puppetconfdir: /etc/puppet/puppet.conf
    :login: true
    :require_ssl: false
    	  

  3. Configure the database connection

    /etc/foreman/database.yml

    production:
      adapter: postgresql
      database: puppetdb
      username: puppetdb
      password: 6QuI4O9aSyJDFkxpQrJ6sTRiHRsZuKmpMd5CVkNy
      host: localhost
      encoding: unicode
    	  

    /etc/default/foreman>:

    START=yes
    	  

  4. Configure foreman-proxy

    /etc/default/foreman-proxy:

    DAEMON_USER="foreman-proxy:foreman-proxy"
    DAEMON_HOME="/usr/share/foreman-proxy"
    DAEMON_ARGS=""
    	  

    /etc/foreman-proxy/settings.yml:

    ---
    # SSL Setup
    
    :trusted_hosts:
    - localhost
    - foreman.service.rug.nl
    
    # enable the daemon to run in the background
    :daemon: true
    :daemon_pid: /var/run/foreman-proxy/foreman-proxy.pid
    
    # port used by the proxy
    :port: 8443
    
    # Enable TFTP management
    :tftp: false
    
    # Enable DNS management
    :dns: false
    
    # Enable DHCP management
    :dhcp: false
    # The vendor can be either isc or native_ms
    :dhcp_vendor: isc
    
    # enable PuppetCA management
    :puppetca: false
    
    # enable Puppet management
    :puppet: true
    
    # Where our proxy log files are stored
    # filename or STDOUT
    :log_file: /var/log/foreman-proxy/foreman-proxy.log
    # valid options are
    # WARN, DEBUG, Error, FATAL, INFO, UNKNOWN
    :log_level: INFO
    	  

  5. Use mod_passenger

    (This here only for reference, it works, but I didn't actually use it this time.) /etc/apache2/sites-available/foreman

    <VirtualHost *:443>
        ServerName puppet.servers.mydomain.com
     
        RailsAutoDetect On
        RailsEnv production
        DocumentRoot /usr/share/foreman/public
     
        # Use puppet certificates for SSL
        SSLEngine On
        SSLCertificateFile /etc/foreman/ssl/public/cert-11048-puppet.servers.mydomain.com.pem
        SSLCertificateKeyFile /etc/foreman/ssl/private/1353341774-key
        SSLCertificateChainFile /etc/foreman/ssl/public/chain-11048-puppet.servers.mydomain.com-3-AddTrust_External_CA_Root.pem
        SSLCertificateChainFile /etc/foreman/ssl/public/chain-11048-puppet.servers.mydomain.com-2-UTN-USERFirst-Hardware.pem
        SSLCertificateChainFile /etc/foreman/ssl/public/chain-11048-puppet.servers.mydomain.com-1-TERENA_SSL_CA.pem
        #SSLCACertificateFile /var/lib/puppet/ssl/certs/ca.pem
        #SSLVerifyClient optional
        SSLVerifyClient none
        SSLOptions +StdEnvVars
        SSLVerifyDepth 3
    </VirtualHost>
    	  

    (Getting the actual certificates is not documented here.)

  6. Starting Foreman

    Foreman fails to start

  7. Populating the database

    I tried

    Then I tried:

  8. Fixing types in the Postgres DB

    Use a bigint if an integer doesn't cut it...

  9. Try to import data into Foreman

    The GUI just saye there's an error, so we try the command line for more verbosity:

    [Note]Note

    without the [batch] it breaks even sooner.

    At this point I gave up.