how to export path in bashrc via puppet script

32 views
Skip to first unread message

ayy...@orzota.com

unread,
Jul 16, 2015, 2:20:28 PM7/16/15
to puppe...@googlegroups.com
exec { file1:
                  command => "/bin/echo "export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64"; >> /home/haas/.bashrc",
        }
}


i try to added java path. facing issue.

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Syntax error at 'export'; expected '}' at /etc/puppet/modules/a/manifests/init.pp:3 on node ip-10-61-204-93.ec2.internal
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

Thanks for your commands.

Thanks,
Ayyanar

Joachim Thuau

unread,
Jul 16, 2015, 2:27:39 PM7/16/15
to puppe...@googlegroups.com

On Thursday, July 16, 2015, <ayy...@orzota.com> wrote:
exec { file1:
                  command => "/bin/echo "export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64"; >> /home/haas/.bashrc",
        }

As-is, you have a quoting problem (the 'command' value set ends just before export.

That being said, I would use a 'file_line' resource to manage that rather than an exec.

Jok

Inr Ayyanar

unread,
Jul 29, 2015, 10:08:11 AM7/29/15
to Puppet Developers, ep...@korigan.net

Thanks Jok. I am using file_line resource
Reply all
Reply to author
Forward
0 new messages