If i have many servers which have same apps. how to write /etc/confd/conf.d/myconfig.toml

41 views
Skip to first unread message

Dmitriy Matveev

unread,
Sep 6, 2017, 8:00:06 AM9/6/17
to confd-users
Hi all.

I have many servers which contain the same amount of apps. Apps are stored in the same folder which have same path in system for all servers.
I want to update configs of this configs through confd+etcd

I have one /etc/confd/conf.d/myconfig.toml and /etc/confd/templates/myconfig.conf.tmpl 
but etcd have structure
Configs----\
                 \----server1\
                 \                 \ app1----token=123 ---timeout=10 url=backend.test1.com
                 \                  \app2----
                 \                   \app3----
                 \
                 \----server2\
                 \                 \ app1----token=098 ---timeout=10 url=backend.dev10.com
                 \                  \app2----
                 \                   \app3----
                 \
                 \-----serverN

How to make configs, through one myconfig.toml and myconfig.conf.toml,  different for all servers which i have?
or it's impusible, and i should have different *.toml and *.conf.toml for each server?

I general i want to create one git repository which will be contain all tomls and conf.tomls for all apps of all servers; And i want to make changes in one repository but not on each servers.

gea...@gmail.com

unread,
Sep 15, 2017, 10:40:29 AM9/15/17
to confd-users
Hi!

You can't template multiple files using one config/template pair in confd. The options are either to have multiple config/template pairs or run each app in it's own container and run confd in there with different prefixes, like confd --prefix /server1 and confd --prefix /server2. The problem is, you can't change the destination file without changing config first.

追随

unread,
Sep 19, 2017, 4:25:14 AM9/19/17
to confd-users
Hi, I think you can set env var for every server to do this.

在 2017年9月6日星期三 UTC+8下午8:00:06,Dmitriy Matveev写道:
Reply all
Reply to author
Forward
0 new messages