Skip to content
Snippets Groups Projects
Verified Commit 662b0411 authored by Varac's avatar Varac
Browse files

Create group_vars/all/ dir if non-existant

parent 50df3e2b
No related branches found
No related tags found
No related merge requests found
......@@ -152,6 +152,12 @@ class Cluster:
file_contents = yaml.safe_dump(settings, default_flow_style=False)
log.debug(file_contents)
# Create CLUSTER_DIR/group_vars/all/ is non-existant
vars_dir = os.path.dirname(self.settings_file)
if not os.path.exists(vars_dir):
os.makedirs(vars_dir)
with open(self.settings_file, 'w') as stream:
stream.write(file_contents)
log.info("Created %s", self.settings_file)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment