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

Tune and simplify inventory file

parent 05821fa7
No related branches found
No related tags found
No related merge requests found
Pipeline #571 failed
......@@ -127,18 +127,22 @@ ff02::2 ip6-allrouters
if not args.dry_run:
with open('inventory', 'w') as f:
f.write('''\
[all:vars]
ansible_become=true
ansible_user=%s
ansible_ssh_common_args=\'%s -o ForwardAgent=yes -o ProxyCommand="ssh -W {{ ansible_host }}:22 -q \
{{ ansible_user }}@%s"\'
[masters]
%s ansible_user=%s ansible_become=true ansible_host=%s ansible_ssh_common_args=\'%s\'
%s ansible_host=%s
[nodes]
''' % (master_hostname, user, master_ip, args.ssh_opts))
''' % (user, args.ssh_opts, master_ip, master_hostname, hosts[master_hostname]))
for h, ip in hosts.items():
if h == master_hostname:
continue
f.write('\
%s ansible_user=%s ansible_become=true ansible_host=%s ansible_ssh_common_args=\'%s \
-o ForwardAgent=yes -o ProxyCommand="ssh -W %s:22 -q %s@%s"\'\n' % (h, user, ip, args.ssh_opts,
ip, user, master_ip))
%s ansible_host=%s \n' % (h, ip))
if component:
component.action('files')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment