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

Read the string from the file using puppet

$
0
0
Hi , I just have a question. I need to read a variable value from the file using puppet. I wrote below line of code in a puppet $variable = inline_template("<% '/bin/sed -n 's/^ *profileName *= *//p' /opt/IBM/ResponseFiles/DMGR_Creation.txt' %>") The file DMGR_Creation.txt contains a line as profileName=ABC I need to read the value ABC . When I execute the above sed command it runs without any issue but when i run it in puppet it throws error as below Error::Syntax error at 's/^ *profileName *= *//p' in the file when I run puppet. I tried $variable = inline_template("<% '/bin/awk '/^profileName/{print $nf}' /opt/IBM/ResponseFiles/DMGR_Creation.txt' %>") but I again get error for curly brackets. Can any one please help in resolving my issue here ? Thanks

Viewing all articles
Browse latest Browse all 6104

Trending Articles



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