Presuming format_cmd is in libraries/default.rb (or whatever), this could be here, outside the resource:

```ruby
enmod_command = format_cmd("#{node['apache']['bin_dir']}/a2enmod #{params[:name]}")
```