To the best of my knowledge, square brackets appearing in ERB template text have no special meaning to ERB. They are just copied verbatim to the output.
I suspect that you have written something like
file { '/etc/my.cnf'':
source => template('my.cnf.erb')
}
where what you want is
file { '/etc/my.cnf'':
content => template('my.cnf.erb')
}
The distinction is quite important: the 'source' parameter is expected to specify a URL from which the agent get retrieve the desired file content, whereas the 'content' property gives the content itself. (The two are mutually exclusive.)