rylarson / chef-java_properties Goto Github PK
View Code? Open in Web Editor NEWA chef cookbook for manipulating java properties files
A chef cookbook for manipulating java properties files
The properties file is text/plain; charset=iso-8859-1
in chef recipe:
java_properties '/opt/IBM/JazzTeamServer/server/conf/dcc/teamserver.properties' do
properties_file '/opt/IBM/JazzTeamServer/server/conf/dcc/teamserver.properties'
property 'com.ibm.rational.datacollection.initialized', 'false'
only_if { node['clm']['version'].to_s >= '6.0.3' }
end
================================================================================�
�Error executing action merge
on resource 'java_properties[/opt/IBM/JazzTeamServer/server/conf/dcc/teamserver.properties]'�
================================================================================�
� ArgumentError�
-------------�
invalid byte sequence in UTF-8�
� Cookbook Trace:�
---------------�
/var/chef/cache/cookbooks/java_properties/files/default/vendor/gems/java-properties-0.0.2/lib/java-properties/parsing/normalizer.rb:38:in gsub!' � /var/chef/cache/cookbooks/java_properties/files/default/vendor/gems/java-properties-0.0.2/lib/java-properties/parsing/normalizer.rb:38:in
apply!'
� /var/chef/cache/cookbooks/java_properties/files/default/vendor/gems/java-properties-0.0.2/lib/java-properties/parsing/normalizer.rb:67:in block in normalize!' � /var/chef/cache/cookbooks/java_properties/files/default/vendor/gems/java-properties-0.0.2/lib/java-properties/parsing/normalizer.rb:66:in
each'
� /var/chef/cache/cookbooks/java_properties/files/default/vendor/gems/java-properties-0.0.2/lib/java-properties/parsing/normalizer.rb:66:in normalize!' � /var/chef/cache/cookbooks/java_properties/files/default/vendor/gems/java-properties-0.0.2/lib/java-properties/parsing/parser.rb:29:in
parse'
� /var/chef/cache/cookbooks/java_properties/files/default/vendor/gems/java-properties-0.0.2/lib/java-properties.rb:16:in parse' � /var/chef/cache/cookbooks/java_properties/files/default/vendor/gems/java-properties-0.0.2/lib/java-properties.rb:33:in
load'
� /var/chef/cache/cookbooks/java_properties/libraries/java_properties_resource.rb:50:in properties_from_file' � /var/chef/cache/cookbooks/java_properties/libraries/java_properties_resource.rb:79:in
action_merge'�
� Resource Declaration:�
---------------------�
# In /var/chef/cache/cookbooks/clm/recipes/patch.rb
�
� 52: java_properties '/opt/IBM/JazzTeamServer/server/conf/dcc/teamserver.properties' do
� 53: properties_file '/opt/IBM/JazzTeamServer/server/conf/dcc/teamserver.properties'
� 54: property 'com.ibm.rational.datacollection.initialized', 'false'
� 55: only_if { node['clm']['version'].to_s >= '6.0.3' }
� 56: end
� 57:
�
� Compiled Resource:�
------------------�
# Declared in /var/chef/cache/cookbooks/clm/recipes/patch.rb:52:in `from_file'
�
� java_properties("/opt/IBM/JazzTeamServer/server/conf/dcc/teamserver.properties") do
� provider Chef::Provider::JavaProperties
� action :merge
� retries 0
� retry_delay 2
� default_guard_interpreter :default
� properties_file "/opt/IBM/JazzTeamServer/server/conf/dcc/teamserver.properties"
� properties_from_attributes {:"com.ibm.rational.datacollection.initialized"=>"false"}
� declared_type :java_properties
� cookbook_name "clm"
� recipe_name "patch"
� only_if { #code block }
� end
�
� Platform:�
---------�
x86_64-linux�
Whe trying to use the java_properties resource with the Chef notifies or subscribe mechanism I get always the following exception:
`================================================================================
Recipe Compile Error in /tmp/kitchen/cache/cookbooks/deployment-development-connect2id/recipes/default.rb
================================================================================
TypeError
---------
can't convert Chef::Resource::JavaProperties to Array (Chef::Resource::JavaProperties#to_ary gives String)
Cookbook Trace:
---------------
/tmp/kitchen/cache/cookbooks/deployment-development-connect2id/recipes/default.rb:71:in `block in from_file'
/tmp/kitchen/cache/cookbooks/deployment-development-connect2id/recipes/default.rb:66:in `from_file'
Relevant File Content:
----------------------
/tmp/kitchen/cache/cookbooks/deployment-development-connect2id/recipes/default.rb:
64: end
65:
66: java_properties 'oidcProvider' do
67: properties_file '/opt/connect2id-server-6.16/tomcat/webapps/c2id/WEB-INF/oidcProvider.properties'
68: property 'op.logout.sessionLifetime', '40'
69: property 'op.logout.endpoint', 'http://127.0.0.1:8080/c2id-login/c2id-logout-page-jsp/'
70: only_if { ::File.exist?('/opt/connect2id-server-6.16/tomcat/webapps/c2id/WEB-INF/oidcProvider.properties') }
71>> subscribes :start, 'systemd_unit[tomcat.service]'
72: notifies :restart, 'systemd_unit[tomcat.service]', :delayed
73: end
74:
System Info:
------------
chef_version=13.7.16
platform=debian
platform_version=9.2
ruby=ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
program_name=chef-solo worker: ppid=8421;start=09:37:56;
executable=/opt/chef/bin/chef-solo
`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.