Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db.conf configuration file #64

Open
DrDarch opened this issue Apr 14, 2017 · 0 comments
Open

db.conf configuration file #64

DrDarch opened this issue Apr 14, 2017 · 0 comments

Comments

@DrDarch
Copy link
Contributor

DrDarch commented Apr 14, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant