Revision e5b4db06

b/snf-deploy/fabfile.py
16 16

  
17 17

  
18 18
def setup_env(confdir="conf", packages="packages",
19
              templates="files", cluster_name="ganeti1", autoconf=False, disable_colors=False):
19
              templates="files", cluster_name="ganeti1", autoconf=False, disable_colors=False, key_inject=False):
20 20
    print("Loading configuration for synnefo...")
21 21
    print(" * Using config files under %s..." % confdir)
22 22
    print(" * Using %s and %s for packages and templates accordingly..." % (packages, templates))
23 23

  
24 24
    autoconf = ast.literal_eval(autoconf)
25 25
    disable_colors = ast.literal_eval(disable_colors)
26
    env.key_inject = ast.literal_eval(key_inject)
26 27
    conf = Conf.configure(confdir=confdir, cluster_name=cluster_name, autoconf=autoconf)
27 28
    env.env = Env(conf)
28 29

  
......
226 227

  
227 228
@roles("ips")
228 229
def add_keys():
229
    if not ast.literal_eval(env.env.key_inject):
230
    if not env.key_inject:
230 231
      debug(env.host, "Skipping ssh keys injection..")
232
      return
233
    else:
234
      debug(env.host, "Adding rsa/dsa keys..")
231 235
    try_run("mkdir -p /root/.ssh")
232 236
    cmd = """
233 237
for f in $(ls /root/.ssh/*); do
b/snf-deploy/snfdeploy/__init__.py
255 255

  
256 256
  fabcmd += " --fabfile {4}/fabfile.py \
257 257
setup_env:confdir={0},packages={1},templates={2},cluster_name={3},\
258
autoconf={5},disable_colors={6} \
258
autoconf={5},disable_colors={6},key_inject={7} \
259 259
".format(args.confdir, env.packages, env.templates, args.cluster_name,
260
         env.lib, args.autoconf, args.disable_colors)
260
         env.lib, args.autoconf, args.disable_colors, args.key_inject)
261 261

  
262 262
  if nodes:
263 263
    hosts = [env.nodes_info[n].hostname for n in nodes]

Also available in: Unified diff