Build linux installer using Chef

I am newbie to CHEF. I started learning Chef as I have to build installation package for Linux like MSI for Windows. I know CHEF can automate service and push the changes to nodes like Puppet, but i have not seen any article or guide for building Linux installation package using Chef. It would be better if there are any link that guide me through the process of building an installer like MSI.

Technically Habitat is supposed to be the packaging solution Chef recommends (for both Linux and Windows). You might want to look into it. They just recently added support for windows.

For Windows packaging/installers, I would recommend learning Wix if Habitat doesn’t meet your needs. This is the language Microsoft uses to create Windows Installers. Nick Ramirez wrote a good book on the topic “WiX 3.6: A Developer’s Guide to Windows Installer XML” (unlike most Packt books, this one is good and covers the topic well. I would say the first edition is better than the update, but they are both good).

Thanks for your input. Is there any specific links for creating installer/package using Habitat for Linux? I started with https://learn.chef.io/modules/hab-patch-source#/ for Habitat. In my case,we are building an analytic application. As a part of final deployment we are planning to install the application using an installer tool.Need to create an installer package like MSI for installing the application in Linux environment.

Food for thought… if you want to just create an installation package for
specific flavor of Linux, you may want to build a native package for it.

For example, build a Debian based package with the tools and guidance
outlined here:
https://wiki.debian.org/HowToPackageForDebian

Once the base software is packaged in this way, then you can use the simple
chef methods for orchestrating the installation alongside the installation
of any other package dependencies.

Let’s separate what you are trying to accomplish here from the solutions offered so far. Why do you want to use Chef to create an installer? What is the goal of that exercise?

I ask because Chef is an automation framework, it’s not quite the right tool to be using to create a package of any sort. You definitely want to look at projects like our own Omnibus or FPM for building packages.

Habitat is a very new thing and while it creates “packages” they definitely aren’t on the same order as what you think of as packages or the goal of the initial question. Habitat is a packaging solution for future looking packaging where the automation travels with the application.

If you’re just starting with Chef, then building an installer based on it is not the best path or even a good one at all. I’d do some reading about the individual solution and figure out which one best fits the needs you have currently.

I was not aware of FPM. That looks like a great tool to dig into!

Thank you. I did look into it. I got it to work also. Then, we ran across an anaconda problem apparently caused by the change to RHEL7 and a special python version.

Looks like this issue is resolved however, so thank you.

CJ

First of all thanks for throwing some lights on Omnibus and FPM. In my case I need to deploy a Web application. My application uses Apache tomcat for deployment,uses Python on scripting part, MySQL as database and Java in the back-end. We are planning to write a Chef cookbook that will download the all above mentioned technologies needed to deploy Web Application and deploy the application. For a Chef non-client we will not be able to deploy. That is the reason we decided to build a package, which on one shot download the necessary technologies needed for the deployment and deploy the application. My question is do we need to create the chef cookbook and then use Omnibus for packaging. Is Omnibus can do the configuration and packaging?

Omnibus is it’s own thing that is completely independent of chef-client. It’s what we use to build the installers for Chef, Chef-server, ChefDK, etc. The goals of a package vs a cookbook are very different so how much you do in one really depends on how you’d like your application to behave. Omnibus is explicitly around packaging, management is something you’d typically leave up to the end user via config or something like Chef but you can do whatever you want since it’s your own package.

tl;dr Omnibus is entirely standalone from chef or cookbooks