From 6354898b095dee0e11986ecb04db903e1c5844bf Mon Sep 17 00:00:00 2001 From: Luke Antins Date: Thu, 18 Oct 2012 01:04:52 +0100 Subject: [PATCH 1/2] Copy module can replace symlink with a real file. --- library/copy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/copy b/library/copy index 3d246845021..90fbd71b409 100755 --- a/library/copy +++ b/library/copy @@ -100,11 +100,15 @@ def main(): module.fail_json(msg="Destination %s not writable" % (os.path.dirname(dest))) backup_file = None - if md5sum_src != md5sum_dest: + if md5sum_src != md5sum_dest or os.path.islink(dest): try: if backup: if os.path.exists(dest): backup_file = module.backup_local(dest) + # allow for conversion from symlink. + if os.path.islink(dest): + os.unlink(dest) + open(dest, 'w').close() #TODO:pid + epoch should avoid most collisions, hostname/mac for those using nfs? # might be an issue with exceeding path length dest_tmp = "%s.%s.%s.tmp" % (dest,os.getpid(),time.time()) From 7d41045b2f61b1028b99dbb9ee3fa9ce4a621ddb Mon Sep 17 00:00:00 2001 From: Luke Antins Date: Thu, 18 Oct 2012 01:20:40 +0100 Subject: [PATCH 2/2] Erroneous space in facter documentation. --- library/facter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/facter b/library/facter index b4975d606e8..491eb7ab039 100755 --- a/library/facter +++ b/library/facter @@ -31,7 +31,7 @@ description: version_added: "0.2" options: [] examples: - - code: ansible www.example.net -m facter + - code: ansible www.example.net -m facter description: "Example command-line invocation" notes: [] requirements: [ "facter", "ruby-json" ]