Skip to content

Instantly share code, notes, and snippets.

@ehelms
Created August 5, 2013 21:34
Show Gist options
  • Save ehelms/6159806 to your computer and use it in GitHub Desktop.
Save ehelms/6159806 to your computer and use it in GitHub Desktop.
Caveats based on the blog post: http://www.emeraldreverie.org/2012/10/creating-development-environment-with.html
This may come in handy - http://lukas.zapletalovi.com/2011/12/setting-hostname-properly-in-fedora-and.html
Step 1:
You can set libvirt's network to assign a static IP to the machine with Foreman on it by adding the following line when editing the network configuration:
<host mac='52:54:00:DE:4B:0A' name='foreman.tardis' ip='192.168.212.2' />
Step 2:
First, install the Foreman nightlies - http://theforeman.org/manuals/1.1/index.html#Development (scroll down slightly to the Nightlies section)
Start with doing a git checkout of the foreman-installer
git clone --recursive https://github.com/theforeman/foreman-installer.git
Make the following changes since this will be turned into a development setup:
foreman/manifests/params.pp
$ssl = false
$foreman_url = "http://192.168.212.2:3000"
foreman_proxy/manifests/params.pp
$ssl = false
$port = 9090 (standard port 8443 clashes with Candlepin)
Now run the installer from the git checkout root:
echo include foreman_installer | puppet apply --modulepath ./
For Fedora, install the Foreman libvirt bindings:
sudo yum install foreman-libvirt
Now, since our intent is to run from a git checkout of Foreman and/or the Katello engine we need to turn off services. Since Pulp requires Apache to be running, we cannot simply shutdown Apache to turn off Passenger and the Foreman server currently running. To get around this, remove /etc/httpd/conf.d/foreman.conf and restart Apache.
rm /etc/httpd/conf.d/foreman.conf
sudo service httpd restart
Note: if you re-run the foreman-installer after this point, you will have to repeat the step above.
At this point I recommend setting up libvirt either with SSH authorization or no authorization. See the blog posting for ssh-key and the beginning of the following for turning off authorization: http://lukas.zapletalovi.com/2013/04/managing-many-servers-with-foreman.html
Next, you'll want to setup and configure a tftp-server on the same box as your Foreman. If your system is not already setup, such as a Fedora box then you can follow the directions found within here - http://lukas.zapletalovi.com/2013/04/managing-many-servers-with-foreman.html. I recommend the testing step, as on Fedora, by default, tftp is disabled even when installing and starting the service.
Step 3:
With newer version of Foreman, the smart proxy needs to be setup before running puppet agent. Make sure you have put an entry into /etc/hosts so that it can resolve the smart proxy from the hostname.
Name: Dev Proxy
URL: http://<your hostname>:9090/
Now you can run the puppet agent:
puppet agent -v --noop -o --no-daemonize
If you set your libvirt to have no authorization, the URL to use for setting up the compute resource is:
qemu+tcp://192.168.212.1/system
Notes:
- If running from the Katello enginify branch, where your Foreman is in test/foreman_app, there is most likely a test/foreman_app/.bundle/config that sets what groups not to install. Within this group you should see libvirt. You'll want to remove this and `bundle install` again to ensure the libvirt gems are loaded.
- In my case, the provisioned machine could not resolve the hostname of the Foreman box, to get around this in the UI, go to the Settings > General page and set the foreman_url to the IP address of the Foreman box.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment