GithubHelp home page GithubHelp logo

opomuc / ansible-cartridge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tarantool/ansible-cartridge

1.0 1.0 0.0 23.48 MB

Ansible role for deploying tarantool cartridge-based applications

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

License: Other

Python 90.47% Shell 0.38% Dockerfile 0.14% Lua 7.19% Jinja 1.80%

ansible-cartridge's People

Stargazers

 avatar

ansible-cartridge's Issues

Rework is_healthy check for stateful failover function: cartridge_get_uuids

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'ret'
FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n
File \"<stdin>\", line 102, in <module>\n 
File \"<stdin>\", line 94, in _ansiballz_main\n 
File \"<stdin>\", line 40, in invoke_module\n  
File \"/usr/lib64/python2.7/runpy.py\", line 176, in run_module\n    fname, loader, pkg_name)\n  
File \"/usr/lib64/python2.7/runpy.py\", line 82, in _run_module_code\n    mod_name, mod_fname, mod_loader, pkg_name)\n  
File \"/usr/lib64/python2.7/runpy.py\", line 72, in _run_code\n    exec code in run_globals\n 
File \"/tmp/ansible_cartridge_get_uuids_payload_uJzOzG/ansible_cartridge_get_uuids_payload.zip/ansible/modules/cartridge_get_uuids.py\", line 68, in <module>\n 
 File \"/tmp/ansible_cartridge_get_uuids_payload_uJzOzG/ansible_cartridge_get_uuids_payload.zip/ansible/modules/cartridge_get_uuids.py\", line 57, in main\n  
 File \"/tmp/ansible_cartridge_get_uuids_payload_uJzOzG/ansible_cartridge_get_uuids_payload.zip/ansible/modules/cartridge_get_uuids.py\", line 51, in manage_get_uuids\n  
 File \"/tmp/ansible_cartridge_get_uuids_payload_uJzOzG/ansible_cartridge_get_uuids_payload.zip/ansible/modules/cartridge_get_uuids.py\", line 22, in get_uuids\n 
  File \"/tmp/ansible_cartridge_get_uuids_payload_uJzOzG/ansible_cartridge_get_uuids_payload.zip/ansible/module_utils/helpers.py\", line 215, in is_healthy\n  
  File \"/tmp/ansible_cartridge_get_uuids_payload_uJzOzG/ansible_cartridge_get_uuids_payload.zip/ansible/module_utils/helpers.py\", line 159, in eval\nKeyError: 'ret'\n", 
  "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

Unable to add a replicaset when running deploy by DC

Description

Deploy by DC has a step when it changes master to a backup DC. It also checks availability of all replicasets in a cluster. If we add a whole new replicaset (both master in main DC and replica in a backup DC) this lead to incorrect check. Deploy fails when it tries to access a new replica which has not been started yet.

In provided screenshot, storage-B-1 is a new replica.

Steps to reproduce

  1. Add a whole replicaset to cluster
  2. Run update by DC

Logs and screenshots
image

Solution

Add another part to if statement in availability check. Skip availability check if member is not present in membership.

if member == nil or member.status ~= 'alive' or member.payload.state ~= 'RolesConfigured' then

Additional info

Tested proposed changes on one of the projects. Deploy finished successfully.

Master switch fails on eventual failover when there is a new replica in already created replicaset

@ZolotarevIgor-mail-ru found this bug in production.

Steps:

  • add new replicas to an existing replicaset
  • try to change masters to any DC
  • error will pop up

Reason:

  • manage_replicasets checks for instance to be in membership
  • if instance is not in membership, manage_replicasets fails

servers_to_join = list(set(replicaset_instances) - set([s['alias'] for s in cluster_replicaset['servers']]))
for s in servers_to_join:
if s not in cluster_instances:
errmsg = 'Instance "{}" specified in replicaset "{}" is not in cluster. '.format(s, replicaset_alias) + \
'Make sure that it was started.'
return ModuleRes(success=False, msg=errmsg)
for s in replicaset_failover_priority:
if s not in cluster_instances:
errmsg = 'Instance "{}" specified in replicaset "{}" is not in cluster. '.format(s, replicaset_alias) + \
'Make sure that it was started.'
return ModuleRes(success=False, msg=errmsg)

Solution:

  • do not include newly created instances to edit_topology call

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.