How to mask the template resource ouput

Hello,

I am copying a script using template resource to my host so I can execute it in my recipe using exec resource. I am reading password from data bag and putting it the script file, execute the script and delete it. Everything works fine. But below template resource spits the password(content of template file) on stdout. Is there a way I can mask it and stop template resource to not show output in stdout ? (only for this resource)

template ‘/tmp/dbconf.sh’ do
source 'dbconf.sh.erb’
mode '0755’
owner 'root’
group 'root’
variables(
:root_password => data_item[‘mysql_root_password’]
)
end

execute ‘set-password’ do
command '/tmp/dbconf.sh’
not_if do ::File.exists?("/etc/myapp") end
end

file ‘/tmp/dbconf.sh’ do
action :delete
end

Thanks,
Maneesh

Use ’ sensitive true ’ action for execute resource :smile:

I don’t care about the output of execute resource, which I can redirect to null if I want to anyway. My question was about template resource.

O.I.C:

try searching “quiet_template”. i know there was a bug/enhancement raised
for it.

oh, wait this bug was closed: https://tickets.opscode.com/browse/CHEF-4639
And my previous answer is still applicable for template as well, go figure
now