Hi Thanuja,

Always follow the Puppetlabs language style guide [1] when writing puppet
manifests.
Even the above code is working, the best practice to surround the variables
with curly braces.

[1] https://docs.puppetlabs.com/guides/style_guide.html#variables

On Tue, Mar 1, 2016 at 6:59 PM, Thanuja Uruththirakodeeswaran <
thanu...@wso2.com> wrote:

> Thanks Manula !!!
>
> The error is because of the syntax error that we need to use *" " *for if
> the value has variable. Here the cwd attribute value has carbon_home
> variable. Following code will resolve the above puppet error:
>
> exec { "Applying secure vault":
>   user               => $user,
>   path               => 
> '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
>   cwd                => "$carbon_home/bin",
>   command            => "sh ciphertool.sh -Dconfigure 
> -Dpassword=$key_store_password",
>   logoutput          => 'on_failure'
> }
>
> Thanks.
>
> On Tue, Mar 1, 2016 at 6:27 PM, Thanuja Uruththirakodeeswaran <
> thanu...@wso2.com> wrote:
>
>> Hi All,
>>
>> I'm trying to change the cipher tool execution command at [1] so that
>> first I need to go inside the $carbon_home/bin directory and then trying to
>> execute the cipher tool with the following code snippet (We need to do this
>> for carbon kernel 4.2.0 based products as discussed in [2]) :
>>
>> exec { "Applying secure vault":
>>   user               => $user,
>>   path               => 
>> '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
>>   cwd                => '$carbon_home/bin',
>>   command            => 'sh ciphertool.sh -Dconfigure 
>> -Dpassword=$key_store_password',
>>   logoutput          => 'on_failure'
>> }
>>
>> But the above exec fails with below error:
>>
>> ==> brs.dev.wso2.org: Error: Parameter cwd failed on Exec[Applying
>> secure vault]: cwd must be a fully qualified path at
>> /tmp/vagrant-puppet/modules-3737bfc9b53e65d741f2b9b350c2e2ca/wso2base/manifests/apply_secure_vault.pp:28
>> ==> brs.dev.wso2.org: Wrapped exception:
>> ==> brs.dev.wso2.org: cwd must be a fully qualified path
>>
>> Please give suggestion to resolve this error.
>>
>> [1].
>> https://github.com/wso2/puppet-modules/blob/master/modules/wso2base/manifests/apply_secure_vault.pp#L25
>> [2]. http://mail.wso2.org/mailarchive/dev/2014-April/029446.html
>>
>> Thanks.
>>
>> --
>> Thanuja Uruththirakodeeswaran
>> Software Engineer
>> WSO2 Inc.;http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: +94 774363167
>>
>
>
>
> --
> Thanuja Uruththirakodeeswaran
> Software Engineer
> WSO2 Inc.;http://wso2.com
> lean.enterprise.middleware
>
> mobile: +94 774363167
>



-- 
Regards,
Manula Waidyanatha
Systems Engineer, WSO2, Inc.
Phone: +94 774 195853
Blog: blog.manula.org
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to