On 6/25/15 2:09 AM, hoize wrote:
> Hello!
>
> I want to uncomment a line in a file, for example:
>
> _/root/.bashrc_
> # export LS_OPTIONS='--color=auto'
>
>
> _after change:_
> export LS_OPTIONS='--color=auto'
>
> After some searching for a solution, I found the Augeas-Tool and then
> the Augeas-Shellvar-Provider.
> So I tried it:
>
> shellvar { "export LS_OPTIONS":
> ensure => present,
> target => "/root/.bashrc",
> uncomment => true,
> }
>
> But I always get this error, regardless how I paraphrase the ressource
> "shellvar".
>
> An alternative solution would be great, too. But with the file_line
> ressource, I can't imagine, that there is an very short and easy way.
>
> I hope someone can help me!
>
> Thank You!
>
> Hoize
Hi Hoize,
Since we're talking about a comment, does it really matter if it is
still in the file? Bash certainly does not think so. The file_line()
function should work well for you if you want to manage individual lines
as opposed to the entire file. I would recommend this approach for its
simplicity instead of Augeas.
Best regards,
-g
--
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/558BA8F5.9010708%40garretthoneycutt.com.
For more options, visit https://groups.google.com/d/optout.