Merge branch 'file_new_dirs_perms' of https://github.com/bcoca/ansible into bcoca-file_new_dirs_perms
This commit is contained in:
commit
8c7aafd5ae
1 changed files with 8 additions and 1 deletions
|
@ -165,8 +165,15 @@ def main():
|
||||||
if prev_state == 'absent':
|
if prev_state == 'absent':
|
||||||
if module.check_mode:
|
if module.check_mode:
|
||||||
module.exit_json(changed=True)
|
module.exit_json(changed=True)
|
||||||
os.makedirs(path)
|
|
||||||
changed = True
|
changed = True
|
||||||
|
curpath = ''
|
||||||
|
for dirname in path.split('/'):
|
||||||
|
curpath = '/'.join([curpath, dirname])
|
||||||
|
if not os.path.exists(curpath):
|
||||||
|
os.mkdir(curpath)
|
||||||
|
tmp_file_args = file_args.copy()
|
||||||
|
tmp_file_args['path']=curpath
|
||||||
|
changed = module.set_fs_attributes_if_different(tmp_file_args, changed)
|
||||||
|
|
||||||
changed = module.set_fs_attributes_if_different(file_args, changed)
|
changed = module.set_fs_attributes_if_different(file_args, changed)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue