31

If I use something like Ansible or Puppet, and I only have two servers, is that defeating the purpose of using these products? I thought that if I configured one server, I could use one of these to duplicate it on the other.

johnny
  • 2,268
  • 9
  • 35
  • 54

2 Answers2

42

Nope, it's not defeating the purpose. I, in fact, use Ansible to set up single servers for hobby/side-project use quite frequently. It allows me to keep a version-controlled, repeatable, self-documenting configuration for the server.

ceejayoz
  • 32,469
  • 7
  • 81
  • 105
  • My understanding is it is like the "old" days. You setup a machine, put all your stuff on it you need, and instead of imaging it, you use the CF software to do it on-the-fly. This means I'd have Docker or whatever installed and configured and then run Ansible. – johnny Nov 30 '16 at 20:46
  • 7
    @johnny Not quite. You determine what you need on the machines then build the plays/roles/recipes which get the machines into that state. One of your Ansible roles should be installing and configuring Docker. You don't actually configure the machines "by hand". Also, Ansible is _way_ lower of a barrier for getting started. All you need is working ssh/python. – jscott Nov 30 '16 at 20:49
  • 5
    Honestly, the overhead of getting started with a CM system when you have just two servers is high, but I believe, worth it. And like jscott said, you make you let the CM system configure your system entirely, and don't install anything by hand if you can help it. – Mark Henderson Nov 30 '16 at 20:53
  • 1
    @MarkHenderson for puppet id agree. for ansible the overhead really is not that high, although if it's the first time you've ever used ansible then yea it could be. – Sirex Nov 30 '16 at 21:28
10

I have to disagree with the current consensus. In no way can it be reasonable to learn any CM system for a pool of 2 servers, unless you simply want an excuse to learn that CM system. The amount of time you spend learning, writing, testing, and applying the config, will definitely exceed the hand built time. If you knew one of those systems, it's a much more reasonable proposition.

Jim B
  • 23,938
  • 4
  • 35
  • 58
  • 7
    "The amount of time you spend learning, writing, testing, and applying the config, will definitely exceed the hand built time." Initially? Yes. When a server breaks, gets compromised, needs to be handed over to someone else to maintain, etc.? Not so much. – ceejayoz Dec 01 '16 at 03:00
  • 9
    While I can't disagree with the time it takes to learn one, you probably have far more time to do that when you have two servers than when you need a CM right now to build 10 more. A CM isn't strictly for managing large pools of resources, it's for easily repeating processes in a consistent way. You're in a much better situation if you fsck something up if you can do a reinstall (or a new install in case of hardware replacement) and run one command to get it back to a known working state. My rule of thumb is if I have to do it more than once, no I don't. I'm doing it in puppet. –  Dec 01 '16 at 03:11
  • 3
    Actually, I think you are not disagreeing - you are just (correctly) pointing out that there is a tradeoff involved - more time for initial setup, but easier management later. – sleske Dec 01 '16 at 08:44
  • 1
    I agree, in fact all too often I see "why don't you use Chef..." without any thought as to the explosion in infrastructure (and hence costs) that will result. The exception is for where the servers are provided by a third party or are imaged based upon an external maintenance level. – mckenzm Dec 02 '16 at 05:19
  • @mckenzm I wouldn't use something like Chef/Puppet for two servers, but I'd happily use Ansible for it. No extra infrastructure, and a simple Ansible script can read very much like a step-by-step bash script. – ceejayoz Dec 02 '16 at 14:59
  • @ceejayoz so in your world the time to build a server would include the time to learn ansible (or X- choose your poison). But you've made my point - If you already know it- why not use it. If you don't - it's not worth the time. – Jim B Dec 02 '16 at 17:19
  • @yoonix "you probably have far more time to do that when you have two servers than when you need a CM right now to build 10 more" quite possibly or you'd get fired for taking a week to build 2 servers that should have taken a day. The question isn't on the value of using or knowing a CM tool, the question is, is it worth it. It would be simpler (if these were duplicate builds) to build 1 then use clonezilla to copy and deploy the second. I think you're also proving the point- if your break even number is 10 machines to recoup the time it took to learn 2 isn't worth it – Jim B Dec 02 '16 at 17:27
  • 2
    Think of it another way: if you build those two systems by hand, you would have to document everything you do for initial setup, every change to the system over it's life time so you or someone else in your absence is able to rebuild the system in case of emergency. This takes time, too. Learning basic puppet, chef or ansible isn't hard and does not take a huge amount of time. Keep in mind: you would not need advanced features of any cm for two servers. – Phillip -Zyan K Lee- Stockmann Dec 02 '16 at 17:34
  • 1
    @JimB I disagree pretty vehemently on the "it's not worth the time" bit. – ceejayoz Dec 02 '16 at 18:21
  • @ceejayoz I've been in plenty of places where telling someone in charge that it's going to take you a week to build 2 servers (already raced and stacked) because you need to learn how to build them is a career fatal move. It's quite possible you might convince the mgmt of all the benefits of the extra time, but realize you're then betting your job on that sales pitch. – Jim B Dec 02 '16 at 18:32
  • @JimB It took a matter of hours to learn the absolute basics of Ansible. "Install these packages, then copy this config file to here, then restart this service" - it winds up reading like a simple bash script. It needn't take a week, and it serves as a form of documentation. Management saying no doesn't mean it's not worthwhile - bad management exists everywhere. – ceejayoz Dec 02 '16 at 18:42
  • @ceejayoz taking 3 hours to do a 30 min task is most certainly not worth the time- whether you're in management or not. Again, it might be personally valuable and/or valuable down the road- but not for 2 servers. – Jim B Dec 02 '16 at 19:03