Skip to content

Impossible to define a host in 2 different hostgroups #89

Description

@CyberLine

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.0
  • Ruby: 2.1.5p273
  • Distribution: Debian
  • Module version: 2.0.0

How to reproduce (e.g Puppet code you use)

yaml:

test::services::proxysql::servers:
  - "10.60.6.21:3306-5":
      hostname: 10.60.6.21
      port: 3306
      hostgroup_id: 5
  - "10.60.6.21:3306-10":
      hostname: 10.60.6.21
      port: 3306
      hostgroup_id: 10
  - "10.60.6.31:3306-15":
      hostname: 10.60.6.31
      port: 3306
      hostgroup_id: 15
  - "10.60.6.31:3306-20":
      hostname: 10.60.6.31
      port: 3306
      hostgroup_id: 20

then, in the manifest:
create_resources(proxy_mysql_server, $servers)

What are you seeing

Notice: /Stage[main]/Test::Services::Proxysql/Proxy_mysql_server[10.60.6.21:3306-5]/ensure: created
Notice: /Stage[main]/Test::Services::Proxysql/Proxy_mysql_server[10.60.6.21:3306-10]/ensure: created
Notice: /Stage[main]/Test::Services::Proxysql/Proxy_mysql_server[10.60.6.31:3306-15]/ensure: created
Notice: /Stage[main]/Test::Services::Proxysql/Proxy_mysql_server[10.60.6.31:3306-20]/ensure: created
Admin> SELECT * FROM mysql_servers;
+--------------+------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| hostgroup_id | hostname   | port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
+--------------+------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| 20           | 10.60.6.31 | 3306 | ONLINE | 1      | 0           | 1000            | 0                   | 0       | 0              |         |
| 10           | 10.60.6.21 | 3306 | ONLINE | 1      | 0           | 1000            | 0                   | 0       | 0              |         |
+--------------+------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+

What behaviour did you expect instead

Admin> SELECT * FROM mysql_servers;
+--------------+------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| hostgroup_id | hostname   | port | status | weight | compression | max_connections | max_replication_lag | use_ssl | max_latency_ms | comment |
+--------------+------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+
| 15           | 10.60.6.31 | 3306 | ONLINE | 1      | 0           | 1000            | 0                   | 0       | 0              |         |
| 20           | 10.60.6.31 | 3306 | ONLINE | 1      | 0           | 1000            | 0                   | 0       | 0              |         |
| 5            | 10.60.6.21 | 3306 | ONLINE | 1      | 0           | 1000            | 0                   | 0       | 0              |         |
| 10           | 10.60.6.21 | 3306 | ONLINE | 1      | 0           | 1000            | 0                   | 0       | 0              |         |
+--------------+------------+------+--------+--------+-------------+-----------------+---------------------+---------+----------------+---------+

Any additional information you'd like to impart

as the template splits each host in host, port e.g. it seems impossible to define a host in multiple hostgroups at this time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions