vagrant-managed-servers 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. data/.gitignore +17 -0
  2. data/Berksfile +4 -0
  3. data/CHANGELOG.md +4 -0
  4. data/Gemfile +14 -0
  5. data/LICENSE +8 -0
  6. data/README.md +142 -0
  7. data/Rakefile +21 -0
  8. data/Vagrantfile +44 -0
  9. data/cookbooks/apache2/CHANGELOG.md +95 -0
  10. data/cookbooks/apache2/CONTRIBUTING.md +257 -0
  11. data/cookbooks/apache2/Gemfile +10 -0
  12. data/cookbooks/apache2/LICENSE +201 -0
  13. data/cookbooks/apache2/README.md +567 -0
  14. data/cookbooks/apache2/attributes/default.rb +149 -0
  15. data/cookbooks/apache2/attributes/mod_auth_cas.rb +2 -0
  16. data/cookbooks/apache2/attributes/mod_auth_openid.rb +32 -0
  17. data/cookbooks/apache2/definitions/apache_conf.rb +26 -0
  18. data/cookbooks/apache2/definitions/apache_module.rb +53 -0
  19. data/cookbooks/apache2/definitions/apache_site.rb +43 -0
  20. data/cookbooks/apache2/definitions/web_app.rb +49 -0
  21. data/cookbooks/apache2/files/default/apache2_module_conf_generate.pl +41 -0
  22. data/cookbooks/apache2/files/default/tests/minitest/default_test.rb +77 -0
  23. data/cookbooks/apache2/files/default/tests/minitest/god_monitor_test.rb +34 -0
  24. data/cookbooks/apache2/files/default/tests/minitest/mod_apreq2_test.rb +19 -0
  25. data/cookbooks/apache2/files/default/tests/minitest/mod_auth_cas_test.rb +11 -0
  26. data/cookbooks/apache2/files/default/tests/minitest/mod_auth_openid_test.rb +37 -0
  27. data/cookbooks/apache2/files/default/tests/minitest/mod_cgi_test.rb +13 -0
  28. data/cookbooks/apache2/files/default/tests/minitest/mod_dav_svn_test.rb +14 -0
  29. data/cookbooks/apache2/files/default/tests/minitest/mod_fastcgi.rb +11 -0
  30. data/cookbooks/apache2/files/default/tests/minitest/mod_perl_test.rb +18 -0
  31. data/cookbooks/apache2/files/default/tests/minitest/mod_php5_test.rb +13 -0
  32. data/cookbooks/apache2/files/default/tests/minitest/mod_python_test.rb +10 -0
  33. data/cookbooks/apache2/files/default/tests/minitest/mod_ssl_test.rb +23 -0
  34. data/cookbooks/apache2/files/default/tests/minitest/support/helpers.rb +50 -0
  35. data/cookbooks/apache2/metadata.json +513 -0
  36. data/cookbooks/apache2/metadata.rb +207 -0
  37. data/cookbooks/apache2/recipes/default.rb +208 -0
  38. data/cookbooks/apache2/recipes/god_monitor.rb +33 -0
  39. data/cookbooks/apache2/recipes/logrotate.rb +29 -0
  40. data/cookbooks/apache2/recipes/mod_alias.rb +22 -0
  41. data/cookbooks/apache2/recipes/mod_apreq2.rb +54 -0
  42. data/cookbooks/apache2/recipes/mod_auth_basic.rb +20 -0
  43. data/cookbooks/apache2/recipes/mod_auth_cas.rb +59 -0
  44. data/cookbooks/apache2/recipes/mod_auth_digest.rb +20 -0
  45. data/cookbooks/apache2/recipes/mod_auth_openid.rb +111 -0
  46. data/cookbooks/apache2/recipes/mod_authn_file.rb +20 -0
  47. data/cookbooks/apache2/recipes/mod_authnz_ldap.rb +20 -0
  48. data/cookbooks/apache2/recipes/mod_authz_default.rb +20 -0
  49. data/cookbooks/apache2/recipes/mod_authz_groupfile.rb +20 -0
  50. data/cookbooks/apache2/recipes/mod_authz_host.rb +20 -0
  51. data/cookbooks/apache2/recipes/mod_authz_user.rb +20 -0
  52. data/cookbooks/apache2/recipes/mod_autoindex.rb +22 -0
  53. data/cookbooks/apache2/recipes/mod_cgi.rb +20 -0
  54. data/cookbooks/apache2/recipes/mod_dav.rb +20 -0
  55. data/cookbooks/apache2/recipes/mod_dav_fs.rb +21 -0
  56. data/cookbooks/apache2/recipes/mod_dav_svn.rb +41 -0
  57. data/cookbooks/apache2/recipes/mod_deflate.rb +22 -0
  58. data/cookbooks/apache2/recipes/mod_dir.rb +22 -0
  59. data/cookbooks/apache2/recipes/mod_env.rb +20 -0
  60. data/cookbooks/apache2/recipes/mod_expires.rb +20 -0
  61. data/cookbooks/apache2/recipes/mod_fastcgi.rb +26 -0
  62. data/cookbooks/apache2/recipes/mod_fcgid.rb +55 -0
  63. data/cookbooks/apache2/recipes/mod_headers.rb +20 -0
  64. data/cookbooks/apache2/recipes/mod_include.rb +20 -0
  65. data/cookbooks/apache2/recipes/mod_ldap.rb +20 -0
  66. data/cookbooks/apache2/recipes/mod_log_config.rb +24 -0
  67. data/cookbooks/apache2/recipes/mod_logio.rb +24 -0
  68. data/cookbooks/apache2/recipes/mod_mime.rb +22 -0
  69. data/cookbooks/apache2/recipes/mod_negotiation.rb +22 -0
  70. data/cookbooks/apache2/recipes/mod_perl.rb +44 -0
  71. data/cookbooks/apache2/recipes/mod_php5.rb +77 -0
  72. data/cookbooks/apache2/recipes/mod_proxy.rb +22 -0
  73. data/cookbooks/apache2/recipes/mod_proxy_ajp.rb +21 -0
  74. data/cookbooks/apache2/recipes/mod_proxy_balancer.rb +20 -0
  75. data/cookbooks/apache2/recipes/mod_proxy_connect.rb +20 -0
  76. data/cookbooks/apache2/recipes/mod_proxy_http.rb +20 -0
  77. data/cookbooks/apache2/recipes/mod_python.rb +38 -0
  78. data/cookbooks/apache2/recipes/mod_rewrite.rb +20 -0
  79. data/cookbooks/apache2/recipes/mod_setenvif.rb +22 -0
  80. data/cookbooks/apache2/recipes/mod_ssl.rb +46 -0
  81. data/cookbooks/apache2/recipes/mod_status.rb +22 -0
  82. data/cookbooks/apache2/recipes/mod_wsgi.rb +38 -0
  83. data/cookbooks/apache2/recipes/mod_xsendfile.rb +38 -0
  84. data/cookbooks/apache2/templates/default/a2dismod.erb +22 -0
  85. data/cookbooks/apache2/templates/default/a2dissite.erb +29 -0
  86. data/cookbooks/apache2/templates/default/a2enmod.erb +37 -0
  87. data/cookbooks/apache2/templates/default/a2ensite.erb +38 -0
  88. data/cookbooks/apache2/templates/default/apache2.conf.erb +237 -0
  89. data/cookbooks/apache2/templates/default/apache2.god.erb +19 -0
  90. data/cookbooks/apache2/templates/default/charset.erb +6 -0
  91. data/cookbooks/apache2/templates/default/default-site.erb +57 -0
  92. data/cookbooks/apache2/templates/default/mods/README +2 -0
  93. data/cookbooks/apache2/templates/default/mods/alias.conf.erb +24 -0
  94. data/cookbooks/apache2/templates/default/mods/auth_cas.conf.erb +1 -0
  95. data/cookbooks/apache2/templates/default/mods/auth_cas.load.erb +1 -0
  96. data/cookbooks/apache2/templates/default/mods/authopenid.load.erb +1 -0
  97. data/cookbooks/apache2/templates/default/mods/autoindex.conf.erb +101 -0
  98. data/cookbooks/apache2/templates/default/mods/deflate.conf.erb +16 -0
  99. data/cookbooks/apache2/templates/default/mods/dir.conf.erb +5 -0
  100. data/cookbooks/apache2/templates/default/mods/fastcgi.conf.erb +5 -0
  101. data/cookbooks/apache2/templates/default/mods/fcgid.conf.erb +10 -0
  102. data/cookbooks/apache2/templates/default/mods/mime.conf.erb +198 -0
  103. data/cookbooks/apache2/templates/default/mods/negotiation.conf.erb +18 -0
  104. data/cookbooks/apache2/templates/default/mods/php5.conf.erb +16 -0
  105. data/cookbooks/apache2/templates/default/mods/proxy.conf.erb +19 -0
  106. data/cookbooks/apache2/templates/default/mods/setenvif.conf.erb +28 -0
  107. data/cookbooks/apache2/templates/default/mods/ssl.conf.erb +76 -0
  108. data/cookbooks/apache2/templates/default/mods/status.conf.erb +26 -0
  109. data/cookbooks/apache2/templates/default/port_apache.erb +2 -0
  110. data/cookbooks/apache2/templates/default/ports.conf.erb +6 -0
  111. data/cookbooks/apache2/templates/default/security.erb +50 -0
  112. data/cookbooks/apache2/templates/default/web_app.conf.erb +43 -0
  113. data/cookbooks/apt/Berksfile +8 -0
  114. data/cookbooks/apt/CHANGELOG.md +97 -0
  115. data/cookbooks/apt/CONTRIBUTING +29 -0
  116. data/cookbooks/apt/LICENSE +201 -0
  117. data/cookbooks/apt/README.md +243 -0
  118. data/cookbooks/apt/TESTING.md +25 -0
  119. data/cookbooks/apt/attributes/default.rb +4 -0
  120. data/cookbooks/apt/files/default/apt-proxy-v2.conf +50 -0
  121. data/cookbooks/apt/metadata.json +1 -0
  122. data/cookbooks/apt/metadata.rb +30 -0
  123. data/cookbooks/apt/providers/preference.rb +61 -0
  124. data/cookbooks/apt/providers/repository.rb +132 -0
  125. data/cookbooks/apt/recipes/cacher-client.rb +59 -0
  126. data/cookbooks/apt/recipes/cacher-ng.rb +40 -0
  127. data/cookbooks/apt/recipes/default.rb +68 -0
  128. data/cookbooks/apt/resources/preference.rb +30 -0
  129. data/cookbooks/apt/resources/repository.rb +40 -0
  130. data/cookbooks/apt/templates/debian-6.0/acng.conf.erb +174 -0
  131. data/cookbooks/apt/templates/default/01proxy.erb +2 -0
  132. data/cookbooks/apt/templates/default/acng.conf.erb +276 -0
  133. data/cookbooks/apt/templates/ubuntu-10.04/acng.conf.erb +270 -0
  134. data/dummy.box +0 -0
  135. data/lib/vagrant-managed-servers.rb +18 -0
  136. data/lib/vagrant-managed-servers/action.rb +114 -0
  137. data/lib/vagrant-managed-servers/action/is_created.rb +18 -0
  138. data/lib/vagrant-managed-servers/action/is_reachable.rb +18 -0
  139. data/lib/vagrant-managed-servers/action/link_server.rb +31 -0
  140. data/lib/vagrant-managed-servers/action/message_not_reachable.rb +16 -0
  141. data/lib/vagrant-managed-servers/action/read_state.rb +84 -0
  142. data/lib/vagrant-managed-servers/action/sync_folders.rb +85 -0
  143. data/lib/vagrant-managed-servers/action/unlink_server.rb +30 -0
  144. data/lib/vagrant-managed-servers/action/warn_networks.rb +19 -0
  145. data/lib/vagrant-managed-servers/config.rb +28 -0
  146. data/lib/vagrant-managed-servers/errors.rb +19 -0
  147. data/lib/vagrant-managed-servers/plugin.rb +72 -0
  148. data/lib/vagrant-managed-servers/provider.rb +51 -0
  149. data/lib/vagrant-managed-servers/util/timer.rb +17 -0
  150. data/lib/vagrant-managed-servers/version.rb +5 -0
  151. data/locales/en.yml +45 -0
  152. data/spec/vagrant-managed-servers/config_spec.rb +28 -0
  153. data/vagrant-managed-servers.gemspec +56 -0
  154. metadata +264 -0
