autocluster: Run ssh setup during host setup
authorMartin Schwenke <martin@meltin.net>
Tue, 8 Oct 2019 04:46:16 +0000 (15:46 +1100)
committerMartin Schwenke <martin@meltin.net>
Tue, 8 Oct 2019 05:39:00 +0000 (16:39 +1100)
Signed-off-by: Martin Schwenke <martin@meltin.net>
autocluster.py

index f897e781583a10011b3120b8ff0929c4b5b0f9a1..74c30ed906043077b0420adcfcc4d84ab3b86c6a 100755 (executable)
@@ -706,12 +706,16 @@ def cluster_command(cluster, command):
         usage()
 
 
+def get_host_setup_path(file):
+    '''Return the path for host setup file'''
+
+    return os.path.join(INSTALL_DIR, 'ansible/host', file)
+
+
 def get_platform_file(platform):
     '''Return the name of the host setup file for platform'''
 
-    return os.path.join(INSTALL_DIR,
-                        'ansible/host',
-                        'autocluster_setup_%s.yml' % platform)
+    return get_host_setup_path('autocluster_setup_%s.yml' % platform)
 
 
 def sanity_check_platform_name(platform):
@@ -729,8 +733,9 @@ def host_setup(platform):
     announce('host', platform, 'setup')
 
     platform_file = get_platform_file(platform)
+    ssh_file = get_host_setup_path('autocluster_setup_%s.yml' % 'ssh')
     os.environ['ANSIBLE_RETRY_FILES_ENABLED'] = 'false'
-    args = ['ansible-playbook', platform_file]
+    args = ['ansible-playbook', platform_file, ssh_file]
 
     try:
         subprocess.check_call(args)