community.proxysql icon indicating copy to clipboard operation
community.proxysql copied to clipboard

New Module: proxysql_galera_hostgroups

Open bmildren opened this issue 5 years ago • 14 comments

SUMMARY

Need to add a module to support changes to the proxysql_galera_hostgroups config, along with the associated integration tests.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME
  • proxysql_galera_hostgroups
ADDITIONAL INFORMATION
ProxySQL Table:
mysql> show create table mysql_galera_hostgroups\G
*************************** 1. row ***************************
       table: mysql_galera_hostgroups
Create Table: CREATE TABLE mysql_galera_hostgroups (
    writer_hostgroup INT CHECK (writer_hostgroup>=0) NOT NULL PRIMARY KEY,
    backup_writer_hostgroup INT CHECK (backup_writer_hostgroup>=0 AND backup_writer_hostgroup<>writer_hostgroup) NOT NULL,
    reader_hostgroup INT NOT NULL CHECK (reader_hostgroup<>writer_hostgroup AND backup_writer_hostgroup<>reader_hostgroup AND reader_hostgroup>0),
    offline_hostgroup INT NOT NULL CHECK (offline_hostgroup<>writer_hostgroup AND offline_hostgroup<>reader_hostgroup AND backup_writer_hostgroup<>offline_hostgroup AND offline_hostgroup>=0),
    active INT CHECK (active IN (0,1)) NOT NULL DEFAULT 1,
    max_writers INT NOT NULL CHECK (max_writers >= 0) DEFAULT 1,
    writer_is_also_reader INT CHECK (writer_is_also_reader IN (0,1,2)) NOT NULL DEFAULT 0,
    max_transactions_behind INT CHECK (max_transactions_behind>=0) NOT NULL DEFAULT 0,
    comment VARCHAR,
    UNIQUE (reader_hostgroup),
    UNIQUE (offline_hostgroup),
    UNIQUE (backup_writer_hostgroup))

Example usage:
- name: proxysql | config | add galera hostgroups
  proxysql_galera_hostgroups:
    login_user: 'admin'
    login_password: 'admin'
    writer_hostgroup: 1
    reader_hostgroup: 2
    state: present

bmildren avatar Jul 07 '20 17:07 bmildren

Any ETA on that? It would be really useful.

futrix avatar Apr 14 '21 08:04 futrix

Hi. I've made such a module (totally inspired from proxysql.proxysql_replication_hostgroups module). Even if I'm not a maintainer, am I able to propose a PR ?

TheOignon avatar Jan 20 '22 22:01 TheOignon

Hi. I've made such a module (totally inspired from proxysql.proxysql_replication_hostgroups module). Even if I'm not a maintainer, am I able to propose a PR ?

Hi @TheOignon, sure, everyone can and should! Please do it:)

You can also be interested in some of our contributor guidelines listed in https://github.com/ansible-collections/community.proxysql/blob/main/README.md. You can find info on how to run sanity test locally / add integration tests for your module and run them locally before pushing. Though you can push it as it is now and fix everything later.

Andersson007 avatar Jan 21 '22 09:01 Andersson007

Thanks for the quick answer !

Though you can push it as it is now and fix everything later.

Even though I didn't added sanity nor integration tests, should I create a PR right now ? It's pushed on a fork I made following the guidelines you linked.

TheOignon avatar Jan 22 '22 21:01 TheOignon

Thanks for the quick answer !

Though you can push it as it is now and fix everything later.

Even though I didn't added sanity nor integration tests, should I create a PR right now ? It's pushed on a fork I made following the guidelines you linked.

yep, sounds good, though we need to have integration tests eventually in the PR (no need to do anything for sanity tests, they are just checks for formatting compliance, standards, etc.)

Andersson007 avatar Jan 24 '22 12:01 Andersson007

we need to have integration tests eventually in the PR

Those tests will be added, it's been running on a role I developped using this plugin, just need to rewrite correctly everything. I also need to add some documentations. I will create the PR soon, thanks for your answers !

TheOignon avatar Jan 24 '22 12:01 TheOignon

@TheOignon sounds great, thank you!

Andersson007 avatar Jan 24 '22 13:01 Andersson007

@TheOignon here are a couple of docs you may be interested in:

  • https://github.com/ansible/community-docs/blob/main/create_pr_quick_start_guide.rst
  • https://github.com/ansible/community-docs/blob/main/integration_tests_quick_start_guide.rst

Andersson007 avatar Jan 24 '22 13:01 Andersson007

Hi all, I have created a PR for this issue, so what's next ? I see that workflows of this repo have been disabled with message: This scheduled workflow is disabled because there hasn't been activity in this repository for at least 60 days. Enable this workflow to resume scheduled runs. How can it be enabled, and my PR get reviewed and merged ?
Thanks for any help.

tompal3 avatar Nov 17 '23 09:11 tompal3

I've enabled the workflow again, but it looks like that it needs a push on your PR to get it run again @tompal3

markuman avatar Nov 17 '23 10:11 markuman

Thanks @markuman I did that, now need to wait for someone's approval for workflow to run I guess: https://github.com/ansible-collections/community.proxysql/actions/runs/6902866352 ?

tompal3 avatar Nov 17 '23 11:11 tompal3

Hi all, any news on this? It would be very useful.

dpavlos avatar May 16 '24 16:05 dpavlos

@dpavlos my PR was approved https://github.com/ansible-collections/community.proxysql/pull/147 so its only need to be merged and new version should be released. @markuman any estimate on that?

tompal3 avatar May 16 '24 17:05 tompal3

We had some trouble with the backport branch.
I'll be away some days and try do it next week.

markuman avatar May 17 '24 07:05 markuman