Skip to main content

MAAS Terraform Ansible

Project description

MAASTA (MAAS Terraform Ansible)

GitHub last commit GitHub license GitHub stars GitHub forks GitHub issues

Twitter LinkedIn

Stargaze GitHub Repo stars if you find it useful.

MAASTA is a wrapper to create an Ansible inventory for MAAS instances that are provisioned by Terraform.

This script is used to build an end to end automation DevOps lifecycle.

What is MAAS?

MAAS (Metal as a Service) is a tool to turns real servers into bare-metal cloud. With MAAS, you can automate server provisioning and installing OS remotely on both physical and virtual servers. MAAS.io for more information.

What is Terraform?

Terraform is an infrastructure as code tool which is used originally for provisioning cloud instances on various cloud providers. With Terraform and the aid of the IaC, we can provision machines and cloud instances with codes and without direct human interactions. Terraform is responsible for provisioning systems, usually Immutable ones. Terraform.io for more information.

What is Ansible?

Ansible is another IaC tool but for configuration management. With the aid of Ansible, we can configure a multitude of systems without direct human interactions. Ansible is responsible for configuring existing systems, usually mutable ones. Ansible.com for more information.

Why do we need MAASTA?

Imagine you want to create the DevOps lifecycle for your on-premises infrastructure. In such a scenario, You need the MAAS to interact with your real infrastructure and bring your bare-metal or virtual machines into cloud-like infrastructure. After that, to achieve automation, you need the Terraform tool to interact with the MAAS to provisioning instances and managing them without direct human interactions. When the instances, machines, were provisioned by the Terraform, the time to configuring them comes. For configuring instances, you need the Ansible tool, but how Ansible can discover targets that are provisioned by the Terraform. The answer is MAASTA! MAASTA is used to discover Terraform provisioned MAAS instances and create an Ansible inventory file for them. With the aid of the MAASTA, you can create an end to end automation and integrate MAAS, Terraform, and Ansible together.

See /examples/README.md to get started with brief examples.

Get started guide:

MAASTA accepts two environment variables, MAAS_API_URL and MAAS_API_KEY, and reads the output of the terraform show -json command from stdin. The output of the Terraform is used to find the MAAS machines that are provisioned by the Terraform. MAASTA connects to the MAAS server and reads information (fqdn, hostname, ipaddr) of machines and creates an Ansible inventory for them. The inventory will write into inventory.yaml file.

Installation:

pip install maasta

Usage:

terraform show -json | python -m maasta

How to contribute:

Currently, MAASTA can create inventory for machines that are provisioned with Ubuntu distribution. The script is tested with minimum viable tests and may break in some situations.

Don't hesitate to contribute. In the case of a bug, please file an issue.

Copyright 2021-2022 Saeid Bostandoust ssbostan@linuxmail.org

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maasta-1.0.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maasta-1.0.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file maasta-1.0.0.tar.gz.

File metadata

  • Download URL: maasta-1.0.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for maasta-1.0.0.tar.gz
Algorithm Hash digest
SHA256 92582557a9d18935e69a40315f47940203b88c3981152fcb836a8af3aa8ddc33
MD5 f24ae50a9e14d822ca94f83f34fad4db
BLAKE2b-256 5c7ce6f6216dbca3fb919ac8c622607558ea6cbde3de3a79eadcb72d00d7ed85

See more details on using hashes here.

File details

Details for the file maasta-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: maasta-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for maasta-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0842caa070de5a4daf7869fb997e83340655b56d34bdd1ab77d3f02ef1d73799
MD5 98f95cfa442dc9a789b2b5e795e45ec2
BLAKE2b-256 961aec6b28aaaeb855b762f08313b2b6a1277087a09399592042e3a025d95d26

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page