Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

if directory exists create a file else check if it is a symlink

$
0
0
In most nodes, the /usr/share/tomcat7/lib directory exists and placing a jar inside that works fine. But on few nodes, instead of that directory, there is a symlink to /usr/share/java/tomcat7 exist. So create a file inside the directory /usr/share/tomcat7/lib fails. How do I create the file in the correct directories based on the symlinks. 1) If symlink exists, create jar files in the linked folder(eg: /usr/share/java/tomcat7) 2) If there's no symlink and just a direct directory, create the file in that directory(eg: /usr/share/tomcat7/lib) Please provide examples. node1:mydata/myfolder #ls -lah /usr/share/tomcat7/lib lrwxrwxrwx 1 root root 23 Aug 17 15:44 /usr/share/tomcat7/lib -> /usr/share/java/tomcat7 Thanks in advance. P.S: I found some links => manage examples in the web, but not sure how to add both test cases together to bring up an optimum solution.

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>