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
0d90127a
Commit
0d90127a
authored
Sep 22, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dmage-devel' into devel
parents
f16e107b
56954a20
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
2 deletions
+39
-2
library/files/file
+2
-2
test/integration/roles/test_file/tasks/main.yml
+37
-0
No files found.
library/files/file
View file @
0d90127a
...
...
@@ -257,8 +257,8 @@ def main():
else
:
relpath
=
os
.
path
.
dirname
(
path
)
absrc
=
os
.
path
.
normpath
(
'
%
s/
%
s'
%
(
relpath
,
os
.
path
.
basename
(
src
))
)
if
not
os
.
path
.
exists
(
src
)
and
not
os
.
path
.
exists
(
absrc
)
and
not
force
:
absrc
=
os
.
path
.
join
(
relpath
,
src
)
if
not
os
.
path
.
exists
(
absrc
)
and
not
force
:
module
.
fail_json
(
path
=
path
,
src
=
src
,
msg
=
'src file does not exist, use "force=yes" if you really want to create the link:
%
s'
%
absrc
)
if
state
==
'hard'
:
...
...
test/integration/roles/test_file/tasks/main.yml
View file @
0d90127a
...
...
@@ -252,6 +252,43 @@
-
'
file17_result.failed
==
true'
-
'
file17_result.state
==
"directory"'
-
name
:
create soft link to directory using absolute path
file
:
src=/ dest={{output_dir}}/root state=link
register
:
file18_result
-
name
:
verify that the result was marked as changed
assert
:
that
:
-
"
file18_result.changed
==
true"
-
name
:
create another test sub-directory
file
:
dest={{output_dir}}/sub2 state=directory
register
:
file19_result
-
name
:
verify that the new directory was created
assert
:
that
:
-
'
file19_result.changed
==
true'
-
'
file19_result.state
==
"directory"'
-
name
:
create soft link to relative file
file
:
src=../sub1/file1 dest={{output_dir}}/sub2/link1 state=link
register
:
file20_result
-
name
:
verify that the result was marked as changed
assert
:
that
:
-
"
file20_result.changed
==
true"
-
name
:
create soft link to relative directory
file
:
src=sub1 dest={{output_dir}}/sub1-link state=link
register
:
file21_result
-
name
:
verify that the result was marked as changed
assert
:
that
:
-
"
file21_result.changed
==
true"
-
name
:
test file creation with symbolic mode
file
:
dest={{output_dir}}/test_symbolic state=touch mode=u=rwx,g=rwx,o=rwx
register
:
result
...
...
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