Skip to main content

Environment configurator for the distributed systems

Project description

About The Project

Environmentconf is a python based tool to configure remote environments. Remote environments can be remote virtual machines or Docker containers.

Built With

Getting Started

To run the tool on your machine please follow these steps-

  1. Make sure you have Python 3.6 or higher installed on your machine
  2. Install environmentconf using pip. e.g. pip3 install environmentconf
  3. Once tool is installed you are ready to use it. e.g. python3 -m environmentconf.envconf_manager --apply config_path=<valid absolute path which contains configs>

OR

If you are running Ubuntu based system then use the bootstrap.sh which is at the root of the project to perform all the steps mentioned above.

Prerequisites

Tool requires Python 3.6 or higher and pip to install tool.

  • Install
    apt-get install -y python3-pip
    

Installation

  1. Pip install
    pip3 install environmentconf
    

Usage

Tool needs two configuration files

  1. Create a directory where we will put all the configs.
  2. Create file named environments.yaml. This specifies all the environments which needs to be configured.
---
group1: #group of machines
  environments:
  - ip: 1.2.3.4
    connection_type: ssh
    tags:
      - region: us-east-1
      - account_id: 123
  - ip: 1.2.3.5
    connection_type: ssh
    tags:
      - region: us-east-1
      - account_id: 123
group2: #grop of docker containers(unit testing or if remote env is composed of docker)
  environments:
  - id: e6d3a73ff6c2 #id of the docker container
    connection_type: docker
  1. Create file named configurations.yaml. This specifies set of configurations we need to perform on target environments. For example, if we want to configure remote environment to host php using Apache web server then this is how we compose the configuration file.

Note that hosts property targets the group defined in environments.yaml. You can have multiple environments in environments.yaml file for which you can run different set of actions specificed in configurations.yaml.

---
- hosts: group1
  actions:
  - name: install_apache2
    executor: package
    action: install
    args:
      name: apache2
  - name: install_libapache2-mod-php
    executor: package
    action: install
    args:
      name: libapache2-mod-php
  - name: copy_index_php
    executor: artifact
    action: copy
    args:
      source: /Users/someuser/code/index.php
      destination: /var/www/html/
  - name: delete_index_html
    executor: artifact
    action: delete
    args:
      destination: /var/www/html/index.html
  - name: Start the apache2 server
    executor: process
    action: start
    args:
      name: apache2
      subscribe:
        - install_apache2
  1. Now, we are all set to configure the remote environment (considering tool is already installed on machine). Grab the absolute path of the directory which contains the above yaml files. Run environmentconf using this command-
python3 -m environmentconf.envconf_manager --apply config_path=<valid absolute path which contains configs>

We can also use docker to test the tool.

  • Make sure you have Docker installed on your machine.
  • docker pull ubuntu:18.04
  • docker run -it ubuntu:18.04 bash
  • Copy/Create bootstrap.sh file in docker container and then run it.
  • You are all set! Go run
python3 -m environmentconf.envconf_manager --apply config_path=<valid absolute path which contains configs>

Architecture

Read more about tool's architecture here

License

Distributed under the MIT License.

Contact

Maulik Patel

Project Link: https://github.com/maulik887/environmentconf

Project details


Release history Release notifications | RSS feed

This version

0.8

Download files

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

Source Distribution

environmentconf-0.8.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

environmentconf-0.8-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file environmentconf-0.8.tar.gz.

File metadata

  • Download URL: environmentconf-0.8.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.8.0 tqdm/4.59.0 CPython/3.7.3

File hashes

Hashes for environmentconf-0.8.tar.gz
Algorithm Hash digest
SHA256 3e0be67113f390838856fe067b8d1a0a26ffb7affccb882d73b6f7c71a10a314
MD5 4522ad4cc6a8a9752b5780cff5f0d5a5
BLAKE2b-256 44f2c011eac607c4b4a6512a39b3afafafa473788160433e94aa8e22c32919ad

See more details on using hashes here.

File details

Details for the file environmentconf-0.8-py3-none-any.whl.

File metadata

  • Download URL: environmentconf-0.8-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.8.0 tqdm/4.59.0 CPython/3.7.3

File hashes

Hashes for environmentconf-0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 693ed931a8f9e8b4b6d532e55cfc18dec74f42f967e07248712cd874bd7c3255
MD5 cb11c4ac3088e1920512e46c6690f9bb
BLAKE2b-256 02312cc832188d047eae75a43c6d5309588fabc80d2036c030264ce1da4915b1

See more details on using hashes here.

Supported by

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