Developer Tools63k+ stars

Ansible

Simple, agentless IT automation

Commit Details

Message
"Initial commit"
Author
Michael DeHaan
Date
2012-03-06
Hash
f31421576b00f0b167cdbe61217c31c21a41ac02

Fun Fact

Michael DeHaan named Ansible after the faster-than-light communication device in Ender's Game. Red Hat acquired Ansible in 2015 for $150M.

</>First Code

Python
#!/usr/bin/python

"""
Ansible - Simple IT Automation

(C) 2012, Michael DeHaan <michael.dehaan@gmail.com>

Ansible is an extra-simple Python API for doing 'remote things'
over SSH.
"""

import os
import sys

class Runner:
    def __init__(self, host_list, module_name, module_args):
        self.host_list = host_list
        self.module_name = module_name
        self.module_args = module_args
    
    def run(self):
        # The magic: agentless, SSH-based automation
        results = {}
        for host in self.host_list:
            results[host] = self._execute(host)
        return results