ansible-collections / community.proxysql

ProxySQL Ansible Collection
http://galaxy.ansible.com/community/proxysql
GNU General Public License v3.0
21 stars 26 forks source link

New Module: proxysql_galera_hostgroups #6

Open bmildren opened 4 years ago

bmildren commented 4 years ago
SUMMARY

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

ISSUE TYPE
COMPONENT NAME
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
futrix commented 3 years ago

Any ETA on that? It would be really useful.

TheOignon commented 2 years ago

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 ?

Andersson007 commented 2 years ago

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.

TheOignon commented 2 years ago

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.

Andersson007 commented 2 years ago

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.)

TheOignon commented 2 years ago

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 !

Andersson007 commented 2 years ago

@TheOignon sounds great, thank you!

Andersson007 commented 2 years ago

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

tompal3 commented 10 months ago

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.

markuman commented 10 months ago

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

tompal3 commented 10 months ago

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 ?

dpavlos commented 4 months ago

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

tompal3 commented 4 months ago

@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?

markuman commented 4 months ago

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