EzDevInfo.com

configuration-management interview questions

Top configuration-management frequently asked interview questions

How to read system.web section from web.config

Should be simple, but whatever I try returns null:

const string key = "system.web";

var sectionTry1 = WebConfigurationManager.GetSection(key);

var sectionTry2 = ConfigurationManager.GetSection(key);

I'm sure I have done this before.

I am using MVC if this makes a difference.


Source: (StackOverflow)

How do you handle command line options and config files?

What packages do you use to handle command line options, settings and config files?

I'm looking for something that reads user-defined options from the command line and/or from config files.

The options (settings) should be dividable into different groups, so that I can pass different (subsets of) options to different objects in my code.

I know of boost::program_options, but I can't quite get used to the API. Are there light-weight alternatives?

(BTW, do you ever use a global options object in your code that can be read from anywhere? Or would you consider that evil?)


Source: (StackOverflow)

Advertisements

salt stack: grains vs pillars

In the Salt system there are grains and pillars. I understand how I can assign custom grains, but when would it be better to consider using pillars?


Source: (StackOverflow)

Should I create a new branch for every new bug that gets reported?

We use a JIRA as our ticket system. New bugs/tickets are submitted to that system. Once a bug is fixed, we create a new build and test it on our dev server. If everything is good we push it to the live server. Now I usually work on the trunk without any branching to fix the bugs. This is of course a problem. Because there can be many bugs in our system, but only certain ones get fixed at a time. However if I fix all of them in the trunk instead of a branch, then we are forced to test them all even if we did not had enough time to test them all. How do you usually fix bugs and branch etc..? (I am not sure if I explained it very well).


Source: (StackOverflow)

Vagrant provision live output

Is there a way to get Vagrant to display the output of the provisioning tool as it runs, rather than just at the end? I'm using the Ansible plugin if that matters.

Vagrant appears to run the entire config.vm.provision section collecting the output, only displaying it once everything has completed.

This causes problems such as when a step in the process hangs or when you want to have interactive steps that involve the user.


Source: (StackOverflow)

UK Vat change from 17.5 to 15% - How will this affect your code?

The UK VAT system is changing from 17.5% to 15%. What strategies have you used in your code to store the VAT, and how will the change affect your applications. Do you store a history of vats so you can calculate old prices, or are old invoices stored in a separate table? Is it a simple config setting, or did you bodge it? What's the ideal way to store VAT?


Source: (StackOverflow)

How to get a list of all salt minions in a template?

Basically I am creating a Salt state describing Munin server configuration and I need to get a list of all minions known to the master, something like this:

{% for host in pillar['munin_clients'] %}
[{{ host.fqdn }}]
    address {{ host.ip }}
    use_node_name yes
{% endfor %}

The only difference is that I don't want to use pillar for that, I need this list to be populated dynamically. ret.get_minions seems to be relevant but I can't make it work for some reason. What are my options?


Source: (StackOverflow)

How to iterate over an array in Puppet

I would like to iterate over an array that is stored as a Facter fact, and for each element of the array create a new system user and a directory, and finally make API calls to AWS.

Example of the fact : my_env => [shared1,shared2,shared3]

My Question is how to iterate over an array in puppet ?

I've tried the Ruby DSL but haven't succeded yet to get it work... Thanks !


Source: (StackOverflow)

Configuration Management for Windows [closed]

Are there any tools for windows like that *nix world has? I am looking for something like Chef or Puppet.

I have found cfEngine but it still looks very *nix centric. Ideally it would be open source, and command line driven.

The idea is to put together an automated infrastructure with windows based servers. Our current IT department does not allow non-windows servers.


Source: (StackOverflow)

TFS vs SVN [closed]

I am about to start a project (.NET) and need to decide between TFS and SVN.

I am more used to SVN(with tortoise client), CVS and VSS. Does TFS have all features available in SVN

Have any of you switched from SVN to TFS and found it worthwhile?
Also it looks like we may need Visual Studio if we need to work with TFS.

[Edit]
Money is not a consideration since we already have the licenses for TFS in place. And I am more interested in the Source Control features of TFS vs SVN, of course other features list is also welcome.


Source: (StackOverflow)

Best practices for sharing ansible playbooks in a private team? [closed]

I'm investigating migrating our current chef based configuration management to ansible.

We build a lot of rails apps that have similar dependencies (ruby, unicorn, nginx, monit, MySQL etc).

So at the moment we're using librarian-chef and private github repos to share our common recipes between the different projects.

I'm new to ansible, the closest thing I've found is ansible galaxy but that seems to be an "out in the open" style thing.

