Skip to content
Snippets Groups Projects
Commit ed3fcf9a authored by František Dvořák's avatar František Dvořák
Browse files

Fix the ssh keys scanning - after the /etc/hosts

parent 4c2f29ba
No related branches found
No related tags found
No related merge requests found
Pipeline #426 passed
......@@ -147,16 +147,10 @@ if 'init' in args.actions:
# the frontend to all nodes
['ssh', '-o', 'ForwardAgent=yes', '%s@%s' % (user, master_ip), cycle_all]
]
for node in hosts.keys():
# skip the frontend - covered by the command above
if node == master_hostname:
continue
# the node to all nodes
commands += [
['ssh', '-o', 'ForwardAgent=yes', '%s@%s' % (user, master_ip),
'ssh -o ForwardAgent=yes %s \'%s\'' % ('%s.%s' % (node, d), cycle_all)],
]
for ip in hosts.values():
# check the special case if it is not already frontend ('ssh-keygen -R' would be a problem)
if ip == master_ip:
continue
commands += [
['ssh-keygen', '-R', ip],
['ssh', '-o', 'ForwardAgent=yes', '-o', 'ProxyCommand=ssh -W %s:22 -q %s@%s' %
......@@ -165,6 +159,17 @@ if 'init' in args.actions:
commands += [
['ansible', '-i', './inventory', '-m', 'copy', '-a', 'src=hosts dest=/etc/hosts', 'nodes'],
]
# node to node ssh keys
# (after the /etc/hosts is distributed)
for node in hosts.keys():
# skip the frontend - already covered
if node == master_hostname:
continue
# the node to all nodes
commands += [
['ssh', '-o', 'ForwardAgent=yes', '%s@%s' % (user, master_ip),
'ssh -o ForwardAgent=yes %s \'%s\'' % ('%s.%s' % (node, d), cycle_all)],
]
perform_action('init', commands)
if 'wait' in args.actions:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment