0
これはif文がなくてもうまく動作しますが、ifを使う最良の方法は何ですか?シェフテンプレートファイル内のループ内にif文を入れる方法は?
<% node['some-node']['datasource'].each do |dbname,values| -%>
<%= if (dbname.to_s != 'ReferenceData') -%>
<Resource auth="${JDBC.<%= dbname %>.auth}" driverClassName="${JDBC.<%= dbname %>.driverClassName}" initialSize="${JDBC.<%= dbname %>.initialSize}" factory="${JDBC.<%= dbname %>.factory}" testWhileIdle="${JDBC.<%= dbname %>.testWhileIdle}" timeBetweenEvictionRunsMillis="${JDBC.<%= dbname %>.timeBetweenEvictionRunsMillis}" minEvictableIdleTimeMillis="${JDBC.<%= dbname %>.minEvictableIdleTimeMillis}" maxActive="${JDBC.<%= dbname %>.maxActive}" minIdle="${JDBC.<%= dbname %>.minIdle}" name="${JDBC.<%= dbname %>.name}" password="${JDBC.<%= dbname %>.password}" testOnBorrow="${JDBC.<%= dbname %>.testOnBorrow}" type="${JDBC.<%= dbname %>.type}" url="${JDBC.<%= dbname %>.url}" username="${JDBC.<%= dbname %>.userName}" validationInterval="${JDBC.<%= dbname %>.validationInterval}" validationQuery="${JDBC.<%= dbname %>.validationQuery}" connectionProperties="${JDBC.<%= dbname %>.connectionProperties}"/>
<% end %>
<% end %>