Running what you wrote should work. However, you can use the command
parameter:
exec { "do_some_update" : command => "composer self-update", path => "/usr/local/bin", }
So you can refer to exec
later if you want:
file { "configuration" : require => Exec["do_some_update"] }
instead of typing Exec["/usr/local/bin/composer self-update"]
source share