You can simplify these blocks with [pick](https://github.com/puppetlabs/puppetlabs-stdlib#pick):

```puppet
if $::puppet::server_git_repo or $::puppet::server_dynamic_environments {
  $manifest = pick($::puppet:server_manifest, "${::puppet::server_envs_dir}/\$environment/manifests/site.pp")
  $modulepath = pick($::puppet::server_modulepath, "${::puppet::server_envs_dir}/\$environment/modules")
} else {
  $manifest = $::puppet::server_manifest
  $modulepath = $::puppet::server_modulepath
}
```