@@ -0,0 +1,270 @@
1
+
2
+ # Letter case in directive names does not matter. Must be separated with colons.
3
+ # Valid boolean values are a zero number for false, non-zero numbers for true.
4
+
5
+ CacheDir: /var/cache/apt-cacher-ng
6
+
7
+ # set empty to disable logging
8
+ LogDir: /var/log/apt-cacher-ng
9
+
10
+ # place to look for additional configuration and resource files if they are not
11
+ # found in the configuration directory
12
+ # SupportDir: /usr/lib/apt-cacher-ng
13
+
14
+ # TCP (http) port
15
+ # Set to 9999 to emulate apt-proxy
16
+ Port:<%= node['apt']['cacher_port'] %>
17
+
18
+ # Addresses or hostnames to listen on. Multiple addresses must be separated by
19
+ # spaces. Each entry must be an exact local address which is associated with a
20
+ # local interface. DNS resolution is performed using getaddrinfo(3) for all
21
+ # available protocols (IPv4, IPv6, ...). Using a protocol specific format will
22
+ # create binding(s) only on protocol specific socket(s) (e.g. 0.0.0.0 will listen
23
+ # only to IPv4).
24
+ #
25
+ # Default: not set, will listen on all interfaces and protocols
26
+ #
27
+ # BindAddress: localhost 192.168.7.254 publicNameOnMainInterface
28
+
29
+ # The specification of another proxy which shall be used for downloads.
30
+ # Username and password are, and see manual for limitations.
31
+ #
32
+ #Proxy: http://www-proxy.example.net:80
33
+ #proxy: username:proxypassword@proxy.example.net:3128
34
+
35
+ # Repository remapping. See manual for details.
36
+ # In this example, some backends files might be generated during package
37
+ # installation using information collected on the system.
38
+ Remap-debrep: file:deb_mirror*.gz /debian ; file:backends_debian # Debian Archives
39
+ Remap-uburep: file:ubuntu_mirrors /ubuntu ; file:backends_ubuntu # Ubuntu Archives
40
+ Remap-debvol: file:debvol_mirror*.gz /debian-volatile ; file:backends_debvol # Debian Volatile Archives
41
+
42
+ # This is usually not needed for security.debian.org because it's always the
43
+ # same DNS hostname. However, it might be enabled in order to use hooks,
44
+ # ForceManaged mode or special flags in this context.
45
+ # Remap-secdeb: security.debian.org
46
+
47
+ # Virtual page accessible in a web browser to see statistics and status
48
+ # information, i.e. under http://localhost:3142/acng-report.html
49
+ ReportPage: acng-report.html
50
+
51
+ # Socket file for accessing through local UNIX socket instead of TCP/IP. Can be
52
+ # used with inetd bridge or cron client.
53
+ # SocketPath:/var/run/apt-cacher-ng/socket
54
+
55
+ # Forces log file to be written to disk after every line when set to 1. Default
56
+ # is 0, buffers are flushed when the client disconnects.
57
+ #
58
+ # (technically, alias to the Debug option, see its documentation for details)
59
+ #
60
+ # UnbufferLogs: 0
61
+
62
+ # Set to 0 to store only type, time and transfer sizes.
63
+ # 1 -> client IP and relative local path are logged too
64
+ # VerboseLog: 1
65
+
66
+ # Don't detach from the console
67
+ # ForeGround: 0
68
+
69
+ # Store the pid of the daemon process therein
70
+ # PidFile: /var/run/apt-cacher-ng/pid
71
+
72
+ # Forbid outgoing connections, work around them or respond with 503 error
73
+ # offlinemode:0
74
+
75
+ # Forbid all downloads that don't run through preconfigured backends (.where)
76
+ #ForceManaged: 0
77
+
78
+ # Days before considering an unreferenced file expired (to be deleted).
79
+ # Warning: if the value is set too low and particular index files are not
80
+ # available for some days (mirror downtime) there is a risk of deletion of
81
+ # still useful package files.
82
+ ExTreshold: 4
83
+
84
+ # Stop expiration when a critical problem appeared. Currently only failed
85
+ # refresh of an index file is considered as critical.
86
+ #
87
+ # WARNING: don't touch this option or set to zero.
88
+ # Anything else is DANGEROUS and may cause data loss.
89
+ #
90
+ # ExAbortOnProblems: 1
91
+
92
+ # Replace some Windows/DOS-FS incompatible chars when storing
93
+ # StupidFs: 0
94
+
95
+ # Experimental feature for apt-listbugs: pass-through SOAP requests and
96
+ # responses to/from bugs.debian.org. If not set, default is true if
97
+ # ForceManaged is enabled and false otherwise.
98
+ # ForwardBtsSoap: 1
99
+
100
+ # The daemon has a small cache for DNS data, to speed up resolution. The
101
+ # expiration time of the DNS entries can be configured in seconds.
102
+ # DnsCacheSeconds: 3600
103
+
104
+ # Don't touch the following values without good consideration!
105
+ #
106
+ # Max. count of connection threads kept ready (for faster response in the
107
+ # future). Should be a sane value between 0 and average number of connections,
108
+ # and depend on the amount of spare RAM.
109
+ # MaxStandbyConThreads: 8
110
+ #
111
+ # Hard limit of active thread count for incoming connections, i.e. operation
112
+ # is refused when this value is reached (below zero = unlimited).
113
+ # MaxConThreads: -1
114
+ #
115
+ # Pigeonholing files with regular expressions (static/volatile). Can be
116
+ # overriden here but not should not be done permanently because future update
117
+ # of default settings would not be applied later.
118
+ # VfilePattern = (^|.*?/)(Index|Packages(\.gz|\.bz2|\.lzma|\.xz)?|InRelease|Release|Release\.gpg|Sources(\.gz|\.bz2|\.lzma|\.xz)?|release|index\.db-.*\.gz|Contents-[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|pkglist[^/]*\.bz2|rclist[^/]*\.bz2|/meta-release[^/]*|Translation[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|MD5SUMS|SHA1SUMS|((setup|setup-legacy)(\.ini|\.bz2|\.hint)(\.sig)?)|mirrors\.lst|repo(index|md)\.xml(\.asc|\.key)?|directory\.yast|products|content(\.asc|\.key)?|media|filelists\.xml\.gz|filelists\.sqlite\.bz2|repomd\.xml|packages\.[a-zA-Z][a-zA-Z]\.gz|info\.txt|license\.tar\.gz|license\.zip|.*\.db(\.tar\.gz)?|.*\.files\.tar\.gz|.*\.abs\.tar\.gz|metalink\?repo|.*prestodelta\.xml\.gz)$|/dists/.*/installer-[^/]+/[^0-9][^/]+/images/.*
119
+ # PfilePattern = .*(\.d?deb|\.rpm|\.dsc|\.tar(\.gz|\.bz2|\.lzma|\.xz)(\.gpg)?|\.diff(\.gz|\.bz2|\.lzma|\.xz)|\.jigdo|\.template|changelog|copyright|\.udeb|\.debdelta|\.diff/.*\.gz|(Devel)?ReleaseAnnouncement(\?.*)?|[a-f0-9]+-(susedata|updateinfo|primary|deltainfo).xml.gz|fonts/(final/)?[a-z]+32.exe(\?download.*)?|/dists/.*/installer-[^/]+/[0-9][^/]+/images/.*)$
120
+ # Whitelist for expiration, file types not to be removed even when being
121
+ # unreferenced. Default: many parts from VfilePattern where no parent index
122
+ # exists or might be unknown.
123
+ # WfilePattern = (^|.*?/)(Release|InRelease|Release\.gpg|(Packages|Sources)(\.gz|\.bz2|\.lzma|\.xz)?|Translation[^/]*(\.gz|\.bz2|\.lzma|\.xz)?|MD5SUMS|SHA1SUMS|.*\.xml|.*\.db\.tar\.gz|.*\.files\.tar\.gz|.*\.abs\.tar\.gz|[a-z]+32.exe)$|/dists/.*/installer-.*/images/.*
124
+
125
+ # Higher modes only working with the debug version
126
+ # Warning, writes a lot into apt-cacher.err logfile
127
+ # Value overwrites UnbufferLogs setting (aliased)
128
+ # Debug:3
129
+
130
+ # Usually, general purpose proxies like Squid expose the IP address of the
131
+ # client user to the remote server using the X-Forwarded-For HTTP header. This
132
+ # behaviour can be optionally turned on with the Expose-Origin option.
133
+ # ExposeOrigin: 0
134
+
135
+ # When logging the originating IP address, trust the information supplied by
136
+ # the client in the X-Forwarded-For header.
137
+ # LogSubmittedOrigin: 0
138
+
139
+ # The version string reported to the peer, to be displayed as HTTP client (and
140
+ # version) in the logs of the mirror.
141
+ # WARNING: some archives use this header to detect/guess capabilities of the
142
+ # client (i.e. redirection support) and change the behaviour accordingly, while
143
+ # ACNG might not support the expected features. Expect side effects.
144
+ #
145
+ # UserAgent: Yet Another HTTP Client/1.2.3p4
146
+
147
+ # In some cases the Import and Expiration tasks might create fresh volatile
148
+ # data for internal use by reconstructing them using patch files. This
149
+ # by-product might be recompressed with bzip2 and with some luck the resulting
150
+ # file becomes identical to the *.bz2 file on the server, usable for APT
151
+ # clients trying to fetch the full .bz2 compressed version. Injection of the
152
+ # generated files into the cache has however a disadvantage on underpowered
153
+ # servers: bzip2 compression can create high load on the server system and the
154
+ # visible download of the busy .bz2 files also becomes slower.
155
+ #
156
+ # RecompBz2: 0
157
+
158
+ # Network timeout for outgoing connections.
159
+ # NetworkTimeout: 60
160
+
161
+ # Sometimes it makes sense to not store the data in cache and just return the
162
+ # package data to client as it comes in. DontCache parameters can enable this
163
+ # behaviour for certain URL types. The tokens are extended regular expressions
164
+ # that URLs are matched against.
165
+ #
166
+ # DontCacheRequested is applied to the URL as it comes in from the client.
167
+ # Example: exclude packages built with kernel-package for x86
168
+ # DontCacheRequested: linux-.*_10\...\.Custo._i386
169
+ # Example usecase: exclude popular private IP ranges from caching
170
+ # DontCacheRequested: 192.168.0 ^10\..* 172.30
171
+ #
172
+ # DontCacheResolved is applied to URLs after mapping to the target server. If
173
+ # multiple backend servers are specified then it's only matched against the
174
+ # download link for the FIRST possible source (due to implementation limits).
175
+ # Example usecase: all Ubuntu stuff comes from a local mirror (specified as
176
+ # backend), don't cache it again:
177
+ # DontCacheResolved: ubuntumirror.local.net
178
+ #
179
+ # DontCache directive sets (overrides) both, DontCacheResolved and
180
+ # DontCacheRequested. Provided for convenience, see those directives for
181
+ # details.
182
+ #
183
+ # Default permission set of freshly created files and directories, as octal
184
+ # numbers (see chmod(1) for details).
185
+ # Can by limited by the umask value (see umask(2) for details) if it's set in
186
+ # the environment of the starting shell, e.g. in apt-cacher-ng init script or
187
+ # in its configuration file.
188
+ # DirPerms: 00755
189
+ # FilePerms: 00664
190
+ #
191
+ #
192
+ # It's possible to use use apt-cacher-ng as a regular web server with limited
193
+ # feature set, i.e.
194
+ # including directory browsing and download of any file;
195
+ # excluding sorting, mime types/encodings, CGI execution, index page
196
+ # redirection and other funny things.
197
+ # To get this behavior, mappings between virtual directories and real
198
+ # directories on the server must be defined with the LocalDirs directive.
199
+ # Virtual and real dirs are separated by spaces, multiple pairs are separated
200
+ # by semi-colons. Real directories must be absolute paths.
201
+ # NOTE: Since the names of that key directories share the same namespace as
202
+ # repository names (see Remap-...) it's administrators job to avoid such
203
+ # collisions on them (unless created deliberately).
204
+ #
205
+ # LocalDirs: woo /data/debarchive/woody ; hamm /data/debarchive/hamm
206
+
207
+ # Precache a set of files referenced by specified index files. This can be used
208
+ # to create a partial mirror usable for offline work. There are certain limits
209
+ # and restrictions on the path specification, see manual for details. A list of
210
+ # (maybe) relevant index files could be retrieved via
211
+ # "apt-get --print-uris update" on a client machine.
212
+ #
213
+ # PrecacheFor: debrep/dists/unstable/*/source/Sources* debrep/dists/unstable/*/binary-amd64/Packages*
214
+
215
+ # Arbitrary set of data to append to request headers sent over the wire. Should
216
+ # be a well formated HTTP headers part including newlines (DOS style) which
217
+ # can be entered as escape sequences (\r\n).
218
+ # RequestAppendix: X-Tracking-Choice: do-not-track\r\n
219
+
220
+ # Specifies the IP protocol families to use for remote connections. Order does
221
+ # matter, first specified are considered first. Possible combinations:
222
+ # v6 v4
223
+ # v4 v6
224
+ # v6
225
+ # v4
226
+ # (empty or not set: use system default)
227
+ #
228
+ # ConnectProto: v6 v4
229
+
230
+ # Regular expiration algorithm finds package files which are no longer listed
231
+ # in any index file and removes them of them after a safety period.
232
+ # This option allows to keep more versions of a package in the cache after
233
+ # safety period is over.
234
+ # KeepExtraVersions: 1
235
+
236
+ # Optionally uses TCP access control provided by libwrap, see hosts_access(5)
237
+ # for details. Daemon name is apt-cacher-ng. Default if not set: decided on
238
+ # startup by looking for explicit mentioning of apt-cacher-ng in
239
+ # /etc/hosts.allow or /etc/hosts.deny files.
240
+ # UseWrap: 0
241
+
242
+ # If many machines from the same local network attempt to update index files
243
+ # (apt-get update) at nearly the same time, the known state of these index file
244
+ # is temporarily frozen and multiple requests receive the cached response
245
+ # without contacting the server. This parameter (in seconds) specifies the
246
+ # length of this period before the files are considered outdated.
247
+ # Setting it too low transfers more data and increases remote server load,
248
+ # setting it too high (more than a couple of minutes) increases the risk of
249
+ # delivering inconsistent responses to the clients.
250
+ # FreshIndexMaxAge: 27
251
+
252
+ # Usually the users are not allowed to specify custom TCP ports of remote
253
+ # mirrors in the requests, only the default HTTP port can be used (instead,
254
+ # proxy administrator can create Remap- rules with custom ports). This
255
+ # restriction can be disabled by specifying a list of allowed ports or 0 for
256
+ # any port.
257
+ #
258
+ # AllowUserPorts: 80
259
+
260
+ # Normally the HTTP redirection responses are forwarded to the original caller
261
+ # (i.e. APT) which starts a new download attempt from the new URL. This
262
+ # solution is ok for client configurations with proxy mode but doesn't work
263
+ # well with configurations using URL prefixes. To work around this the server
264
+ # can restart its own download with another URL. However, this might be used to
265
+ # circumvent download source policies by malicious users.
266
+ # The RedirMax option specifies how many such redirects the server should
267
+ # follow per request, 0 disables the internal redirection. If not set,
268
+ # default value is 0 if ForceManaged is used and 5 otherwise.
269
+ #
270
+ # RedirMax: 5
data/dummy.box ADDED
Binary file
@@ -0,0 +1,18 @@
1
+ require "pathname"
2
+
3
+ require "vagrant-managed-servers/plugin"
4
+
5
+ module VagrantPlugins
6
+ module ManagedServers
7
+ lib_path = Pathname.new(File.expand_path("../vagrant-managed-servers", __FILE__))
8
+ autoload :Action, lib_path.join("action")
9
+ autoload :Errors, lib_path.join("errors")
10
+
11
+ # This returns the path to the source of this plugin.
12
+ #
13
+ # @return [Pathname]
14
+ def self.source_root
15
+ @source_root ||= Pathname.new(File.expand_path("../../", __FILE__))
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,114 @@
1
+ require "pathname"
2
+
3
+ require "vagrant/action/builder"
4
+
5
+ module VagrantPlugins
6
+ module ManagedServers
7
+ module Action
8
+ # Include the built-in modules so we can use them as top-level things.
9
+ include Vagrant::Action::Builtin
10
+
11
+ # This action is called to establish linkage between vagrant and the managed server
12
+ def self.action_up
13
+ Vagrant::Action::Builder.new.tap do |b|
14
+ b.use HandleBoxUrl
15
+ b.use ConfigValidate
16
+ b.use WarnNetworks
17
+ b.use LinkServer
18
+ =begin
19
+ b.use HandleBoxUrl
20
+ b.use ConfigValidate
21
+ b.use Call, IsReachable do |env, b2|
22
+ if env[:result]
23
+ b2.use !MessageNotReachable
24
+ next
25
+ end
26
+
27
+ b2.use Provision
28
+ b2.use SyncFolders
29
+ b2.use WarnNetworks
30
+ b2.use LinkServer
31
+ end
32
+ =end
33
+ end
34
+ end
35
+
36
+ # This action is called to "unlink" vagrant from the managed server
37
+ def self.action_destroy
38
+ Vagrant::Action::Builder.new.tap do |b|
39
+ b.use ConfigValidate
40
+ b.use UnlinkServer
41
+ end
42
+ end
43
+
44
+ # This action is called when `vagrant provision` is called.
45
+ def self.action_provision
46
+ Vagrant::Action::Builder.new.tap do |b|
47
+ b.use ConfigValidate
48
+ b.use WarnNetworks
49
+ b.use Call, IsReachable do |env, b2|
50
+ if !env[:result]
51
+ b2.use MessageNotReachable
52
+ next
53
+ end
54
+
55
+ b2.use Provision
56
+ b2.use SyncFolders
57
+ end
58
+ end
59
+ end
60
+
61
+ # This action is called to read the state of the machine. The
62
+ # resulting state is expected to be put into the `:machine_state_id`
63
+ # key.
64
+ def self.action_read_state
65
+ Vagrant::Action::Builder.new.tap do |b|
66
+ b.use ConfigValidate
67
+ b.use ReadState
68
+ end
69
+ end
70
+
71
+ # This action is called to SSH into the machine.
72
+ def self.action_ssh
73
+ Vagrant::Action::Builder.new.tap do |b|
74
+ b.use ConfigValidate
75
+ b.use WarnNetworks
76
+ b.use Call, IsReachable do |env, b2|
77
+ if !env[:result]
78
+ b2.use MessageNotReachable
79
+ next
80
+ end
81
+
82
+ b2.use SSHExec
83
+ end
84
+ end
85
+ end
86
+
87
+ def self.action_ssh_run
88
+ Vagrant::Action::Builder.new.tap do |b|
89
+ b.use ConfigValidate
90
+ b.use WarnNetworks
91
+ b.use Call, IsReachable do |env, b2|
92
+ if !env[:result]
93
+ b2.use MessageNotReachable
94
+ next
95
+ end
96
+
97
+ b2.use SSHRun
98
+ end
99
+ end
100
+ end
101
+
102
+
103
+ # The autoload farm
104
+ action_root = Pathname.new(File.expand_path("../action", __FILE__))
105
+ autoload :IsReachable, action_root.join("is_reachable")
106
+ autoload :MessageNotReachable, action_root.join("message_not_reachable")
107
+ autoload :ReadState, action_root.join("read_state")
108
+ autoload :SyncFolders, action_root.join("sync_folders")
109
+ autoload :WarnNetworks, action_root.join("warn_networks")
110
+ autoload :LinkServer, action_root.join("link_server")
111
+ autoload :UnlinkServer, action_root.join("unlink_server")
112
+ end
113
+ end
114
+ end
@@ -0,0 +1,18 @@
1
+ module VagrantPlugins
2
+ module ManagedServers
3
+ module Action
4
+ # This can be used with "Call" built-in to check if the machine
5
+ # is created and branch in the middleware.
6
+ class IsCreated
7
+ def initialize(app, env)
8
+ @app = app
9
+ end
10
+
11
+ def call(env)
12
+ env[:result] = env[:machine].state.id != :not_created
13
+ @app.call(env)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ module VagrantPlugins
2
+ module ManagedServers
3
+ module Action
4
+ # This can be used with "Call" built-in to check if the machine
5
+ # is created and branch in the middleware.
6
+ class IsReachable
7
+ def initialize(app, env)
8
+ @app = app
9
+ end
10
+
11
+ def call(env)
12
+ env[:result] = env[:machine].communicate.ready?
13
+ @app.call(env)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,31 @@
1
+ require "log4r"
2
+
3
+ module VagrantPlugins
4
+ module ManagedServers
5
+ module Action
6
+ # "Link" vagrant and the managed server
7
+ class LinkServer
8
+
9
+ def initialize(app, env)
10
+ @app = app
11
+ @logger = Log4r::Logger.new("vagrant_managed_servers::action::link_server")
12
+ end
13
+
14
+ def call(env)
15
+
16
+ # Get the server hostname we're going to connect to
17
+ server = env[:machine].provider_config.server
18
+
19
+ # Prepare!
20
+ env[:ui].info(I18n.t("vagrant_managed_servers.linking_server", :host => server))
21
+ env[:ui].info(" -- Server: #{server}")
22
+
23
+ # Immediately save the ID since it is created at this point.
24
+ env[:machine].id = server
25
+
26
+ @app.call(env)
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end