I’m am new to Foreman, and I have tried to look and find the answer to my question and haven’t been able to find it so I am asking here. Thanks in advance for any direction.
After I have installed Foreman 1.16 and it is up and running and I login I can see things like:
Hosts -> “Installation Media” “CentOs mirror”. I didn’t create this, it came with the install.
How was it added to Foreman?
Hosts -> “Partition Tables” “Kickstart Default” this was part of the install.
Hosts -> “Provisioning Templates” “Kickstart RHEL Default” this was part of the install.
How would I modify or add my own entry on install?
What if I didn’t want any of them? Is there a way not to have them be there on install?
After it is up you can just use the GUI or API. Are the defaults added using the API?
I am using yum -y install foreman-installer and then running the foreman-installer command.
Hey, welcome to the community! Hope we can help you get comfortable with Foreman
We do indeed add a bunch of things to the initial database by default, as most people want to be up-and-running as quick as possible (this cuts down on those “paper cuts” that tend to make people quit before they’ve even got it working ). All the things you’ve mentioned are part of this initial seeding, but it’s actually done directly in Rails rather than via the API (and also consider checking out Hammer, our CLI tool).
There’s no way to disable the initial seeding of data, as far as I know (some of it is necessary for Foreman to function at all, like creating the initial admin login), but once the install is done you’re welcome to modify/delete the entries, or create entirely new ones if you wish. This can be done via the GUI or the API, whichever suits you better.
Ultimately, it’s your instance, after all - if you’re (say) only going to be a Debian shop then deleting all the RHEL/Centos stuff makes perfect sense. We just provide some defaults to get people going, and obviously we can’t predict which of the many OSes we support they’ll want to work with.
If you need any more guidance on specifics of those steps, or want to go into a little more detail on your goals, feel free to shout out.
Great! I wasn’t sure what to call it.
Does the “initial seeding of data” exist is some rpm or is like a script that is part of installing an rpm? I would like to look at the code that does the seeding of data. I know I have changed the initial username and password with a command line argument on the install. Where is the Rails code?
The rpm will install this by default but you might be able to use
foreman-rake and drop the database and reseed it with your own data
without the stuff you don’t want.
Have a look at what foreman-rake might be able to do for you.
I am trying to learn how it all works together and how to quickly stand up Foreman so that is has everything ready to go to start installing servers. I think having all the content that comes with it is good when you are trying to use the tool at first, but it also tends to get in the way in some cases.
I have no intention of hacking the rpm file. I did think about modifying the files once they are installed. I don’t see a reason to do that now.
Others have responded with foreman-rake and the templates plugin which seems like the direction I should head.
An excellent goal - but if that’s all, I’d strongly avoid using foreman-rake to drop the DB. As I said, some of those seeds are required for proper operation, and trying to mess with them or partially seed the DB may lead to unintended consequences. Using the API or GUI, and plugins like foreman-templates, is definitely the way to go.
foreman-rake templates:export repo=/tmp/template
And I get partition_tables_templates provisioning_templates
Is there a way to get things like Subnets and Domains and Installation Media and Operating Systems?