Coder Social home page Coder Social logo

trellixvulnteam / ansible-cartridge_zp22 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tarantool/ansible-cartridge

0.0 0.0 0.0 28.2 MB

Ansible role for deploying tarantool cartridge-based applications

Home Page: https://galaxy.ansible.com/tarantool/cartridge

License: Other

Shell 1.33% Python 94.22% Lua 3.51% Jinja 0.94%

ansible-cartridge_zp22's Introduction

Ansible Role: Tarantool Cartridge

Ansible Galaxy Releases

Unit Tests Molecule Tests Consistency Tests

An Ansible role to easily deploy Tarantool Cartridge applications.

This role can deploy and configure applications packed in RPM, DEB and TGZ using Cartridge CLI.

Only RedHat and Debian OS families are supported.

Table of contents

Requirements

  • Tarantool Cartridge >= 2.0.0, < 3;
  • Ansible 2.8.4 or higher.

Note that running the role may require root access.

Installation

First, you need to install this role using ansible-galaxy:

$ ansible-galaxy install tarantool.cartridge,1.12.0

Quick start

Check out the Getting Started guide to learn how to use this role.

You can start two virtual machines using example Vagrantfile.

Let's deploy an application with simple topology.

First, pack your application to RPM using cartridge pack rpm command.

Then, describe the topology in hosts.yml file:

hosts.yml:

---
all:
  vars:
    cartridge_app_name: myapp
    cartridge_package_path: ./myapp-1.0.0-0.rpm
    cartridge_cluster_cookie: secret-cookie

    # may be useful for vagrant
    ansible_ssh_private_key_file: ~/.vagrant.d/insecure_private_key
    ansible_ssh_common_args: '-o IdentitiesOnly=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'

  hosts:
    storage-1:
      config:
        advertise_uri: '172.19.0.2:3301'
        http_port: 8181

    storage-1-replica:
      config:
        advertise_uri: '172.19.0.2:3302'
        http_port: 8182

  children:
    # group instances by machines
    machine_1:
      vars:
        # first machine address and connection opts
        ansible_host: 172.19.0.2
        ansible_user: vagrant

      hosts:  # instances to be started on this machine
        storage-1:
        storage-1-replica:

    # group instances by replicasets
    storage_1_replicaset:  # replicaset storage-1
      hosts:  # instances
        storage-1:
        storage-1-replica:
      vars:
        # replicaset configuration
        replicaset_alias: storage-1
        roles:
          - 'vshard-storage'
        failover_priority:
          - storage-1
          - storage-1-replica

Write a simple playbook that imports role:

# playbook.yml
---
- name: Deploy my Tarantool Cartridge app
  hosts: all
  become: true
  become_user: root
  any_errors_fatal: true
  gather_facts: false
  roles:
    - tarantool.cartridge

Then run the playbook with created inventory:

ansible-playbook -i hosts.yml playbook.yml

Now, visit http://localhost:8181

image

Using scenario

It's possible to perform different actions with instances or replicasets by combining cartridge_scenario variable and Ansible limits.

For example, you can configure and start some instances. To do this, you should define cartridge_scenario variable like this:

cartridge_scenario:
  - configure_instances
  - start_instance
  - wait_instance_started

Then run playbook with --limit option:

ansible-playbook -i hosts.yml playbook.yml --limit instance_1,instance_2

You can also simply edit some replicaset. To do this, define cartridge_scenario variable like this:

cartridge_scenario:
  - edit_topology

After run playbook with --limit option:

ansible-playbook -i hosts.yml playbook.yml --limit replicaset_1_group,replicaset_2_group

Moreover, scenario allows you to describe custom steps for configuring cluster. For more details about using scenario and available steps, see scenario documentation.

Documentation

Cookbook

Learn the cookbook to know now to use the tarantool.cartridge role for different purposes.

ansible-cartridge_zp22's People

Contributors

andreyermilov avatar dokshina avatar fizikroot avatar hackallcode avatar lenkis avatar mrrvz avatar no1seman avatar oleggator avatar opomuc avatar runsfor avatar trellixvulnteam avatar

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.