diff --git a/.sync.yml b/.sync.yml index 778d2e79..bb66f7cd 100644 --- a/.sync.yml +++ b/.sync.yml @@ -9,3 +9,7 @@ - set: debian8-64 - set: debian9-64 - set: debian10-64 +Gemfile: + optional: + ':test': + - gem: puppet-lint-param-docs diff --git a/Gemfile b/Gemfile index 8592cd61..82b7b511 100644 --- a/Gemfile +++ b/Gemfile @@ -14,6 +14,7 @@ group :test do gem 'voxpupuli-test', '~> 2.0', :require => false gem 'coveralls', :require => false gem 'simplecov-console', :require => false + gem 'puppet-lint-param-docs', :require => false end group :development do diff --git a/REFERENCE.md b/REFERENCE.md new file mode 100644 index 00000000..13ebe447 --- /dev/null +++ b/REFERENCE.md @@ -0,0 +1,1654 @@ +# Reference + + + +## Table of Contents + +### Classes + +#### Public Classes + +* [`proxysql`](#proxysql): Install and configure ProxySQL. + +#### Private Classes + +* `proxysql::admin_credentials`: This class is called from proxysql for service config. +* `proxysql::config`: This class is called from proxysql for service config. +* `proxysql::configure`: This class is called from proxysql for all proxy configuration. +* `proxysql::install`: This class is called from proxysql for install. +* `proxysql::params`: It sets variables according to platform. +* `proxysql::prerequisites`: Manage the prerequisites where the ProxySQL package might be. +* `proxysql::reload_config`: This class is called from proxysql to update config if it changed. +* `proxysql::repo`: Manage the repos where the ProxySQL package might be. +* `proxysql::selinux`: Adds selinux configuration needed for logrotate to work. +* `proxysql::service`: This class ensures that the service is running. + +### Resource types + +* [`proxy_cluster`](#proxy_cluster): Manage a ProxySQL cluster. +* [`proxy_global_variable`](#proxy_global_variable): Manage a ProxySQL global variable. +* [`proxy_mysql_galera_hostgroup`](#proxy_mysql_galera_hostgroup): Manage a ProxySQL mysql_galera_hostgroup. +* [`proxy_mysql_group_replication_hostgroup`](#proxy_mysql_group_replication_hostgroup): Manage a ProxySQL mysql_group_replication_hostgroup. +* [`proxy_mysql_query_rule`](#proxy_mysql_query_rule): Manage a ProxySQL mysql_query_rules entry. +* [`proxy_mysql_replication_hostgroup`](#proxy_mysql_replication_hostgroup): Manage a ProxySQL mysql_replication_hostgroup. +* [`proxy_mysql_server`](#proxy_mysql_server): Manage a ProxySQL mysql_server. +* [`proxy_mysql_server_no_hostgroup`](#proxy_mysql_server_no_hostgroup): Manage a ProxySQL mysql_server. +* [`proxy_mysql_user`](#proxy_mysql_user): Manage a ProxySQL mysql_user. This includes management of users password as well as privileges. +* [`proxy_scheduler`](#proxy_scheduler): Manage a ProxySQL scheduler entry. + +### Data types + +* [`Proxysql::GaleraHostgroup`](#proxysqlgalerahostgroup): Represents an entry in the ProxySQL `mysql_galera_hostgroups` admin table. +* [`Proxysql::GroupReplicationHostgroup`](#proxysqlgroupreplicationhostgroup): Represents a ProxySQL group replication hostgroup. +* [`Proxysql::Hostgroup`](#proxysqlhostgroup): Represents a ProxySQL replication hostgroup. +* [`Proxysql::Scheduler`](#proxysqlscheduler): Represents a ProxySQL scheduler +* [`Proxysql::Server`](#proxysqlserver): Represents a ProxySQL server. +* [`Proxysql::User`](#proxysqluser): Represents a ProxySQL user. + +## Classes + +### `proxysql` + +Install and configure ProxySQL. + +#### Parameters + +The following parameters are available in the `proxysql` class. + +##### `package_name` + +Data type: `String` + +The name of the ProxySQL package in your package manager. + +Default value: `'proxysql'` + +##### `package_ensure` + +Data type: `String` + +The ensure of the ProxySQL package resource. + +Default value: `'installed'` + +##### `package_install_options` + +Data type: `Array[String]` + +An array of additional options to pass when installing a package. + +Default value: `[]` + +##### `service_name` + +Data type: `String` + +The name of the ProxySQL service resource. + +Default value: `'proxysql'` + +##### `service_ensure` + +Data type: `String` + +The ensure of the ProxySQL service resource. + +Default value: `'running'` + +##### `datadir` + +Data type: `String` + +The directory where ProxySQL will store its data. + +Default value: `$proxysql::params::datadir` + +##### `datadir_mode` + +Data type: `Stdlib::Filemode` + +The filesystem mode for the `datadir`. + +Default value: `'0600'` + +##### `errorlog_file` + +Data type: `Optional[Stdlib::Unixpath]` + +The File where ProxySQL will store its error logs. Available from ProxySQL v2.0.0 + +Default value: ``undef`` + +##### `errorlog_file_mode` + +Data type: `Stdlib::Filemode` + +The filesystem mode for the `errorlog_file`. Available from ProxySQL v2.0.0 + +Default value: `'0600'` + +##### `errorlog_file_owner` + +Data type: `String` + +Owner of the `errorlog_file`. Available from ProxySQL v2.0.0 + +Default value: `'proxysql'` + +##### `errorlog_file_group` + +Data type: `String` + +Group of the `errorlog_file`. Available from ProxySQL v2.0.0 + +Default value: `'proxysql'` + +##### `manage_selinux` + +Data type: `Boolean` + +Whether to create the required selinux rules for logrotate to work. +This parameter also requires the `puppet/selinux` module to be installed. + +Default value: ``true`` + +##### `manage_mysql_client` + +Data type: `Boolean` + +Whether to include the mysql::client class. +You may have mysql::client included or managed with different parameters elsewhere in your catalogue. + +Default value: ``true`` + +##### `listen_ip` + +Data type: `String` + +The ip where the ProxySQL service will listen on. + +Default value: `'0.0.0.0'` + +##### `listen_port` + +Data type: `Integer` + +The port where the ProxySQL service will listen on. + +Default value: `6033` + +##### `listen_socket` + +Data type: `String` + +The socket where the ProxySQL service will listen on. + +Default value: `$proxysql::params::listen_socket` + +##### `admin_username` + +Data type: `String` + +The username to connect to the ProxySQL admin interface. + +Default value: `'admin'` + +##### `admin_password` + +Data type: `Sensitive[String]` + +The password to connect to the ProxySQL admin interface. + +Default value: `Sensitive('admin')` + +##### `stats_username` + +Data type: `String` + +The username to connect with read-only permissions to the ProxySQL admin interface. + +Default value: `'stats'` + +##### `stats_password` + +Data type: `Sensitive[String]` + +The password to connect with read-only permissions to the ProxySQL admin interface. + +Default value: `Sensitive('stats')` + +##### `admin_listen_ip` + +Data type: `String` + +The ip where the ProxySQL admin interface will listen on. + +Default value: `'127.0.0.1'` + +##### `admin_listen_port` + +Data type: `Integer` + +The port where the ProxySQL admin interface will listen on. + +Default value: `6032` + +##### `admin_listen_socket` + +Data type: `String` + +The socket where the ProxySQL admin interface will listen on. Changing this on a running system will result in failing runs. + +Default value: `$proxysql::params::admin_listen_socket` + +##### `monitor_username` + +Data type: `String` + +The username ProxySQL will use to connect to the configured mysql_servers. + +Default value: `'monitor'` + +##### `monitor_password` + +Data type: `Sensitive[String]` + +The password ProxySQL will use to connect to the configured mysql_servers. + +Default value: `Sensitive('monitor')` + +##### `config_file` + +Data type: `String` + +The file where the ProxySQL configuration is saved. This will only be configured if `manage_config_file` is set to `true`. + +Default value: `'/etc/proxysql.cnf'` + +##### `manage_config_file` + +Data type: `Boolean` + +Determines whether this module will configure the ProxySQL configuration file. + +Default value: ``true`` + +##### `mycnf_file_name` + +Data type: `String` + +Path of the my.cnf file where the connections details for the admin interface is save. This is required for the providers to work. +This will only be configured if `manage_mycnf_file` is set to `true`. + +Default value: `'/root/.my.cnf'` + +##### `manage_mycnf_file` + +Data type: `Boolean` + +Determines whether this module will configure the my.cnf file to connect to the admin interface. +This is required for the providers to work. + +Default value: ``true`` + +##### `restart` + +Data type: `Boolean` + +Determines whether this module will restart ProxySQL after reconfiguring the config file. + +Default value: ``false`` + +##### `load_to_runtime` + +Data type: `Boolean` + +Specifies whether te managed ProxySQL resources should be immediately loaded to the active runtime. + +Default value: ``true`` + +##### `save_to_disk` + +Data type: `Boolean` + +Specifies whether te managed ProxySQL resources should be immediately save to disk. + +Default value: ``true`` + +##### `manage_repo` + +Data type: `Boolean` + +Determines whether this module will manage the repositories where ProxySQL might be. + +Default value: ``true`` + +##### `version` + +Data type: `Pattern[/^[1|2]\.\d+\.\d+/]` + +The version of proxysql being managed. This parameter affects the repository configured when `manage_repo == true` and how the service is managed. +It does not affect the package version being installed. It is used as a hint to the puppet module on how to configure proxysql. To control the exact version +deployed, use `package_name` or `package_source`. Currently defaults to '2.0.7' or the value of the `proxysql_version` fact. + +Default value: `$proxysql::params::version` + +##### `package_source` + +Data type: `Optional[String[1]]` + +location of a proxysql package. When specified, this package will be installed with the `package\_provider` and the `manage_repo` setting will be ignored. +Since version 4 of this module, this defaults to `undef` and needs to be specified when you don't want to use a package from a repository. + +Default value: ``undef`` + +##### `package_provider` + +Data type: `Enum['dpkg','rpm']` + +provider for `package_source`. + +Default value: `$proxysql::params::package_provider` + +##### `package_checksum_value` + +Data type: `Optional[String[1]]` + +The checksum of the package. Optional and only applicable when `package_source` is provided. + +Default value: ``undef`` + +##### `package_checksum_type` + +Data type: `Optional[String[1]]` + +The 'type' of `package_checksum_value`. Optional and only applicable when `package_checksum_value` is provided. + +Default value: ``undef`` + +##### `package_dependencies` + +Data type: `Array[String[1]]` + +A list of packages which should be additionally installed. + +Default value: `$proxysql::params::package_dependencies` + +##### `sys_owner` + +Data type: `String` + +Owner of the datadir and config_file. + +Default value: `$version` + +##### `sys_group` + +Data type: `String` + +Group of the datadir and config_file. + +Default value: `$sys_owner` + +##### `override_config_settings` + +Data type: `Hash` + +Which configuration variables should be overriden. + +Default value: `{}` + +##### `node_name` + +Data type: `String` + +The name of the node. + +Default value: `"${facts['networking']['fqdn']}:${admin_listen_port}"` + +##### `cluster_name` + +Data type: `Optional[String[1]]` + +If set, proxysql_servers with the same cluster_name will be automatically added to the same cluster and will +synchronize their configuration parameters. + +Default value: ``undef`` + +##### `cluster_username` + +Data type: `String` + +The username ProxySQL will use to connect to the configured mysql_clusters + +Default value: `'cluster'` + +##### `cluster_password` + +Data type: `Sensitive[String]` + +The password ProxySQL will use to connect to the configured mysql_clusters. + +Default value: `Sensitive('cluster')` + +##### `mysql_client_package_name` + +Data type: `Optional[String]` + +The name of the mysql client package in your package manager. + +Default value: ``undef`` + +##### `manage_hostgroup_for_servers` + +Data type: `Boolean` + +Determines whether this module will manage hostgroup_id for mysql_servers. +If false - it will skip difference in this value between manifest and defined in ProxySQL. + +Default value: ``true`` + +##### `mysql_servers` + +Data type: `Optional[Proxysql::Server]` + +Array of mysql_servers, that will be created in ProxySQL. + +Default value: ``undef`` + +##### `mysql_users` + +Data type: `Optional[Proxysql::User]` + +Array of mysql_users, that will be created in ProxySQL. + +Default value: ``undef`` + +##### `mysql_hostgroups` + +Data type: `Optional[Proxysql::Hostgroup]` + +Array of mysql_hostgroups, that will be created in ProxySQL. + +Default value: ``undef`` + +##### `mysql_group_replication_hostgroups` + +Data type: `Optional[Proxysql::GroupReplicationHostgroup]` + +Hash of mysql_group_replication_hostgroups, that will be created in ProxySQL. + +Default value: ``undef`` + +##### `mysql_galera_hostgroups` + +Data type: `Optional[Proxysql::GaleraHostgroup]` + +Hash of mysql_galera_hostgroups, that will be created in ProxySQL. + +Default value: ``undef`` + +##### `mysql_rules` + +Data type: `Optional[Proxysql::Rule]` + +Array of mysql_rules, that will be created in ProxySQL. + +Default value: ``undef`` + +##### `schedulers` + +Data type: `Optional[Proxysql::Scheduler]` + +Array of schedulers, that will be created in ProxySQL. + +Default value: ``undef`` + +##### `split_config` + +Data type: `Boolean` + +If set, ProxySQL config file will be split in 2: main config file with admin and mysql variables +and proxy config file with servers\users\hostgroups\scheduler params. + +Default value: ``false`` + +##### `proxy_config_file` + +Data type: `String` + +The file where servers\users\hostgroups\scheduler\rules params of ProxySQL configuration are saved +This will only be configured if `split_config` is set to `true`. + +Default value: `'/etc/proxysql_proxy.cnf'` + +##### `manage_proxy_config_file` + +Data type: `Boolean` + +Determines whether this module will update the ProxySQL proxy configuration file. + +Default value: ``true`` + +## Resource types + +### `proxy_cluster` + +Manage a ProxySQL cluster. + +#### Properties + +The following properties are available in the `proxy_cluster` type. + +##### `comment` + +Valid values: `%r{[\w+]}` + +free form comment field. + +##### `ensure` + +Valid values: `present`, `absent` + +The basic property that the resource should be in. + +Default value: `present` + +##### `hostname` + +Valid values: `%r{\w+}` + +The hostname of the server. + +##### `port` + +Valid values: `%r{\d+}` + +The port of the server. + +##### `weight` + +Valid values: `%r{\d+}` + +Currently unused, but in the roadmap for future enhancements. + +#### Parameters + +The following parameters are available in the `proxy_cluster` type. + +##### `load_to_runtime` + +Valid values: ``true``, ``false`` + +Load this entry to the active runtime. + +Default value: ``true`` + +##### `name` + +namevar + +name for cluster to manage. + +##### `provider` + +The specific backend to use for this `proxy_cluster` resource. You will seldom need to specify this --- Puppet will +usually discover the appropriate provider for your platform. + +##### `save_to_disk` + +Valid values: ``true``, ``false`` + +Perist this entry to the disk. + +Default value: ``true`` + +### `proxy_global_variable` + +Manage a ProxySQL global variable. + +#### Properties + +The following properties are available in the `proxy_global_variable` type. + +##### `value` + +Valid values: `%r{.+}` + +variable value + +#### Parameters + +The following parameters are available in the `proxy_global_variable` type. + +##### `load_to_runtime` + +Valid values: ``true``, ``false`` + +Load this entry to the active runtime. + +Default value: ``true`` + +##### `name` + +namevar + +variable name + +##### `provider` + +The specific backend to use for this `proxy_global_variable` resource. You will seldom need to specify this --- Puppet +will usually discover the appropriate provider for your platform. + +##### `save_to_disk` + +Valid values: ``true``, ``false`` + +Perist this entry to the disk. + +Default value: ``true`` + +### `proxy_mysql_galera_hostgroup` + +Manage a ProxySQL mysql_galera_hostgroup. + +#### Properties + +The following properties are available in the `proxy_mysql_galera_hostgroup` type. + +##### `active` + +active + +##### `comment` + +Valid values: `%r{[\w+]}` + +text field can be used to store any arbitrary data. + +##### `ensure` + +Valid values: `present`, `absent` + +Manage the state of this type. + +Default value: `present` + +##### `max_transactions_behind` + +Maximum Transaction Galera Node out-of-sync + +##### `max_writers` + +Maximum Writers + +##### `writer_is_also_reader` + +A writer is also used for reading + +#### Parameters + +The following parameters are available in the `proxy_mysql_galera_hostgroup` type. + +##### `backup_writer_hostgroup` + +Backup Writer hostgroup. + +##### `load_to_runtime` + +Valid values: ``true``, ``false``, `yes`, `no` + +Load this entry to the active runtime. + +Default value: ``true`` + +##### `name` + +namevar + +name to describe the hostgroup config + +##### `offline_hostgroup` + +Offline hostgroup. + +##### `provider` + +The specific backend to use for this `proxy_mysql_galera_hostgroup` resource. You will seldom need to specify this --- +Puppet will usually discover the appropriate provider for your platform. + +##### `reader_hostgroup` + +Reader hostgroup. + +##### `save_to_disk` + +Valid values: ``true``, ``false``, `yes`, `no` + +Perist this entry to the disk. + +Default value: ``true`` + +##### `writer_hostgroup` + +Writer hostgroup. + +### `proxy_mysql_group_replication_hostgroup` + +Manage a ProxySQL mysql_group_replication_hostgroup. + +#### Properties + +The following properties are available in the `proxy_mysql_group_replication_hostgroup` type. + +##### `active` + +Valid values: `%r{[01]}` + +Active status. + +##### `backup_writer_hostgroup` + +Valid values: `%r{\d+}` + +Backup writer hostgroup. + +##### `comment` + +Valid values: `%r{[\w+]}` + +text field can be used to store any arbitrary data. + +##### `ensure` + +Valid values: `present`, `absent` + +The basic property that the resource should be in. + +Default value: `present` + +##### `max_transactions_behind` + +Valid values: `%r{\d+}` + +Max transactions behind. + +##### `max_writers` + +Valid values: `%r{[01]}` + +Max writers. + +##### `offline_hostgroup` + +Valid values: `%r{\d+}` + +Offline hostgroup. + +##### `reader_hostgroup` + +Valid values: `%r{\d+}` + +Reader hostgroup. + +##### `writer_hostgroup` + +Valid values: `%r{\d+}` + +Writer hostgroup. + +##### `writer_is_also_reader` + +Valid values: `%r{[01]}` + +Writer is also a reader. + +#### Parameters + +The following parameters are available in the `proxy_mysql_group_replication_hostgroup` type. + +##### `load_to_runtime` + +Valid values: ``true``, ``false`` + +Load this entry to the active runtime. + +Default value: ``true`` + +##### `name` + +namevar + +name to describe the hostgroup config + +##### `provider` + +The specific backend to use for this `proxy_mysql_group_replication_hostgroup` resource. You will seldom need to specify +this --- Puppet will usually discover the appropriate provider for your platform. + +##### `save_to_disk` + +Valid values: ``true``, ``false`` + +Perist this entry to the disk. + +Default value: ``true`` + +### `proxy_mysql_query_rule` + +Manage a ProxySQL mysql_query_rules entry. + +#### Properties + +The following properties are available in the `proxy_mysql_query_rule` type. + +##### `active` + +Valid values: `%r{[01]}` + +Is the rule active or not. + +##### `apply` + +Valid values: `%r{[01]}` + +Used to chain rules. + +##### `cache_ttl` + +Valid values: `%r{\d+}` + +The amount of miliseconds to cache the result of this query. + +##### `client_addr` + +Valid values: `%r{\w+}` + +Match traffic from a certain address. + +##### `comment` + +Valid values: `%r{[\w+]}` + +free form text field, usable for a descriptive comment of the query rule. + +##### `delay` + +Valid values: `%r{\d+}` + +number of milliseconds to delay the execution of the query. + +##### `destination_hostgroup` + +Valid values: `%r{\d+}` + +The hostgroup to send this query to. + +##### `digest` + +Valid values: `%r{\w+}` + +match queries with a specific digest, as returned by stats_mysql_query_digest.digest + +##### `ensure` + +Valid values: `present`, `absent` + +The basic property that the resource should be in. + +Default value: `present` + +##### `error_msg` + +Valid values: `%r{\w+}` + +query will be blocked, and the specified error_msg will be returned to the client. + +##### `flag_in` + +Valid values: `%r{\d+}` + +Used to chain rules. This is the id of the previous rule to apply + +##### `flag_out` + +Valid values: `%r{\d+}` + +Used to chain rules. This is the id of the next rule to apply + +##### `log` + +Valid values: `%r{[01]}` + +query will be logged. + +##### `match_digest` + +Valid values: `%r{\w+}` + +regular expression that matches the query digest + +##### `match_pattern` + +Valid values: `%r{\w+}` + +regular expression that matches the query text + +##### `mirror_flag_out` + +Valid values: `%r{\d+}` + +see https://github.com/sysown/proxysql/blob/master/doc/mirroring.md + +##### `mirror_hostgroup` + +Valid values: `%r{\d+}` + +see https://github.com/sysown/proxysql/blob/master/doc/mirroring.md. + +##### `negate_match_pattern` + +Valid values: `%r{[01]}` + +if this is set to 1, only queries not matching the query text will be considered as a match. This acts as a NOT operator in front of the regular expression matching against match_pattern or match_digest. + +##### `proxy_addr` + +Valid values: `%r{\w+}` + +Match incoming traffic on a specific local address. + +##### `proxy_port` + +Valid values: `%r{\d+}` + +Match incoming traffic on a specific local port. + +##### `reconnect` + +Valid values: `%r{[01]}` + +feature currently not in use. + +##### `replace_pattern` + +Valid values: `%r{\w+}` + +this is the pattern with which to replace the matched pattern. + +##### `retries` + +Valid values: `%r{\d+}` + +the maximum number of times a query needs to be re-executed in case of detected failure during the execution of the query. + +##### `rule_id` + +Valid values: `%r{\d+}` + +The id of the query rule. + +##### `schemaname` + +Valid values: `%r{\w+}` + +Schema to apply this rule to. + +##### `timeout` + +Valid values: `%r{\d+}` + +The maximum amount of miliseconds in which the matched or rewritten query should be executed. + +##### `username` + +Valid values: `%r{\w+}` + +Username to apply this rule to. + +#### Parameters + +The following parameters are available in the `proxy_mysql_query_rule` type. + +##### `load_to_runtime` + +Valid values: ``true``, ``false`` + +Load this entry to the active runtime. + +Default value: ``true`` + +##### `name` + +namevar + +query rule name + +##### `provider` + +The specific backend to use for this `proxy_mysql_query_rule` resource. You will seldom need to specify this --- Puppet +will usually discover the appropriate provider for your platform. + +##### `save_to_disk` + +Valid values: ``true``, ``false`` + +Perist this entry to the disk. + +Default value: ``true`` + +### `proxy_mysql_replication_hostgroup` + +Manage a ProxySQL mysql_replication_hostgroup. + +#### Properties + +The following properties are available in the `proxy_mysql_replication_hostgroup` type. + +##### `comment` + +Valid values: `%r{[\w+]}` + +text field can be used to store any arbitrary data. + +##### `ensure` + +Valid values: `present`, `absent` + +The basic property that the resource should be in. + +Default value: `present` + +##### `reader_hostgroup` + +Valid values: `%r{\d+}` + +Reader hostgroup. + +##### `writer_hostgroup` + +Valid values: `%r{\d+}` + +Writer hostgroup. + +#### Parameters + +The following parameters are available in the `proxy_mysql_replication_hostgroup` type. + +##### `load_to_runtime` + +Valid values: ``true``, ``false`` + +Load this entry to the active runtime. + +Default value: ``true`` + +##### `name` + +namevar + +name to describe the hostgroup config + +##### `provider` + +The specific backend to use for this `proxy_mysql_replication_hostgroup` resource. You will seldom need to specify this +--- Puppet will usually discover the appropriate provider for your platform. + +##### `save_to_disk` + +Valid values: ``true``, ``false`` + +Perist this entry to the disk. + +Default value: ``true`` + +### `proxy_mysql_server` + +Manage a ProxySQL mysql_server. + +#### Properties + +The following properties are available in the `proxy_mysql_server` type. + +##### `comment` + +Valid values: `%r{[\w+]}` + +text field that can be used for any purposed defined by the user. Could be a description of what the host stores, a reminder of when the host was added or disabled, or a JSON processed by some checker script. + +##### `compression` + +Valid values: `%r{\d+}` + +if the value is greater than 0, new connections to that server will use compression + +##### `ensure` + +Valid values: `present`, `absent` + +The basic property that the resource should be in. + +Default value: `present` + +##### `hostgroup_id` + +Valid values: `%r{\d+}` + +The hostgroup of the server. + +Default value: `0` + +##### `hostname` + +Valid values: `%r{\w+}` + +The hostname of the server. + +Default value: `localhost` + +##### `max_connections` + +Valid values: `%r{\d+}` + +the maximum number of connections ProxySQL will open to this backend server. Even though this server will have the highest weight, no new connections will be opened to it once this limit is hit. Please ensure that the backend is configured with a correct value of max_connections to avoid that ProxySQL will try to go beyond that limit + +##### `max_latency_ms` + +Valid values: `%r{[\d+]}` + +ping time is regularly monitored. If a host has a ping time greater than max_latency_ms it is excluded from the connection pool (although the server stays ONLINE) + +##### `max_replication_lag` + +Valid values: `%r{\d+}` + +if greater and 0, ProxySQL will reguarly monitor replication lag and if it goes beyond such threshold it will temporary shun the host until replication catch ups + +##### `port` + +Valid values: `%r{\d+}` + +The port of the server. + +Default value: `3306` + +##### `status` + +Valid values: `ONLINE`, `SHUNNED`, `OFFLINE_SOFT`, `OFFLINE_HARD` + +Server status. + +##### `use_ssl` + +Valid values: `%r{[01]}` + +if set to 1, connections to the backend will use SSL + +##### `weight` + +Valid values: `%r{\d+}` + +the bigger the weight of a server relative to other weights, the higher the probability of the server to be chosen from a hostgroup + +#### Parameters + +The following parameters are available in the `proxy_mysql_server` type. + +##### `load_to_runtime` + +Valid values: ``true``, ``false`` + +Load this entry to the active runtime. + +Default value: ``true`` + +##### `name` + +namevar + +name for server to manage. + +##### `provider` + +The specific backend to use for this `proxy_mysql_server` resource. You will seldom need to specify this --- Puppet will +usually discover the appropriate provider for your platform. + +##### `save_to_disk` + +Valid values: ``true``, ``false`` + +Perist this entry to the disk. + +Default value: ``true`` + +### `proxy_mysql_server_no_hostgroup` + +Manage a ProxySQL mysql_server. + +#### Properties + +The following properties are available in the `proxy_mysql_server_no_hostgroup` type. + +##### `comment` + +Valid values: `%r{[\w+]}` + +text field that can be used for any purposed defined by the user. Could be a description of what the host stores, a reminder of when the host was added or disabled, or a JSON processed by some checker script. + +##### `compression` + +Valid values: `%r{\d+}` + +if the value is greater than 0, new connections to that server will use compression + +##### `ensure` + +Valid values: `present`, `absent` + +The basic property that the resource should be in. + +Default value: `present` + +##### `hostname` + +Valid values: `%r{\w+}` + +The hostname of the server. + +Default value: `localhost` + +##### `max_connections` + +Valid values: `%r{\d+}` + +the maximum number of connections ProxySQL will open to this backend server. Even though this server will have the highest weight, no new connections will be opened to it once this limit is hit. Please ensure that the backend is configured with a correct value of max_connections to avoid that ProxySQL will try to go beyond that limit + +##### `max_latency_ms` + +Valid values: `%r{[\d+]}` + +ping time is regularly monitored. If a host has a ping time greater than max_latency_ms it is excluded from the connection pool (although the server stays ONLINE) + +##### `max_replication_lag` + +Valid values: `%r{\d+}` + +if greater and 0, ProxySQL will reguarly monitor replication lag and if it goes beyond such threshold it will temporary shun the host until replication catch ups + +##### `port` + +Valid values: `%r{\d+}` + +The port of the server. + +Default value: `3306` + +##### `status` + +Valid values: `ONLINE`, `SHUNNED`, `OFFLINE_SOFT`, `OFFLINE_HARD` + +Server status. + +##### `use_ssl` + +Valid values: `%r{[01]}` + +if set to 1, connections to the backend will use SSL + +##### `weight` + +Valid values: `%r{\d+}` + +the bigger the weight of a server relative to other weights, the higher the probability of the server to be chosen from a hostgroup + +#### Parameters + +The following parameters are available in the `proxy_mysql_server_no_hostgroup` type. + +##### `hostgroup_id` + +Valid values: `%r{\d+}` + +The hostgroup of the server. + +Default value: `0` + +##### `load_to_runtime` + +Valid values: ``true``, ``false`` + +Load this entry to the active runtime. + +Default value: ``true`` + +##### `name` + +namevar + +name for server to manage. + +##### `provider` + +The specific backend to use for this `proxy_mysql_server_no_hostgroup` resource. You will seldom need to specify this +--- Puppet will usually discover the appropriate provider for your platform. + +##### `save_to_disk` + +Valid values: ``true``, ``false`` + +Perist this entry to the disk. + +Default value: ``true`` + +### `proxy_mysql_user` + +Manage a ProxySQL mysql_user. This includes management of users password as well as privileges. + +#### Properties + +The following properties are available in the `proxy_mysql_user` type. + +##### `active` + +Valid values: `%r{[01]}` + +Is the user active or not. + +##### `backend` + +Valid values: `%r{[01]}` + +Backend or not. + +Default value: `1` + +##### `default_hostgroup` + +Valid values: `%r{\d+}` + +Default hostgroup for the user. + +##### `default_schema` + +Valid values: `%r{\w+}` + +Default schema for the user. + +##### `ensure` + +Valid values: `present`, `absent` + +The basic property that the resource should be in. + +Default value: `present` + +##### `fast_forward` + +Valid values: `%r{[01]}` + +Use fast forwrd or not. + +##### `frontend` + +Valid values: `%r{[01]}` + +Frontend or not. + +Default value: `1` + +##### `max_connections` + +Valid values: `%r{\d+}` + +Max concurrent connections for the user. + +##### `password` + +Valid values: `%r{\w*}` + +The password of the user. You can use mysql_password() for creating a hashed password. + +##### `schema_locked` + +Valid values: `%r{[01]}` + +Is the user locked in the default schema or not. + +##### `transaction_persistent` + +Valid values: `%r{[01]}` + +Disable routing across hostgroups once a transaction has started for a specific user. + +##### `use_ssl` + +Valid values: `%r{[01]}` + +Use ssl or not. + +#### Parameters + +The following parameters are available in the `proxy_mysql_user` type. + +##### `encrypt_password` + +Valid values: ``true``, ``false`` + +Encrypt the users password (requires ProxySQL setting `admin-hash_password` = `true`) + +Default value: ``true`` + +##### `load_to_runtime` + +Valid values: ``true``, ``false`` + +Load this entry to the active runtime. + +Default value: ``true`` + +##### `name` + +namevar + +The name of the user to manage. + +##### `provider` + +The specific backend to use for this `proxy_mysql_user` resource. You will seldom need to specify this --- Puppet will +usually discover the appropriate provider for your platform. + +##### `save_to_disk` + +Valid values: ``true``, ``false`` + +Perist this entry to the disk. + +Default value: ``true`` + +### `proxy_scheduler` + +Manage a ProxySQL scheduler entry. + +#### Properties + +The following properties are available in the `proxy_scheduler` type. + +##### `active` + +Valid values: `%r{[01]}` + +Is the scheduler active or not. + +##### `arg1` + +Valid values: `%r{[\w+]}` + +optional argument to pass to the script. + +##### `arg2` + +Valid values: `%r{[\w+]}` + +optional argument to pass to the script. + +##### `arg3` + +Valid values: `%r{[\w+]}` + +optional argument to pass to the script. + +##### `arg4` + +Valid values: `%r{[\w+]}` + +optional argument to pass to the script. + +##### `arg5` + +Valid values: `%r{[\w+]}` + +optional argument to pass to the script. + +##### `comment` + +Valid values: `%r{[\w+]}` + +optional comment. + +##### `ensure` + +Valid values: `present`, `absent` + +The basic property that the resource should be in. + +Default value: `present` + +##### `filename` + +Valid values: `%r{\w+}` + +Filename of the script to run. (required) + +##### `interval_ms` + +Valid values: `%r{\d+}` + +How often (in millisecond) the job will be started. + +##### `scheduler_id` + +Valid values: `%r{\d+}` + +The id of the scheduler entry. + +#### Parameters + +The following parameters are available in the `proxy_scheduler` type. + +##### `load_to_runtime` + +Valid values: ``true``, ``false`` + +Load this entry to the active runtime. + +Default value: ``true`` + +##### `name` + +namevar + +scheduler name + +##### `provider` + +The specific backend to use for this `proxy_scheduler` resource. You will seldom need to specify this --- Puppet will +usually discover the appropriate provider for your platform. + +##### `save_to_disk` + +Valid values: ``true``, ``false`` + +Perist this entry to the disk. + +Default value: ``true`` + +## Data types + +### `Proxysql::GaleraHostgroup` + +Represents an entry in the ProxySQL `mysql_galera_hostgroups` admin table. + +Alias of `Array[Hash[String, Struct[{ writer => Integer[0], + backup => Integer[0], + reader => Integer[0], + offline => Integer[0], + Optional[active] => Integer[0,1], + Optional[writers] => Integer[0], + Optional[writer_is_reader] => Integer[0,2], + Optional[max_transactions] => Integer[0], }],1,1]]` + +### `Proxysql::GroupReplicationHostgroup` + +Represents a ProxySQL group replication hostgroup. + +Alias of `Array[Hash[String, Struct[{ writer => Integer, + backup => Integer, + reader => Integer, + offline => Integer, + Optional[active] => Integer[0,1], + Optional[writers] => Integer, + Optional[writer_is_reader] => Integer[0,1], + Optional[max_transactions] => Integer, }],1,1]]` + +### `Proxysql::Hostgroup` + +Represents a ProxySQL replication hostgroup. + +Alias of `Array[Hash[String, Struct[{ writer => Integer, + reader => Integer, }],1,1]]` + +### `Proxysql::Scheduler` + +Represents a ProxySQL scheduler + +Alias of `Array[Hash[String, Struct[{ scheduler_id => Integer, + active => Integer, + Optional[interval_ms] => Integer, + filename => String[1], + Optional[arg1] => String[1], + Optional[arg2] => String[1], + Optional[arg3] => String[1], + Optional[arg4] => String[1], + Optional[arg5] => String[1] }],1,1]]` + +### `Proxysql::Server` + +Represents a ProxySQL server. + +Alias of `Array[Hash[String, Struct[{ Optional[port] => Integer, + hostgroup_id => Integer, + Optional[status] => String[1], + Optional[weight] => Integer, + Optional[compression] => Integer, + Optional[max_connections] => Integer, + Optional[max_replication_lag] => Integer, + Optional[use_ssl] => Integer[0,1], + Optional[max_latency_ms] => Integer, + Optional[comment] => String[1], }],1,1]]` + +### `Proxysql::User` + +Represents a ProxySQL user. + +Alias of `Array[Hash[String, Struct[{ password => String[1], + default_hostgroup => Integer, + Optional[active] => Integer[0,1], + Optional[use_ssl] => Integer[0,1], + Optional[default_schema] => String[1], + Optional[schema_locked] => Integer[0,1], + Optional[transaction_persistent] => Integer[0,1], + Optional[fast_forward] => Integer[0,1], + Optional[backend] => Integer[0,1], + Optional[frontend] => Integer[0,1], + Optional[max_connections] => Integer, }],1,1]]` + diff --git a/lib/puppet/type/proxy_mysql_galera_hostgroup.rb b/lib/puppet/type/proxy_mysql_galera_hostgroup.rb index 85e24ede..fa4662b9 100644 --- a/lib/puppet/type/proxy_mysql_galera_hostgroup.rb +++ b/lib/puppet/type/proxy_mysql_galera_hostgroup.rb @@ -29,6 +29,7 @@ def self.title_patterns end ensurable do + desc 'Manage the state of this type.' defaultvalues defaultto :present end diff --git a/manifests/admin_credentials.pp b/manifests/admin_credentials.pp index 5a89ac2c..3cb3bfc9 100644 --- a/manifests/admin_credentials.pp +++ b/manifests/admin_credentials.pp @@ -1,7 +1,6 @@ -# == Class proxysql::admin_credentials -# -# This class is called from proxysql for service config. +# @summary This class is called from proxysql for service config. # +# @api private class proxysql::admin_credentials { if $proxysql::manage_mycnf_file { $mycnf_file_name = $proxysql::mycnf_file_name diff --git a/manifests/config.pp b/manifests/config.pp index 59ef2dfc..23b9d97b 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,7 +1,6 @@ -# == Class proxysql::config -# -# This class is called from proxysql for service config. +# @summary This class is called from proxysql for service config. # +# @api private class proxysql::config { $config_settings = $proxysql::config_settings $proxy_config_file = $proxysql::proxy_config_file diff --git a/manifests/configure.pp b/manifests/configure.pp index f4b7f935..6e2e24cd 100644 --- a/manifests/configure.pp +++ b/manifests/configure.pp @@ -1,7 +1,6 @@ -# == Class proxysql::configure -# -# This class is called from proxysql for all proxy configuration. +# @summary This class is called from proxysql for all proxy configuration. # +# @api private class proxysql::configure { if $proxysql::mysql_servers { $proxysql::mysql_servers.each |$server| { diff --git a/manifests/init.pp b/manifests/init.pp index cd6fbd46..d73e493f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,185 +1,132 @@ -# Class: proxysql -# =========================== -# -# Full description of class proxysql here. -# -# Parameters -# ---------- -# -# * `package_name` -# The name of the ProxySQL package in your package manager. Defaults to 'proxysql' -# -# * `package_ensure` -# The ensure of the ProxySQL package resource. Defaults to 'installed' -# -# * `service_name` -# The name of the ProxySQL service resource. Defaults to 'proxysql' -# -# * `service_ensure` -# The ensure of the ProxySQL service resource. Defaults to 'running' -# -# * `datadir` -# The directory where ProxySQL will store its data. Defaults to '/var/lib/proxysql' -# -# * `datadir_mode` -# The filesystem mode for the `datadir`. Defaults to '0600' -# -# * `errorlog_file` -# The File where ProxySQL will store its error logs. Defaults to '/var/lib/proxysql/proxysql.log'. Available from ProxySQL v2.0.0 -# -# * `errorlog_file_mode` -# The filesystem mode for the `errorlog_file`. Defaults to '0600'. Available from ProxySQL v2.0.0 -# -# * `errorlog_file_owner` -# Owner of the `errorlog_file`. Defaults to 'proxysql'. Available from ProxySQL v2.0.0 -# -# * `errorlog_file_group` -# Group of the `errorlog_file`. Defaults to 'proxysql'. Available from ProxySQL v2.0.0 -# -# * `manage_selinux` -# Whether to create the required selinux rules for logrotate to work. Defaults to `true`, but is only applicable to systems where SELinux is active (`enforcing` or `permissive`). +# @summary Install and configure ProxySQL. +# +# @param package_name +# The name of the ProxySQL package in your package manager. +# @param package_ensure +# The ensure of the ProxySQL package resource. +# @param package_install_options +# An array of additional options to pass when installing a package. +# @param service_name +# The name of the ProxySQL service resource. +# @param service_ensure +# The ensure of the ProxySQL service resource. +# @param datadir +# The directory where ProxySQL will store its data. +# @param datadir_mode +# The filesystem mode for the `datadir`. +# @param errorlog_file +# The File where ProxySQL will store its error logs. Available from ProxySQL v2.0.0 +# @param errorlog_file_mode +# The filesystem mode for the `errorlog_file`. Available from ProxySQL v2.0.0 +# @param errorlog_file_owner +# Owner of the `errorlog_file`. Available from ProxySQL v2.0.0 +# @param errorlog_file_group +# Group of the `errorlog_file`. Available from ProxySQL v2.0.0 +# @param manage_selinux +# Whether to create the required selinux rules for logrotate to work. # This parameter also requires the `puppet/selinux` module to be installed. -# -# * `manage_mysql_client` -# Whether to include the mysql::client class. Defaults to `true` +# @param manage_mysql_client +# Whether to include the mysql::client class. # You may have mysql::client included or managed with different parameters elsewhere in your catalogue. -# -# * `listen_ip` -# The ip where the ProxySQL service will listen on. Defaults to '0.0.0.0' aka all configured IP's on the machine -# -# * `listen_port` -# The port where the ProxySQL service will listen on. Defaults to '6033' -# -# * `listen_socket` -# The socket where the ProxySQL service will listen on. Defaults to '/tmp/proxysql.sock' -# -# * `admin_username` -# The username to connect to the ProxySQL admin interface. Defaults to 'admin' -# -# * `admin_password` -# The password to connect to the ProxySQL admin interface. Defaults to 'admin' -# -# * `stats_username` -# The username to connect with read-only permissions to the ProxySQL admin interface. Defaults to 'stats' -# -# * `stats_password` -# The password to connect with read-only permissions to the ProxySQL admin interface. Defaults to 'stats' -# -# * `admin_listen_ip` -# The ip where the ProxySQL admin interface will listen on. Defaults to '127.0.0.1' -# -# * `admin_listen_port` -# The port where the ProxySQL admin interface will listen on. Defaults to '6032' -# -# * `admin_listen_socket` +# @param listen_ip +# The ip where the ProxySQL service will listen on. +# @param listen_port +# The port where the ProxySQL service will listen on. +# @param listen_socket +# The socket where the ProxySQL service will listen on. +# @param admin_username +# The username to connect to the ProxySQL admin interface. +# @param admin_password +# The password to connect to the ProxySQL admin interface. +# @param stats_username +# The username to connect with read-only permissions to the ProxySQL admin interface. +# @param stats_password +# The password to connect with read-only permissions to the ProxySQL admin interface. +# @param admin_listen_ip +# The ip where the ProxySQL admin interface will listen on. +# @param admin_listen_port +# The port where the ProxySQL admin interface will listen on. +# @param admin_listen_socket # The socket where the ProxySQL admin interface will listen on. Changing this on a running system will result in failing runs. -# Defaults to '/tmp/proxysql_admin.sock' -# -# * `monitor_username` -# The username ProxySQL will use to connect to the configured mysql_servers. Defaults to 'monitor' -# -# * `monitor_password` -# The password ProxySQL will use to connect to the configured mysql_servers. Defaults to 'monitor' -# -# * `config_file` +# @param monitor_username +# The username ProxySQL will use to connect to the configured mysql_servers. +# @param monitor_password +# The password ProxySQL will use to connect to the configured mysql_servers. +# @param config_file # The file where the ProxySQL configuration is saved. This will only be configured if `manage_config_file` is set to `true`. -# Defaults to '/etc/proxysql.cnf' -# -# * `manage_config_file` -# Determines whether this module will configure the ProxySQL configuration file. Defaults to 'true' -# -# * `mycnf_file_name` +# @param manage_config_file +# Determines whether this module will configure the ProxySQL configuration file. +# @param mycnf_file_name # Path of the my.cnf file where the connections details for the admin interface is save. This is required for the providers to work. -# This will only be configured if `manage_mycnf_file` is set to `true`. Defaults to '/root/.my.cnf' -# -# * `manage_mycnf_file` +# This will only be configured if `manage_mycnf_file` is set to `true`. +# @param manage_mycnf_file # Determines whether this module will configure the my.cnf file to connect to the admin interface. -# This is required for the providers to work. Defaults to 'true' -# -# * `restart` -# Determines whether this module will restart ProxySQL after reconfiguring the config file. Defaults to 'false' -# -# * `load_to_runtime` -# Specifies whether te managed ProxySQL resources should be immediately loaded to the active runtime. Boolean, defaults to 'true'. -# -# * `save_to_disk` -# Specifies whether te managed ProxySQL resources should be immediately save to disk. Boolean, defaults to 'true'. -# -# * `manage_repo` -# Determines whether this module will manage the repositories where ProxySQL might be. Defaults to 'true' -# -# * `version` -# The version of proxysql being managed. This parameter affects the repository configured when `manage_repo == true` and how the service is managed. -# It does not affect the package version being installed. It is used as a hint to the puppet module on how to configure proxysql. To control the exact version -# deployed, use `package_name` or `package_source`. Defaults to the version currently installed, or `2.0.7` if the `proxysql_version` fact is not yet -# available. -# -# * `package_source` +# This is required for the providers to work. +# @param restart +# Determines whether this module will restart ProxySQL after reconfiguring the config file. +# @param load_to_runtime +# Specifies whether te managed ProxySQL resources should be immediately loaded to the active runtime. +# @param save_to_disk +# Specifies whether te managed ProxySQL resources should be immediately save to disk. +# @param manage_repo +# Determines whether this module will manage the repositories where ProxySQL might be. +# @param version +# The version of proxysql being managed. This parameter affects the repository configured when `manage_repo == true` and how the service is managed. +# It does not affect the package version being installed. It is used as a hint to the puppet module on how to configure proxysql. To control the exact version +# deployed, use `package_name` or `package_source`. Currently defaults to '2.0.7' or the value of the `proxysql_version` fact. +# @param package_source # location of a proxysql package. When specified, this package will be installed with the `package\_provider` and the `manage_repo` setting will be ignored. # Since version 4 of this module, this defaults to `undef` and needs to be specified when you don't want to use a package from a repository. -# -# * `package_provider` -# provider for `package_source`. defaults to `dpkg` for debian-based, and `rpm` for redhat systems. -# -# * `package_checksum_value` +# @param package_provider +# provider for `package_source`. +# @param package_checksum_value # The checksum of the package. Optional and only applicable when `package_source` is provided. -# -# * `package_checksum_type` +# @param package_checksum_type # The 'type' of `package_checksum_value`. Optional and only applicable when `package_checksum_value` is provided. -# -# * `sys_owner` -# owner of the datadir and config_file, defaults to root or proxysql depending on `version` -# -# * `sys_group` -# group of the datadir and config_file, defaults to root or proxysql depending on `version` -# -# * `override_config_settings` -# Which configuration variables should be overriden. Hash, defaults to {} (empty hash). -# -# * `cluster_name` +# @param package_dependencies +# A list of packages which should be additionally installed. +# @param sys_owner +# Owner of the datadir and config_file. +# @param sys_group +# Group of the datadir and config_file. +# @param override_config_settings +# Which configuration variables should be overriden. +# @param node_name +# The name of the node. +# @param cluster_name # If set, proxysql_servers with the same cluster_name will be automatically added to the same cluster and will -# synchronize their configuration parameters. Defaults to undef -# -# * `cluster_username` +# synchronize their configuration parameters. +# @param cluster_username # The username ProxySQL will use to connect to the configured mysql_clusters -# Defaults to 'cluster' -# -# * `cluster_password` -# The password ProxySQL will use to connect to the configured mysql_clusters. Defaults to 'cluster' -# -# * `mysql_client_package_name` -# The name of the mysql client package in your package manager. Defaults to undef -# -# * `manage_hostgroup_for_servers` +# @param cluster_password +# The password ProxySQL will use to connect to the configured mysql_clusters. +# @param mysql_client_package_name +# The name of the mysql client package in your package manager. +# @param manage_hostgroup_for_servers # Determines whether this module will manage hostgroup_id for mysql_servers. -# If false - it will skip difference in this value between manifest and defined in ProxySQL. Defaults to 'true' -# -# * `mysql_servers` -# Array of mysql_servers, that will be created in ProxySQL. Defaults to undef -# -# * `mysql_users` -# Array of mysql_users, that will be created in ProxySQL. Defaults to undef -# -# * `mysql_hostgroups` -# Array of mysql_hostgroups, that will be created in ProxySQL. Defaults to undef -# -# * `mysql_rules` -# Array of mysql_rules, that will be created in ProxySQL. Defaults to undef -# -# * `schedulers` -# Array of schedulers, that will be created in ProxySQL. Defaults to undef -# -# * `split_config` +# If false - it will skip difference in this value between manifest and defined in ProxySQL. +# @param mysql_servers +# Array of mysql_servers, that will be created in ProxySQL. +# @param mysql_users +# Array of mysql_users, that will be created in ProxySQL. +# @param mysql_hostgroups +# Array of mysql_hostgroups, that will be created in ProxySQL. +# @param mysql_group_replication_hostgroups +# Hash of mysql_group_replication_hostgroups, that will be created in ProxySQL. +# @param mysql_galera_hostgroups +# Hash of mysql_galera_hostgroups, that will be created in ProxySQL. +# @param mysql_rules +# Array of mysql_rules, that will be created in ProxySQL. +# @param schedulers +# Array of schedulers, that will be created in ProxySQL. +# @param split_config # If set, ProxySQL config file will be split in 2: main config file with admin and mysql variables -# and proxy config file with servers\users\hostgroups\scheduler params. Defaults to false -# -# * `proxy_config_file` +# and proxy config file with servers\users\hostgroups\scheduler params. +# @param proxy_config_file # The file where servers\users\hostgroups\scheduler\rules params of ProxySQL configuration are saved -# This will only be configured if `split_config` is set to `true`. Defaults to 'proxysql_proxy.cnf' -# -# * `manage_proxy_config_file` -# Determines whether this module will update the ProxySQL proxy configuration file. Defaults to 'true' -# +# This will only be configured if `split_config` is set to `true`. +# @param manage_proxy_config_file +# Determines whether this module will update the ProxySQL proxy configuration file. class proxysql ( Optional[String[1]] $cluster_name = undef, String $package_name = 'proxysql', diff --git a/manifests/install.pp b/manifests/install.pp index 822a2f37..88130418 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -1,7 +1,6 @@ -# == Class proxysql::install -# -# This class is called from proxysql for install. +# @summary This class is called from proxysql for install. # +# @api private class proxysql::install { if $proxysql::package_source { case $facts['os']['family'] { diff --git a/manifests/params.pp b/manifests/params.pp index 376479bd..9374a625 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,8 +1,6 @@ -# == Class proxysql::params -# -# This class is meant to be called from proxysql. -# It sets variables according to platform. +# @summary It sets variables according to platform. # +# @api private class proxysql::params { $datadir = '/var/lib/proxysql' diff --git a/manifests/prerequisites.pp b/manifests/prerequisites.pp index 93a5b290..d79b5ad0 100644 --- a/manifests/prerequisites.pp +++ b/manifests/prerequisites.pp @@ -1,8 +1,6 @@ -# Class: proxysql::prerequisites -# =========================== -# -# Manage the prerequisites where the ProxySQL package might be +# @summary Manage the prerequisites where the ProxySQL package might be. # +# @api private class proxysql::prerequisites inherits proxysql { if $proxysql::sys_owner != 'root' { # let's assume that 'root' will exist and not touch that... group { $proxysql::sys_group: diff --git a/manifests/reload_config.pp b/manifests/reload_config.pp index f37f8fee..9154da48 100644 --- a/manifests/reload_config.pp +++ b/manifests/reload_config.pp @@ -1,7 +1,6 @@ -# == Class proxysql::reload_config -# -# This class is called from proxysql to update config if it changed. +# @summary This class is called from proxysql to update config if it changed. # +# @api private class proxysql::reload_config { $subscribe = $proxysql::split_config ? { true => [File['proxysql-config-file'], File['proxysql-proxy-config-file']], diff --git a/manifests/repo.pp b/manifests/repo.pp index d7521e82..d307fbab 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -1,8 +1,6 @@ -# Class: proxysql::repo -# =========================== -# -# Manage the repos where the ProxySQL package might be +# @summary Manage the repos where the ProxySQL package might be. # +# @api private class proxysql::repo { assert_private() diff --git a/manifests/selinux.pp b/manifests/selinux.pp index 50f73e67..84687ba1 100644 --- a/manifests/selinux.pp +++ b/manifests/selinux.pp @@ -1,4 +1,4 @@ -# @summary Adds selinux configuration needed for logrotate to work +# @summary Adds selinux configuration needed for logrotate to work. # # @api private class proxysql::selinux { diff --git a/manifests/service.pp b/manifests/service.pp index d052d0e1..6e113f2f 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -1,8 +1,6 @@ -# == Class proxysql::service -# -# This class is meant to be called from proxysql. -# It ensure the service is running. +# @summary This class ensures that the service is running. # +# @api private class proxysql::service { assert_private() diff --git a/types/galerahostgroup.pp b/types/galerahostgroup.pp index b66a42fa..7d7bcd18 100644 --- a/types/galerahostgroup.pp +++ b/types/galerahostgroup.pp @@ -1,3 +1,4 @@ +# @summary Represents an entry in the ProxySQL `mysql_galera_hostgroups` admin table. type Proxysql::GaleraHostgroup = Array[Hash[String, Struct[{ writer => Integer[0], backup => Integer[0], reader => Integer[0], diff --git a/types/groupreplicationhostgroup.pp b/types/groupreplicationhostgroup.pp index 5f27b3e9..1d4e1bc4 100644 --- a/types/groupreplicationhostgroup.pp +++ b/types/groupreplicationhostgroup.pp @@ -1,4 +1,4 @@ -# lint:ignore:2sp_soft_tabs +# @summary Represents a ProxySQL group replication hostgroup. type Proxysql::GroupReplicationHostgroup = Array[Hash[String, Struct[{ writer => Integer, backup => Integer, reader => Integer, @@ -7,4 +7,3 @@ Optional[writers] => Integer, Optional[writer_is_reader] => Integer[0,1], Optional[max_transactions] => Integer, }],1,1]] -# lint:endignore diff --git a/types/hostgroup.pp b/types/hostgroup.pp index b24128e6..7b461f8e 100644 --- a/types/hostgroup.pp +++ b/types/hostgroup.pp @@ -1,4 +1,3 @@ -# lint:ignore:2sp_soft_tabs +# @summary Represents a ProxySQL replication hostgroup. type Proxysql::Hostgroup = Array[Hash[String, Struct[{ writer => Integer, reader => Integer, }],1,1]] -# lint:endignore diff --git a/types/rule.pp b/types/rule.pp index 382432c7..95686bc3 100644 --- a/types/rule.pp +++ b/types/rule.pp @@ -1,4 +1,4 @@ -# lint:ignore:2sp_soft_tabs +# @summary Represents a ProxySQL query rule. type Proxysql::Rule = Array[Hash[String, Struct[{ rule_id => Integer, active => Integer, Optional[username] => String[1], @@ -24,4 +24,3 @@ Optional[log] => Integer[0,1], Optional[mirror_hostgroup] => Integer, Optional[mirror_flag_out] => Integer, }],1,1]] -# lint:endignore diff --git a/types/scheduler.pp b/types/scheduler.pp index fb47907c..bf3fa033 100644 --- a/types/scheduler.pp +++ b/types/scheduler.pp @@ -1,4 +1,4 @@ -# lint:ignore:2sp_soft_tabs +# @summary Represents a ProxySQL scheduler type Proxysql::Scheduler = Array[Hash[String, Struct[{ scheduler_id => Integer, active => Integer, Optional[interval_ms] => Integer, @@ -8,4 +8,3 @@ Optional[arg3] => String[1], Optional[arg4] => String[1], Optional[arg5] => String[1] }],1,1]] -# lint:endignore diff --git a/types/server.pp b/types/server.pp index cb486ebf..bd5973ce 100644 --- a/types/server.pp +++ b/types/server.pp @@ -1,4 +1,4 @@ -# lint:ignore:2sp_soft_tabs +# @summary Represents a ProxySQL server. type Proxysql::Server = Array[Hash[String, Struct[{ Optional[port] => Integer, hostgroup_id => Integer, Optional[status] => String[1], @@ -9,4 +9,3 @@ Optional[use_ssl] => Integer[0,1], Optional[max_latency_ms] => Integer, Optional[comment] => String[1], }],1,1]] -# lint:endignore diff --git a/types/user.pp b/types/user.pp index 1902c68c..da3dffe5 100644 --- a/types/user.pp +++ b/types/user.pp @@ -1,4 +1,4 @@ -# lint:ignore:2sp_soft_tabs +# @summary Represents a ProxySQL user. type Proxysql::User = Array[Hash[String, Struct[{ password => String[1], default_hostgroup => Integer, Optional[active] => Integer[0,1], @@ -10,4 +10,3 @@ Optional[backend] => Integer[0,1], Optional[frontend] => Integer[0,1], Optional[max_connections] => Integer, }],1,1]] -# lint:endignore