Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
dfdb8ad3
Commit
dfdb8ad3
authored
Aug 05, 2013
by
Dimitris Aragiorgis
Committed by
Christos Stavrakakis
Sep 24, 2013
Browse files
Pass key_inject in setup_env
Signed-off-by:
Dimitris Aragiorgis
<
dimara@grnet.gr
>
parent
e84191ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
snf-deploy/fabfile.py
View file @
dfdb8ad3
...
...
@@ -16,13 +16,14 @@ from snfdeploy import massedit
def
setup_env
(
confdir
=
"conf"
,
packages
=
"packages"
,
templates
=
"files"
,
cluster_name
=
"ganeti1"
,
autoconf
=
False
,
disable_colors
=
False
):
templates
=
"files"
,
cluster_name
=
"ganeti1"
,
autoconf
=
False
,
disable_colors
=
False
,
key_inject
=
False
):
print
(
"Loading configuration for synnefo..."
)
print
(
" * Using config files under %s..."
%
confdir
)
print
(
" * Using %s and %s for packages and templates accordingly..."
%
(
packages
,
templates
))
autoconf
=
ast
.
literal_eval
(
autoconf
)
disable_colors
=
ast
.
literal_eval
(
disable_colors
)
env
.
key_inject
=
ast
.
literal_eval
(
key_inject
)
conf
=
Conf
.
configure
(
confdir
=
confdir
,
cluster_name
=
cluster_name
,
autoconf
=
autoconf
)
env
.
env
=
Env
(
conf
)
...
...
@@ -226,8 +227,11 @@ def check_ssh():
@
roles
(
"ips"
)
def
add_keys
():
if
not
ast
.
literal_eval
(
env
.
env
.
key_inject
)
:
if
not
env
.
key_inject
:
debug
(
env
.
host
,
"Skipping ssh keys injection.."
)
return
else
:
debug
(
env
.
host
,
"Adding rsa/dsa keys.."
)
try_run
(
"mkdir -p /root/.ssh"
)
cmd
=
"""
for f in $(ls /root/.ssh/*); do
...
...
snf-deploy/snfdeploy/__init__.py
View file @
dfdb8ad3
...
...
@@ -255,9 +255,9 @@ def fabcommand(args, env, actions, nodes=[]):
fabcmd
+=
" --fabfile {4}/fabfile.py
\
setup_env:confdir={0},packages={1},templates={2},cluster_name={3},
\
autoconf={5},disable_colors={6}
\
autoconf={5},disable_colors={6}
,key_inject={7}
\
"
.
format
(
args
.
confdir
,
env
.
packages
,
env
.
templates
,
args
.
cluster_name
,
env
.
lib
,
args
.
autoconf
,
args
.
disable_colors
)
env
.
lib
,
args
.
autoconf
,
args
.
disable_colors
,
args
.
key_inject
)
if
nodes
:
hosts
=
[
env
.
nodes_info
[
n
].
hostname
for
n
in
nodes
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment