On Wed, Jun 24, 2009 at 1:24 PM, David Bishop<[email protected]> wrote:
>
> 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.

Note that if you have a file resource defined as well as the parent
directory, the require is automatic, so you don't have to explicitly
state it.


>
> 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",
>>         }
>>
>> )
>>
>> >>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkpCi40ACgkQTKX6T9GeRTZA4wCeMqTNUiTLGdqMDRD9qPF6fPFi
> NqwAn2towM7FwXvkDwbm/cQyirkTItbw
> =u/9R
> -----END PGP SIGNATURE-----
>
>



-- 
Nigel Kersten
[email protected]
System Administrator
Google, Inc.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to