What's the common / best practice for this in a private environment?

Git submodules is the only answer that comes to mind, but it'd be nice to have something a little more automatic like we're used to in the chef world.


Source: (StackOverflow)

Manage configuration files across environments

How do you (your company) manage the config-files of the apps/systems you build? Let me tell you how we do it, and what the problem is.

I'm working at a company where we develop software with about 15 developers. We build line-of-business web apps that are deployed at our managed hosting provider. One of our main apps consists of one web site and about ten WCF services. Some of the services are connected to each other.

I don't know if this is a big system, or small, but my opinion is that is takes us way too long to get things up and running in our different environments (test, acceptance and production).

We have config-files per environment in our Visual Studio projects. So a web.test.config, a web.acc.config, a web.prod.config and a web.config for development. They all have the same keys in them, but the values can be different, depending on the environment they are meant for.

If I do a quick count of the appsettings in the web.config for the webapp I count 32. And I count 5 endpoints. We have four environments (dev, test, acc and prod) this means 128 appsettings and 20 endpoints in total for one web app. We can easily make mistakes, especially when deadlines are closing in. We are all people so things like this happen to everyone: we make a change in a config-file, but forget to check in before we build and deploy. Or we make a change on the webserver and forget to change it also in the four web.configs. Or we Change only three of four config files. And so on. And then we have the infrastructure at our managed hosting provider. By default every port is closed. So if one WCF service needs to talk to another WCF service on a different server, a port has to be opened in a firewall. We do this in Test, but in Acceptance we have to do it again, and we have forgotten which ports have to be opened, so it's more like trial-and-error: oh my service can't connect to the database, probably the port is closed. And the same stuff happens in production again. Our managed hosting provider can take a few days to open a port in a firewall, according to the SLA. So, thuis quickly becomes a pretty long process. And in the end it takes us about two months to have Test, Acceptance and production up and running.

So, my question is: how do you manage the configurations and the infrastructure and the process around it?


Source: (StackOverflow)

Migrate a Source Safe database to SubVersion with history

Folks,

We have a number of Source Safe databases that should be migrated to SubVersion. Is there a (tested and proven) way to migrate them with history ?

Thanks Essam


Source: (StackOverflow)

receiving "error ASPPARSE: Could not load type ..." error with msbuild on MVC webapp

We have CCNET and msbuild creating our regular builds. I am trying to update our process so msbuild creates zipped deployment packages and msdeploy sends them out to the target IIS7 web servers. I was having trouble doing the end to end solution, so for testing I'm trying to just call msbuild from the command line for now. I execute this statement:

msbuild /target:Build;Package /P:Configuration=Staging;OutDir=D:\Builds\Viper.ProdSupport\MSDeployPkg\ /verbosity:diagnostic D:\builds\ViperPortal.ProdSupport\Code\Viper\Viper.UI.MVC\Viper.UI.MVC.csproj

and I get this error:

/temp/global.asax(1): error ASPPARSE: Could not load type 'Viper.UI.MVC.MvcApplication'. [D:\builds\ViperPortal.ProdSupport\Code\Viper\Viper.UI.MVC\Viper.UI.MVC.csproj]

Oh, and for our specs: .NET4, MVC3, IIS7/Win2k8 64bit for web server. Build server is Win2k8 as well, but I'm testing the scripts locally on a win 7 32bit box with ccnet and a full dev config mgmt environment setup locally.

Does anyone have any ideas why I'm getting this error? I read some messages complaining about the aspnet compiler or changing where your bin deploys assemblies to, but none of those seemed to really apply here. I am simply trying to call msbuild, which has been working all along til now. We have a custom msbuild script for our solution. I tried using both that and the mvc csproj file as the build configuration file. Please help! Thanks!


Source: (StackOverflow)

Running mulitple commands in cmd via psexec

I'm working on creating a single command that will run mulitple things on the command line of another machine. Here is what I'm looking to do.

  • Use psexec to access remote machine
  • travel to proper directory and file
  • execute ant task
  • exit cmd
  • run together in one line

I can run the below command from Run to complete what I need accomplished but can't seem to get the format correct for psexec to understand it.

cmd /K cd /d D:\directory & ant & exit

I've tried appling this to the psexec example below:

psexec \\machine cmd /K cd /d D:\directory & ant & exit 

When executing this it will activate the command line and travel to D:\directory but won't execute the remaining commands. Adding "" just creates more issues.

Can anyone guide me to the correct format? Or something other than psexec I can use to complete this (free options only)?


Source: (StackOverflow)