How to specify cookbook dependencies based on OS? - operating-system

I am trying to find the best way of managing dependencies which are not available for all OS platforms. Our cookbook is cross-platform, it is aimed at both Linux and Windows systems. One of our recent requirements however, is to add in features that are only needed on Linux.
To do that normally, I would use a 'depends' line in the metadata.rb to specify a separate cookbook as being needed. For example:
depends 'hostfile_edit', '=0.1.2'
Our Chef system is split into two distinct orgs for security reasons - Windows and Linux. However, in this case the "hostfile_edit" cookbook is only available on the Linux org. Hence, when we run rake unit on Windows we get a failure as Chef is unable to reference this other cookbook. The rake unit runs perfectly when run on a Linux system. Similarly, when using the cookbook in a deployment there are failures on Windows, but not on Linux.

The answer lies in metadata.rb file, you can add like this
%w( aix amazon centos fedora freebsd debian oracle mac_os_x redhat suse opensuseleap ubuntu windows zlinux ).each do |os|
supports os
end
You can read more about this are https://docs.chef.io/config_rb_metadata/

Related

Would AIX 7 support Capistrano 3?

Would AIX 7 support Capistrano v3.4.0 (or above) and its dependent scripting tools such as Gem, Ruby, Rake, etc...? and if it does, where could one find a list of supported versions for the dependent scripting tools?
As stated in the Capistrano README, you need Ruby 2.0 or higher. All of Capistrano's gem dependencies are automatically installed when you run gem install capistrano, assuming that your Ruby 2.0 environment is working.
That said, installing Ruby on AIX seems challenging. You may have to compile it from source: Installing Ruby on AIX .
This assumes of course that you want to deploy from AIX (i.e. run the cap command on an AIX machine) as opposed to deploying to AIX (using a Mac, PC, or Linux machine to deploy to an AIX server). If you want to do the latter, you should be fine: Capistrano has no requirements for the server other than sshd.

How to host the OpenStreetMap Locally

I want to host the OSM (OpenStreetMap) locally. I need the basic idea what are required for hosting the OSM and how the task can be done in a step wise manner. I have to host it in Windows7 environment.
Any kind of help will be useful.
switch2osm contains detailed instructions and requirements for setting up a OSM server. If you have a Windows system then better set up a Linux VM inside it.
A bit too old but I will just put it here for someone who is searching for the same thing.
An exact instance of OpenStreetMap can be hosted locally by following the installation guide of OpenStreetMap.
Quoting from the Link:
"These instructions are designed for setting up The Rails Port for development and testing. If you want to deploy the software for your own project, then see the notes at the end.
You can install the software directly on your machine, which is the traditional and probably best-supported approach. However, there is an alternative which may be easier: Vagrant. This installs the software into a virtual machine, which makes it easier to get a consistent development environment and may avoid installation difficulties. For Vagrant instructions, see VAGRANT.md.
These instructions are based on Ubuntu 12.04 LTS, which is the platform used by the OSMF servers. The instructions also work, with only minor amendments, for all other current Ubuntu releases, Fedora and MacOSX
We don't recommend attempting to develop or deploy this software on Windows. If you need to use Windows, then try developing this software using Ubuntu in a virtual machine, or use Vagrant."

Debian packages versus Fabric deployment

What are the pros and cons of using Debian packages to deploy a web application as opposed to using Fabric? I have only ever used Debian packages.
I'm also interested in hearing about problems you've bumped into when using Fabric and you wished you had used Debian packages.
Debian
It is a Package Manager. It allows user to manage packages through various programs like dpkg or apt on a system.
What it does for you :
builds package from source
handles package dependencies, package versions
installs, updates and removes programs on a system
works at low level, compiled binaries maybe system specific (i386, amd64)
Cons :
To deploy the application the configuration must be provided in your package, or some configuration has to be used as default
Different binaries for systems with different architecture
Fabric
It is a Python library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks.
What it does for you :
configure your system
execute commands on local/remote server (systems administration)
deploy your application, do rollbacks, mainly automate deployment through a script
works on a higher level, does not depend on system architecture but on OS and package manager
How do you use pip, virtualenv and Fabric to handle deployment?
Cons:
It cannot replace package manager on a system, it manages packages on top of it
You should know the system, commands folders specific to your package manager / OS
Update
I was already familiar with Debian when Fabric came. So Debian has stayed as my preferable tool. Why I use Fabric, it eases deployment of applications and is handy tool for developers. Here are some reasons why I would use Debian over Fabric:
When I am not going into production, still developing and testing stuff. Debian is suitable most of the time, when code is being added/modified. Fabric just eases the transition from development to production.
Sometimes if I deploy application on my machine only, Fabric seems overkill. If deployment does not involve many machines, requires several dependencies, I would stick to Debian.
When rollback, or undoing is not an option. Fabric will simply execute your commands safe or not, if you are not adept at handling system errors/exceptions, try it somewhere before using Fabric. (Debian is part of system so have to use Debian and other system tools)

postgresql on HP NonStop system

I want to install postgres on HP NonStop J series server.
Can someone who is having experience on similar configuration help me out?
I did not found any postgres libraries/installation packages/patches for NonStop servers.
I am new to NonStop systems but have worked on linux and unix (HP-UX) environment.
NonStop systems provides Open System Services (OSS) environment which is an open computing interface to the HP NonStop operating system and is based on POSIX standards.
Postgres package is available for HP-UX system; can it be configured for OSS environment on Non Stop server ?
You will almost certainly have to compile PostgreSQL - and possibly its dependencies, depending on what's available pre-packaged for HP-UX - from source code. See installation from source code in the docs.
PostgreSQL is pretty well behaved and reasonable to compile, and there's a HP-UX ia64 buildfarm member so builds are tested on HP-UX.

gnome system monitor for solaris

is there any gui tools like gnome system monitor in solaris for monitoring processes? or is it possible to get the gnome system monitor binary pkg for solaris os ?
You don't specify which version of Solaris - recent ones include gnome-system-monitor already.
Additional gnome software for older Solaris versions may be available from various projects that make open source software packages available for Solaris, such as SunFreeware, Blastwave, and OpenCSW
The CDE desktop included in Solaris 2.6 through Solaris 10 also includes a couple of simpler process monitoring tools - sdtprocess and sdtperfmeter.
If you dont mind me asking what is the need for a gui?
the command top will give you everything you need but in a terminal?!?
anyway /usr/dt/bin/sdtperfmeter is on older releases but this WONT give you processes
gnome-system-monitor should be installed on newer releases, and this WILL give you processes.
If the gnome-system-monitor command doesn't work top will.
How about GKrellm? That is popular under the Gnome suite running on Linux.