Giter VIP home page Giter VIP logo

infraform's Introduction

InfraForm

Build Status

Unified interface for automation cross different technologies and platforms. Infraform allows you to:

  • Run common built-in operations (aka scenarios) or write/provide your own and let Infraform handle the execution
  • Use templated scenarios - one scenario, many ways to render it
  • Execute scenarios locally or on remote host(s)
  • Make use of different technologies to run the scenarios - Ansible, Python, Terraform, Podman, Docker, ...
  • Adjusts the host accordingly it it isn't ready to run the chosen technology (Ansible, Terraform ...)

With Infraform it's really all about ease of use. Infraform not only let's you use the same interface to run all these different technologies but it also supports templating which allows you to re-use the same scenarios for different purposes (e.g. staging and prod environments)

Hope you'll enjoy using it and if not, let us know and open an issue :)


Requirements

  • Linux (developed and tested on Fedora)
  • Python>=3.7

Installation

git clone https://github.com/bregman-arie/infraform && cd infraform
virtualenv ~/ifr_venv && source ~/ifr_venv/bin/activate
pip install .

Usage Examples

List Scenarios

ifr list

Scenarios

Scenario file is one that ends with .ifr or ifr.j2 suffix. It uses the YAML format with the following directives:

description:  # the description of the scenario
platform:     # the platform or tool to use (e.g. terraform, ansible, shell, python, etc.)
files:        # the files to copy to the workspace to be used during the execution of the scenario
 - file1
 - file2
 - directory1
vars:         # variables which will be used for executing the scenario
  x: 2
  y: 'value'
dockerfile: | # used for building an image and running a container using that image
 ...

Infraform provides you with a couple of built-in scenarios you can list with ifr list
To see the content of scenario, run infraform show <scenario_name>

Read more about "Scenarios" here

Supported platforms and tooling

InfraForm is able to execute using the following technologies

Name Comments
Terraform Provision infrastucture using Terraform HCL files
Podman Run containers using Podman
Docker Run containers using Docker

Possibly too detailed workflow

The following is a description of what InfraForm does when you run a scenario

  1. Validates the scenario you've specified exists (the .ifr file)
  2. If a workspace already exists (.infraform/<SCENARIO_NAME>) it removes it. A new workspace is then created
  3. Iterates over the hosts specified (if not specific, then it uses localhost)
  4. Checks if a workspace (.infraform/<SCENARIO_NAME>) directory exists already on the remote host. If it exists, it removes the entire directory
  5. Creates a workspace (.infraform/<SCENARIO_NAME>) directory on the remote host
  6. Copies the scenario file (.ifr) and all the related content to the directory on the remote/local host
  7. Checks the host is ready for executing the scenario by running chosen platform check command(s)
  8. If check command fails, it will ask the user whether to run commands to fix the check result 1. If user replied with 'y', it will start executing installation commands based on the chosen platform 2. If user replied with 'n', it will exit with return code different than 0
  9. Runs possible pre-commands. This depends highly on the platform used
    • Terraform -> terraform init
    • Podman -> Possibly build an image before running container
  10. Executes the scenario using the platform default run command (e.g. Terraform -> terraform apply)

Contributions

To contribute to the project, use GitHub pull requests.

infraform's People

Contributors

bregman-arie avatar eduolivares avatar yazug avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

infraform's Issues

Add CI

Validate each pull request with functional, unit and styling tests

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.