Skip to content

db.conf configuration file  #64

@DrDarch

Description

@DrDarch

Hi,

Let me know if this could be usable for a pull request.

I added a generation of the configuration file (/etc/db/db.conf).
The file contains a machine IP address, server role (master/slave) etc..., this informations could be used by some administration script (provided by you, for example, which changing roles of master and slave instances, or doing backup etc... ).

The db.conf.jinja:

<redis>
    <user>{{ salt['pillar.get']('redis:dbconf:user', '') }}</user>
    <password>{{ salt['pillar.get']('redis:dbconf:password', '') }}</password>
    <backup>{{ salt['pillar.get']('redis:dbconf:backup', '') }}</backup>
    <master_ip>{{ salt['pillar.get']('redis:dbconf:master_ip', '') }}</master_ip>
    <master_netmask>{{ salt['pillar.get']('redis:dbconf:master_netmask', '') }}</master_netmask>
    <hardwar_ip>{{ salt['pillar.get']('redis:dbconf:hardwar_ip', '') }}</hardwar_ip>
    <hardwar_mask>{{ salt['pillar.get']('redis:dbconf:hardwar_mask', '') }}</hardwar_mask>
    <role>{{ salt['pillar.get']('redis:dbconf:role', '') }}</role>
</redis>

and you can define the variables via pillar:

  dbconf:
    user: admin666
    master_ip: 123.123.123.123

Technically, there are only a few modifications in the original formula code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions