Markus Bergholz 12 months ago
parent
commit
3b43979d49
No known key found for this signature in database
GPG Key ID: B45724801354B174
  1. 7
      Dockerfile
  2. 16
      Makefile
  3. 4
      README.md
  4. 53
      dev.yml
  5. 2
      inv.ini

7
Dockerfile

@ -0,0 +1,7 @@
FROM ubuntu:20.04
RUN apt update && apt install -y python3-pymysql mariadb-client wget
RUN wget https://github.com/sysown/proxysql/releases/download/v2.2.0/proxysql_2.2.0-ubuntu20_amd64.deb && \
dpkg -i proxysql_2.2.0-ubuntu20_amd64.deb
CMD proxysql --idle-threads -f

16
Makefile

@ -0,0 +1,16 @@
.PHONY: help test
help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help
build: ## build proxysql container
docker build -t proxysql .
run: ## run proxysql container
$(MAKE) build
docker run -ti --rm --name proxysql proxysql
test: ## run dev playbook against proxysql container
ansible-playbook -i inv.ini dev.yml

4
README.md

@ -1,3 +1,5 @@
# proxysql-playground
ProxySQL Playground for testing and developing
ProxySQL Playground for testing and developing.
See `make`.

53
dev.yml

@ -0,0 +1,53 @@
---
- hosts: testing
tasks:
- name: change check mode
community.proxysql.proxysql_query_rules_fast_routing:
login_user: admin
login_password: admin
username: 'user_ro'
schemaname: 'default'
destination_hostgroup: 1
comment: 'fast route user_ro to default schema'
state: present
save_to_disk: yes
load_to_runtime: yes
check_mode: yes
- name: change
community.proxysql.proxysql_query_rules_fast_routing:
login_user: admin
login_password: admin
username: 'user_ro'
schemaname: 'default'
destination_hostgroup: 1
comment: 'fast route user_ro to default schema'
state: present
save_to_disk: yes
load_to_runtime: yes
- name: no change
community.proxysql.proxysql_query_rules_fast_routing:
login_user: admin
login_password: admin
username: 'user_ro'
schemaname: 'default'
destination_hostgroup: 1
comment: 'fast route user_ro to default schema'
state: present
save_to_disk: yes
load_to_runtime: yes
- name: no change check mode
community.proxysql.proxysql_query_rules_fast_routing:
login_user: admin
login_password: admin
username: 'user_ro'
schemaname: 'default'
destination_hostgroup: 1
comment: 'fast route user_ro to default schema'
state: present
save_to_disk: yes
load_to_runtime: yes
check_mode: yes

2
inv.ini

@ -0,0 +1,2 @@
[testing]
proxysql ansible_connection=docker
Loading…
Cancel
Save