Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
e623911d
Commit
e623911d
authored
May 14, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'bcoca-file_new_dirs_perms' into devel
parents
bf405ef7
a9311a5d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
lib/ansible/utils/module_docs_fragments/files.py
+8
-8
library/files/file
+8
-1
No files found.
lib/ansible/utils/module_docs_fragments/files.py
View file @
e623911d
...
@@ -31,14 +31,14 @@ options:
...
@@ -31,14 +31,14 @@ options:
state:
state:
description:
description:
- If C(directory), all immediate subdirectories will be created if they
- If C(directory), all immediate subdirectories will be created if they
do not exist
. If C(file), the file will NOT be created if it does not
do not exist
, since 1.7 they will be created with the supplied permissions.
exist, see the M(copy) or M(template) module if you want that behavior.
If C(file), the file will NOT be created if it does not exist, see the M(copy)
If C(link), the symbolic link will be created or changed. Use C(hard)
or M(template) module if you want that behavior. If C(link), the symbolic
for hardlinks. If C(absent), directories will be recursively deleted
,
link will be created or changed. Use C(hard) for hardlinks. If C(absent)
,
and files or symlinks will be unlinked. If C(touch) (new in 1.4), an empty file will
directories will be recursively deleted, and files or symlinks will be unlinked.
be created if the c(path) does not exist, while an existing file or
If C(touch) (new in 1.4), an empty file will be created if the c(path) does not
directory will receive updated file access and modification times (similar
exist, while an existing file or directory will receive updated file access and
to the way `touch` works from the command line).
modification times (similar
to the way `touch` works from the command line).
required: false
required: false
default: file
default: file
choices: [ file, link, directory, hard, touch, absent ]
choices: [ file, link, directory, hard, touch, absent ]
...
...
library/files/file
View file @
e623911d
...
@@ -165,8 +165,15 @@ def main():
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment