I create configuration in Puppet for Nagios agent (NRPE). Now I'm trying to set different file source depending on existence of dirs.First I check if specific directory exists and then set specific file conntent. My current config files looks like:

```
class nagios_client::file_nagios-check-linux-stats {

        include nagios_client::check_location_lib-nagios

        file { '/usr/lib/nagios/plugins/check_linux_stats.pl':
        ensure  => file,
        owner   => root,
        group   => root,
        mode    => 755,
        content => template("nagios_client/check_linux_stats.pl.erb"),
        require => Exec["check_usr-lib_exists"],
        }
        file { '/usr/lib64/nagios/plugins/check_linux_stats.pl':
        ensure  => file,
        owner   => root,
        group   => root,
        mode    => 755,
        content => template("nagios_client/check_linux_stats.pl.erb"),
        require => Exec["check_usr-lib64_exists"],
        }
        file { '/usr/lib32/nagios/plugins/check_linux_stats.pl':
        ensure  => file,
        owner   => root,
        group   => root,
        mode    => 755,
        content => template("nagios_client/check_linux_stats.pl.erb"),
        require => Exec["check_usr-lib32_exists"],
        }
    }

```

This works fine, but I have a problem with this:

```
class nagios_client::file_nrpe-cfg {

    #    include nagios_client::check_location_lib-nagios

        file { '/etc/nagios/nrpe.cfg.def':
            path    => '/etc/nagios/nrpe.cfg',
            ensure  => file,
            owner   => root,
            group   => root,
            mode    => 644,
            content => template("nagios_client/nrpe-cfg.erb"),
            require => Exec["check_usr-lib_exists"],
        }

        file { '/etc/nagios/nrpe.cfg.32':
            path    => '/etc/nagios/nrpe.cfg',
            ensure  => file,
            owner   => root,
            group   => root,
            mode    => 644,
            content => template("nagios_client/nrpe-cfg-32.erb"),
            require => Exec["check_usr-lib32_exists"],
        }

        file { '/etc/nagios/nrpe.cfg.64':
            path    => '/etc/nagios/nrpe.cfg',
            ensure  => file,
            owner   => root,
            group   => root,
            mode    => 644,
            content => template("nagios_client/nrpe-cfg-64.erb"),
            require => Exec["check_usr-lib64_exists"],
        }
    }

```

It looks like `require => Exec[...]` is ignored.

My check definition:

```
class nagios_client::check_location_lib-nagios {

    exec { 'check_usr-lib_exists':
    command => '/bin/true',
        onlyif  => '/usr/bin/test -d /usr/lib/nagios/plugins',
    }
    exec { 'check_usr-lib32_exists':
        command => '/bin/true',
        onlyif  => '/usr/bin/test -d /usr/lib32/nagios/plugins',
        }
    exec { 'check_usr-lib64_exists':
        command => '/bin/true',
        onlyif  => '/usr/bin/test -d /usr/lib64/nagios/plugins',
    }
}

```

I'm using Puppet 3.8.7. How to do it in right way?