Re-do that as:

class theclass {
        file { "/opt/scripts":
                        ensure => "directory",
                        owner  => "root",
                        group  => "root",
                        mode   => 755,
        }
 
  file { "/opt/scripts/my_script.sh":
            owner => "root",
            group => "thegroup",
            mode => 770,
            source => "puppet:///files/my_script.sh",
            require => File['/opt/scripts'],
         }
}

That way, it won't copy down my_script.sh without first creating
/opt/scripts.

David


On Wed, Jun 24, 2009 at 10:00:47AM -0700, jason wrote:
> 
> 
> I want to create a directory and THEN get files into that directory on
> a client.
> Puppet it seems does not follow the order of commands, like below in
> my example.
> Sometimes it creates the directory, then downloads the file, and
> sometimes it tries to download the file before creating the directory,
> so the file won't be downloaded.
> 
> How can I download a file and make certain the destination directory
> will be there before this file is downloaded?  thanks again!  -jason
> 
> class theclass (
> 
>  exec{'mkdir -p /opt/scripts':
>                 unless => 'test -d /opt/scripts',
>         }
> 
>  file { "/opt/scripts/my_script.sh":
>                 owner => "root",
>                 group => "thegroup",
>                 mode => 770,
>                 source => "puppet:///files/my_script.sh",
>         }
> 
> )
> 
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en
> -~----------~----~----~----~------~----~------~--~---
> 

Attachment: signature.asc
Description: Digital signature

Reply via email to