I have been learning Docker for a while and been trying to migrate some of the SaltStack states that I have made for previously provisioning all my systems to partly (?) using docker. However once I have my database within a container how can I administrate it like I would with a normal locally install database on the host box?
The setup in detail: I have a master server (salt-master
) and a couple of minions (web-nginx
and web-db
) each deployed with their respective containers and stacks. The web-db
is running the postgres
container. For completeness web-nginx
has the application source code being served through an nginx
container with php-fpm
container processing. All the containers are the officials from the docker official repositories.
Now the issue is how can I use my salt states that would manage the adding/remove of users on the postgres
database? As far as I can see no-one has asked this and in "similar" questions everyone has assumed that the host machine is the master--which in my case is not true, the master is remote and the host machine is a minion itself. So to clarify salt-master > web-db > postgres(container)
where as I think salt can only do master > minion
and I need something like master > minion > minion-delegate
.
Anyone know of a way for me to do this?
As an aside I am aware that as my web-db
box is an isolated instance I can probably stop this pain and manage that server like I would normally (without docker). This would solve my problem but I wouldn't mind hearing some solutions for using it within a container.