The intention is for the the service running state after boot to be optionally handled by puppet. Omitting the ensure parameter does this, but why can't I add it when I need it like this?
service { "$my_module::params::myServiceName":
if $::my_service_ensure_running != 'undef' {
ensure => "$my_module::my_service_ensure_running",
}
enable => 'true',
require => [ Package["$oscar_legacy::params::mysqlPackageName"], File["/etc/mysql/conf.d/mysqld_oscar_dbs.cnf"] ],
}
puppet parser validate {}
complains as so:
Error: Could not parse for environment production: Syntax error at '::my_service_ensure_running'; expected '}' at /home/oscara/git/puppetmaster/modules/my_module/manifests/init.pp:154