From: Alfredo Deza Date: Wed, 2 Apr 2014 16:53:22 +0000 (-0400) Subject: add an argument to define master X-Git-Tag: v1.5.0~16^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=474d6b96d9bbfbaa7e8182d9e1b273a7fa5e840b;p=ceph-deploy.git add an argument to define master Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/calamari.py b/ceph_deploy/calamari.py index 694015b..945fe46 100644 --- a/ceph_deploy/calamari.py +++ b/ceph_deploy/calamari.py @@ -1,4 +1,6 @@ +import errno import logging +import os from ceph_deploy import hosts, exc from ceph_deploy.lib.remoto import process @@ -68,6 +70,22 @@ def connect(args): ) ) + # Emplace minion config prior to installation so that it is present + # when the minion first starts. + minion_config_dir = os.path.join('/etc/salt/', 'minion.d') + minion_config_file = os.path.join(minion_config_dir, 'calamari.conf') + + rlogger.debug('creating config dir: %s' % minion_config_dir) + distro.conn.remote_module.makedir(minion_config_dir, [errno.EEXIST]) + + rlogger.debug( + 'creating the calamari salt config: %s' % minion_config_file + ) + distro.conn.remote_module.write_file( + minion_config_file, + 'master: %s\n' % args.master + ) + distro.pkg.install(distro, 'salt-minion') # redhat/centos need to get the service started @@ -111,6 +129,13 @@ def make(parser): ) + parser.add_argument( + '--master', + nargs='?', + metavar='MASTER SERVER', + help="The domain for the Calamari master server" + ) + parser.add_argument( 'hosts', nargs='+',