OLD | NEW |
(Empty) | |
| 1 # == Type: adblockplus::web::fileserver::repository |
| 2 # |
| 3 # Manage a repository on a fileserver. |
| 4 # |
| 5 # A repository is a site where a group of people can upload and artifacts. |
| 6 # |
| 7 # In its current form, a repository is simply a directory exposed on a web |
| 8 # server. This may evolve to make use of more advanced repositories in the |
| 9 # future (proxy to repository manager, or 3rd-party service, etc). |
| 10 # |
| 11 # === parameters: |
| 12 # |
| 13 # [*ensure*] |
| 14 # Whether to set up the repository or not. Removing repositories is not |
| 15 # supported. |
| 16 # |
| 17 # Members are handled manually on the target server for now. |
| 18 # Figure out how to provision them some day. |
| 19 # |
| 20 define adblockplus::web::fileserver::repository ( |
| 21 $ensure = 'present', |
| 22 ){ |
| 23 |
| 24 $repositories_directory = "$adblockplus::directory/fileserver" |
| 25 $repository_directory = "$repositories_directory/$name" |
| 26 $repository_host = "$name.$adblockplus::web::fileserver::domain" |
| 27 |
| 28 group {"www-$name": |
| 29 ensure => $ensure, |
| 30 } |
| 31 |
| 32 file {"$repository_directory": |
| 33 ensure => ensure_directory_state($ensure), |
| 34 group => "www-$name", |
| 35 mode => '0775', |
| 36 require => [ |
| 37 File["$repositories_directory"], |
| 38 Group["www-$name"], |
| 39 ], |
| 40 } |
| 41 |
| 42 realize(File[$adblockplus::directory]) |
| 43 |
| 44 file {"/var/www/$repository_host": |
| 45 ensure => ensure_symlink_state($ensure), |
| 46 target => "$repository_directory", |
| 47 require => File["$repository_directory"], |
| 48 } |
| 49 } |
| 50 |
OLD | NEW |