Jcrespo has submitted this change and it was merged.

Change subject: Add new module proxysql
......................................................................


Add new module proxysql

For now this only has basic functionality:
* Install the recentely uploaded package
* Set the admin configuration, forcing the change of admin password

The puppet module itself will be very basic because most of the
configuration is handled on the mysql-like interface, not on the
config. We will see how that can be handled later.

Bug: T148500
Change-Id: Iea6e3715ccb00a065bf4a9c75f3eb6340c0c7996
---
A modules/proxysql/manifests/init.pp
A modules/proxysql/templates/proxysql.cnf.erb
2 files changed, 97 insertions(+), 0 deletions(-)

Approvals:
  Jcrespo: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/proxysql/manifests/init.pp 
b/modules/proxysql/manifests/init.pp
new file mode 100644
index 0000000..0b29be9
--- /dev/null
+++ b/modules/proxysql/manifests/init.pp
@@ -0,0 +1,27 @@
+# Class proxysql
+
+class proxysql (
+    $datadir         = '/var/lib/proxysql',
+    $admin_user      = 'admin',
+    $admin_password,
+    $admin_port      = 6032,
+    $admin_interface = '127.0.0.1',
+    $admin_socket    = '/tmp/proxysql_admin.sock',
+    $mysql_interface = '0.0.0.0',
+    $mysql_port      = 6033,
+    $mysql_socket    = '/tmp/proxysql.sock',
+    ) {
+
+    package { 'proxysql':
+        ensure => present,
+    }
+
+    file { '/etc/proxysql.cnf':
+        ensure  => present,
+        mode    => '0444',
+        owner   => 'root',
+        group   => 'root',
+        content => template('proxysql/proxysql.cnf.erb'),
+    }
+
+}
diff --git a/modules/proxysql/templates/proxysql.cnf.erb 
b/modules/proxysql/templates/proxysql.cnf.erb
new file mode 100644
index 0000000..e1525d4
--- /dev/null
+++ b/modules/proxysql/templates/proxysql.cnf.erb
@@ -0,0 +1,70 @@
+#file proxysql.cfg
+# WARNING: This file is managed by puppet, do not change it manually!
+
+# This config file is parsed using libconfig , and its grammar is described in:
+# 
http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-File-Grammar
+
+
+
+datadir="<%= @datadir -%>"
+
+admin_variables=
+{
+    admin_credentials="<%= @admin_user -%>:<%= @admin_password -%>"
+    mysql_ifaces="<%= @admin_interface -%>:<%= @admin_port -%>;<%= 
@admin_socket -%>"
+    refresh_interval=2000
+    debug=true
+}
+
+mysql_variables=
+{
+    threads=4
+    max_connections=2048
+    default_query_delay=0
+    default_query_timeout=36000000
+    have_compress=true
+    poll_timeout=2000
+    interfaces="<%= @mysql_interface -%>:<%= @mysql_port -%>;<%= @mysql_socket 
-%>"
+    default_schema="information_schema"
+    stacksize=1048576
+    server_version="5.5.30"
+    connect_timeout_server=3000
+    monitor_history=600000
+    monitor_connect_interval=60000
+    monitor_ping_interval=10000
+    monitor_read_only_interval=1500
+    monitor_read_only_timeout=500
+    ping_interval_server=120000
+    ping_timeout_server=500
+    commands_stats=true
+    sessions_sort=true
+    connect_retries_on_failure=10
+}
+
+
+# defines all the MySQL servers
+mysql_servers =
+(
+)
+
+
+# defines all the MySQL users
+mysql_users:
+(
+)
+
+
+
+#defines MySQL Query Rules
+mysql_query_rules:
+(
+)
+
+scheduler=
+(
+)
+
+
+mysql_replication_hostgroups=
+(
+)
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/316541
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iea6e3715ccb00a065bf4a9c75f3eb6340c0c7996
Gerrit-PatchSet: 7
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Jcrespo <jcre...@wikimedia.org>
Gerrit-Reviewer: Faidon Liambotis <fai...@wikimedia.org>
Gerrit-Reviewer: Jcrespo <jcre...@wikimedia.org>
Gerrit-Reviewer: Marostegui <maroste...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to