Created
December 14, 2015 13:15
-
-
Save s5unty/cd37b518c05d1764dc94 to your computer and use it in GitHub Desktop.
docker env for the SaltStack study
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
hosts=' | |
sz-iface-jco-qa | |
sz-iface-jco-prod | |
sz-esb-zato-prod | |
sz-esb-zato-qa | |
sz-esb-mq-prod | |
sz-esb-mq-qa | |
nj-db-mes-master-prod | |
nj-db-mes-slaver-prod | |
nj-db-mes-qa | |
nj-esb-zato-prod | |
nj-esb-zato-qa | |
nj-esb-mq-prod | |
nj-esb-mq-qa | |
bj-db-scm-cn-master-prod | |
bj-db-scm-cn-slaver-prod | |
bj-db-scm-cn-qa | |
bj-esb-zato-prod | |
bj-esb-zato-qa | |
bj-esb-mq-prod | |
bj-esb-mq-qa | |
us-db-scm-en-master-prod | |
us-db-scm-en-slaver-prod | |
us-db-scm-en-qa | |
us-db-scm-ja-master-prod | |
us-db-scm-ja-slaver-prod | |
us-db-scm-ja-qa | |
us-esb-zato-prod | |
us-esb-zato-qa | |
us-esb-mq-prod | |
us-esb-mq-qa | |
nj-order-prod | |
nj-mes-man-prod | |
nj-mes-mob-prod | |
nj-mes-act-prod | |
nj-mes-all-qa | |
nj-ship-prod | |
us-www-en-qa | |
us-www-ja-qa | |
bj-www-cn-qa | |
bj-order-cn-prod | |
bj-order-cn-qa | |
bj-gearman-cn-qa | |
bj-gearman-cn-worker-prod | |
bj-gearman-cn-api-prod | |
us-order-en-prod | |
us-order-en-qa | |
us-gearman-en-worker-prod | |
us-gearman-en-api-prod | |
us-gearman-en-qa | |
us-order-ja-prod | |
us-order-ja-qa | |
us-gearman-ja-work-prod | |
us-gearman-ja-api-prod | |
us-gearman-ja-qa | |
nj-ship-qa | |
' | |
for host in $hosts; do | |
docker run -it -d --hostname $host --name $host salt-minion bash | |
docker exec $host sh -c "echo \"master: 172.17.42.1\" > /etc/salt/minion.d/master.conf" | |
docker exec $host sh -c "echo \"id: $host\" > /etc/salt/minion.d/hostname.conf" | |
docker exec $host /etc/init.d/salt-minion restart | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM salt-minion | |
ADD salt-2015.5.3+ds-1trusty1 /var/tmp/ | |
RUN sh -c "dpkg -i /var/tmp/salt-2015.5.3+ds-1trusty1/*.deb || apt-get install -y -f" | |
RUN touch /var/log/salt/minion | |
ENTRYPOINT service salt-minion restart && tail -f /var/log/salt/minion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment