return out
-def generate_config_yml(config, outdir):
+def generate_config_yml(cluster, config):
'''Output combined YAML configuration to "config.yml"'''
- outfile = os.path.join(outdir, 'config.yml')
+ outfile = get_config_file_path(cluster)
with open(outfile, 'w') as stream:
out = yaml.dump(config, default_flow_style=False)
return os.path.join(os.getcwd(), '.autocluster', cluster)
+def get_config_file_path(cluster):
+ '''Return the name of the generated config file for cluster'''
+
+ return os.path.join(get_state_dir(cluster), 'config.yml')
+
+
def announce(group, cluster, command):
'''Print a banner announcing the current step'''
if err.errno != errno.EEXIST:
raise
- generate_config_yml(config, outdir)
+ generate_config_yml(cluster, config)
generate_hosts(cluster, config, outdir)
generate_ssh_config(config, outdir)
generate_ansible_inventory(config, outdir)
os.environ['ANSIBLE_RETRY_FILES_ENABLED'] = 'false'
state_dir = get_state_dir(cluster)
- config_file = os.path.join(state_dir, 'config.yml')
+ config_file = get_config_file_path(cluster)
inventory = os.path.join(state_dir, 'ansible.inventory')
playbook = os.path.join(INSTALL_DIR, 'ansible/node/site.yml')
args = ['ansible-playbook',