Is opscode chef the right solution for my task? - ruby

I have a network with 10+ Windows boxes. I need to be able to automatically reconfigure them all in the certain way:
Install Java SE Development Kit 7u79
Set up startup script .bat on all clients (Win boxes).
Set up script .bat to perform each 6 hours or at 03:00 every day.
Install FF v.30-40 in folder C:/firefox/official/ff-v.X, where X is the version
I have Ubuntu 14.04 as a server: 192.168.122.100. Win boxes are 192.168.122.150-160. All required exe, msi will be located at 192.168.122.100/files/win/
The question: Is opscode chef the right solution to achieve the result or should I consider other ways?
PS: I don't have an experience as administrator and I don't have time to investigate all of the approaches myself. Currently I'm working to set up this system myself, but I still not sure if this is right investment of time in my case.

Well, Chef can do all of the task you've listed above.
For installing JDK 7 just use windows_package resource (important: remember to download cookbook windows from Chef Supermarket. It looks like this:
windows_package name do
source src
action :install
installer_type :custom
end
And remember, that - on Windows systems - variable name should be actual name of package. You can check names in Control Panel (for example, JDK 7.79 has name Java SE Development Kit 7 Update 79).
Firefox can be installed in the same manner.
Setting batch scripts can be done in multiple ways - creating them with template resource and just execute them with another resource (powershell_script or execute). You can also implement built-in batch files as batch resource.
Always try to find implemented cookbook for your tasks - in Supermarket. If there aren't any you are looking for, you have to write your own cookbook. Since you are not asking for this, I won't write here any long tutorial, but instead will just redirect to Chef Docs.
Chef can download resources from server, so this is not a problem.
In the Internet you have also many tutorials of setting server-client Chef, but I would recommend you testing your cookbook with chef-client in --local mode first -in this mode you do not need to have any server running.
Learning Chef isn't easy nor hard - it all depends on quality of tutorial and - to be honest - many of them are just... Hard-to-understand-written. Setting environment with automatic tool is always nice idea, but you have to think if you really need this - if writting cookbook will give you many free hours in reinstalling Windows, it is for sure worth it.
Let me know if you need more informations.

Related

Remotely installing msi on different windows nodes?

I have an MSI I want to occasionally install on remote windows nodes in my cluster. What is the easiest and least overhead way of doing this?
I've looked into chef, but it seems like I need an entire server just to manage different nodes.
Chef's windows_package resource is used to install MSIs. If you're on a very old version you might need the windows cookbook for it, but we pulled MSI support in maybe ~12.0 I think? Check the release notes if you have to be certain, but anything remotely recent has it in core.

is Vagrant suitable for beginners that are not tech savvy?

I'm planning to teach a group a people how to setup a website using WordPress. Those people have some basic computer usage knowledge : they can surf the web, write emails, install software on their computer, ... But they are absolutely not developers. And the training does not aim to teach them development.
But I want them to be able to setup a fully working local web environment or their computer that runs on Windows. I was planning to use XAMPP, but I'm wondering if Vagrant is not more suitable. I could prepare a box with a lot of tools already included, and they will just have to install it. Interaction with the server would take place only via http and FTP (no ssh needed).
Is it possible to create a batch file that they can click on to launch the Vagrant ? If properly configured, is that as easy to use as that for absolute beginners ?
from what you describe there is almost no vagrant thing, you would be responsible to make the vagrant box and the vagrantfile, and you will not expose your students to vagrant. only thing is that they would need to have this bat file on their desktop (the only command that it will need to run is vagrant up, make sure to expose the vagrant cwd variable) and the server will be up and running.
The main advantage I see then is that you will completely make your students in the same situation they will be with their production system. they will face the same tool (FTP, wordpress admin ...) on an environment (more or less) identical to a production environment.

Provision Developer Workspace + IDE inside Virtual Machine

I'm trying to automate the provisioning of our developer workspaces which are based on Linux running in a Virtualbox. We also run the IDE inside the Virtualbox. The host system is Windows 7.
The new solution will install the required dependencies (C libraries) and install + pre-configure the IDE (plugins, code formater).
I'm wondering if Vagrant would be the tool of choice for this task. I am irritated since the Vagrant philosophy seems to be: easy provisioning of a dev/test server but running the IDE on the host - not inside the guest. The latter is not an option for us.
What tooling would you recommend for our purposes?
This is the answer to my question. I eventually went for Vagrant.
This simple switch let the normally hidden Virtualbox GUI appear:
v.gui = true
More details here: https://docs.vagrantup.com/v2/virtualbox/configuration.html
My experience with the solution was generally ok. I got my recipes version controlled as wanted. However, the feedback loop was quite long. To build the box with all my customization it took me about 7 minutes which was usually wasted waiting time. When changing a little bit I could try to execute just the changed scripts but to see the whole thing I had to rebuild the box - another 7 minutes wasted waiting.
I am currently trying to understand how in the world of infrastructure as code you still get acceptable feedback loop (let's say below one minute). I assume this is where you enter the world of configuration management with tools like Ansible or Puppet.

Vagrant. VM after provisioning

I tried to adopt Vagrant in our team. I created a Vagrantfile and make provisioning in some way. Everything works as charm, but ...
It's unclear for me how I can automate some routine tasks like:
running django(I use django, but it's framework agnostic problem) dev server on 0.0.0.0
running grunt watcher
providing a separate console for django-specific commands
It is looks like vagrant not intended to help with this kind of automation and I look for some community adopted way to do that. I goggled and found nothing.
I see a few way to that:
bootstrap.sh script but messy and hard to mantain
something like tmuxinator -- requires tmux on host machine and now it's impossible to put tmuxconfig in project repo
etc
What is the 'canonical' way to resolve this problem?
P.S.: Please, think about designers, manual testers and other guys which like to use tools as is
In general you are best off using a provisioner. To be honest, a bootstrap.sh file is a good place to start unless you want to learn the ins and outs of something like chef / ansible / salt / puppet. If you do you might want to start at salt (SaltStack) because it is written in python which I'm guessing you use given the django angle.
For your specific questions:
Part of the point of vagrant is it lets you develop against real stacks and real web servers so you can avoid the "oh, that don't quite work the same on apache" moment that often comes in projects. So for your first question I would look at how to provision the app behind apache / nginx or whatever you are using for the production web servers.
Because of the shared file systems users can just run grunt locally on the host machine. This also lets grunt do things like hook into OSX notifications.
I'm not familiar with tmuxinator so I'm not sure how to start here. But if it is a service that the server really runs then you should figure out a way to package the install and deploy it to the provisioned VM. As for configuration, is it possible to get a dev config in the repo?
Same as #Wyatt, I recommend use Vagrant with provision tools, such as puppet, saltstack, chef, anisble, etc. These tools are created for the requirements you ask for, and most are open source. Choice is no wrong, you can start learning from any one, they are similar.
With that, you can quickly and easily run several VM servers with all applications installed automatically. With the customised Puppet codes or chef cookbooks, you can update them any time and provision to VM easily, you can re-use them for your PROD environment as well.
Take some times to learn one of these automation tools first, you will get benefit to save a lot of time.
I use Puppet, and recommend the best puppet book PRO PUPPET to you. It has all you need.

Using Chef Solo to provision a Windows EC2 instance and bootstrap it

I'm trying to automate our CI process for a couple of .NET apps, and in a perfect world I'd like to spin up a Windows EC2 instance for each, bootstrap the instance to install Chef Solo and then execute a Chef recipe to install some dependencies and the packaged software itself.
However - I'm a novice and have no idea even if that is feasible let alone where to start :)
I'm fairly well versed with the command line tools for AWS so can spin up an AMI ok, but beyond that point I'm pretty stuck. I would like to avoid building a custom AMI with chef pre-installed as that takes a lot of the advantages away.
I think this is essentially what I need to do - but is (unsurprisingly) focused on Linux:
http://www.opinionatedprogrammer.com/2011/06/chef-solo-tutorial-managing-a-single-server-with-chef/
Does anyone have a link to someone who has done this or similar before? Or a better way of achieving what I'd like to do?
Any help appreciated.
Okay, this requires that you have Chef preinstalled on your AMI:
http://scottwb.com/blog/2012/12/13/provision-and-bootstrap-windows-ec2-instances-with-chef/
But this is a strategy for installing Puppet to a stock Windows AMI, which could easily be modified for Chef:
http://dansrandombits.blogspot.com/2012/06/bootstrapping-custom-windows-ec2.html
I can't say I've done this yet, but I've both in my bookmarks bar since they was posted and have been planning on giving it a shot in at least our dev environment at some point. It seems like as long as there's a solid silent install for Chef, you could pull this off.
I realize this post is a bit old, but for those that still may come across this. I'm provisioning servers using Chef-Solo. Essentially I configure the User-Data of the instance to download and install Chef, download the cookbooks/recipes, and then launch Chef-Solo.
Here's a blog post I've made to demonstrate the steps: http://thesysadminswatercooler.blogspot.com/2015/11/aws-bootstrap-windows-ec2-instance-with.html

Resources