vagrant-routeros 0.0.1

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 241ca11ab07293485150fb321d0aec70ca802f276095c958d2cde19126cc9f00
4
+ data.tar.gz: e18ddb58c9fddd95e07fc41a9060fe1e473b69e37a04747b2c6aa40a96b59914
5
+ SHA512:
6
+ metadata.gz: 467375442a349c14f16c4a1afebe15910c2fd160aff9c163a95d4236c2326a26946ea84111b1f34469dce013012f7cea1768a86ce562f8f153207c9604fa0bfa
7
+ data.tar.gz: 33f9dad4f470556b3ba14730051ccb5eb5c6db186abd769ebe4889e8caf2a4af703fb588f82545044fa6990a11535f6d6ab499ad86bced96b8aebcdfbc01548d
@@ -0,0 +1,21 @@
1
+ on:
2
+ push:
3
+ branches:
4
+ - main
5
+ paths-ignore:
6
+ - 'CHANGELOG.md'
7
+
8
+ jobs:
9
+ build-gem:
10
+ name: Build gem
11
+ runs-on: ubuntu-18.04
12
+ steps:
13
+ - name: Code Checkout
14
+ uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
15
+ - name: Set Ruby
16
+ uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0
17
+ with:
18
+ ruby-version: '2.6'
19
+ - name: Build RubyGem
20
+ run: gem build my-vagrant-guest-plugin-ruby-template.gemspec
21
+ working-directory: ${{github.workspace}}
@@ -0,0 +1,22 @@
1
+ on:
2
+ push:
3
+ tags: '*'
4
+
5
+ jobs:
6
+ release:
7
+ name: Build and release gem
8
+ runs-on: ubuntu-18.04
9
+ steps:
10
+ - name: Code Checkout
11
+ uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
12
+ - name: Set Ruby
13
+ uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0
14
+ with:
15
+ ruby-version: '2.6'
16
+ - name: Build and release gem
17
+ env:
18
+ GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
19
+ run: |
20
+ gem build *.gemspec
21
+ gem push *.gem
22
+ working-directory: ${{github.workspace}}
data/.gitignore ADDED
@@ -0,0 +1,52 @@
1
+ # OS-specific
2
+ .DS_Store
3
+
4
+ # Editor swapfiles
5
+ .*.sw?
6
+ *~
7
+
8
+ # Vagrant stuff
9
+ acceptance_config.yml
10
+ boxes/*
11
+ /.vagrant
12
+ /website/.vagrant
13
+ /website/build
14
+ /vagrant-spec.config.rb
15
+ test/vagrant-spec/.vagrant/
16
+
17
+ # Bundler/Rubygems
18
+ *.gem
19
+ .bundle
20
+ pkg/*
21
+ tags
22
+ /Gemfile.lock
23
+ test/tmp/
24
+ vendor/
25
+ /exec
26
+ .ruby-bundle
27
+
28
+ # Documentation
29
+ _site/*
30
+ .yardoc/
31
+ doc/
32
+
33
+ # Python
34
+ *.pyc
35
+
36
+ # Rubinius
37
+ *.rbc
38
+
39
+ # IDE junk
40
+ .idea/*
41
+ *.iml
42
+ .project
43
+
44
+ # Ruby Managers
45
+ .rbenv
46
+ .rbenv-gemsets
47
+ .ruby-gemset
48
+ .ruby-version
49
+ .rvmrc
50
+
51
+ # Box storage for spec
52
+ test/vagrant-spec/boxes/*.box
data/CHANGELOG.md ADDED
@@ -0,0 +1,2 @@
1
+ # 0.0.1 (Unreleased)
2
+
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
4
+ source 'https://rubygems.org'
5
+
6
+ gemspec
7
+
8
+ group :development do
9
+ if File.exist?(File.expand_path("../../vagrant", __FILE__))
10
+ gem 'vagrant', path: "../vagrant"
11
+ else
12
+ gem 'vagrant', :git => 'https://github.com/hashicorp/vagrant.git', branch: "main"
13
+ end
14
+ gem 'rake', '>= 12.3.3'
15
+ end
data/LICENSE ADDED
@@ -0,0 +1,375 @@
1
+ Copyright (c) 2022 HashiCorp, Inc.
2
+
3
+ Mozilla Public License Version 2.0
4
+ ==================================
5
+
6
+ 1. Definitions
7
+ --------------
8
+
9
+ 1.1. "Contributor"
10
+ means each individual or legal entity that creates, contributes to
11
+ the creation of, or owns Covered Software.
12
+
13
+ 1.2. "Contributor Version"
14
+ means the combination of the Contributions of others (if any) used
15
+ by a Contributor and that particular Contributor's Contribution.
16
+
17
+ 1.3. "Contribution"
18
+ means Covered Software of a particular Contributor.
19
+
20
+ 1.4. "Covered Software"
21
+ means Source Code Form to which the initial Contributor has attached
22
+ the notice in Exhibit A, the Executable Form of such Source Code
23
+ Form, and Modifications of such Source Code Form, in each case
24
+ including portions thereof.
25
+
26
+ 1.5. "Incompatible With Secondary Licenses"
27
+ means
28
+
29
+ (a) that the initial Contributor has attached the notice described
30
+ in Exhibit B to the Covered Software; or
31
+
32
+ (b) that the Covered Software was made available under the terms of
33
+ version 1.1 or earlier of the License, but not also under the
34
+ terms of a Secondary License.
35
+
36
+ 1.6. "Executable Form"
37
+ means any form of the work other than Source Code Form.
38
+
39
+ 1.7. "Larger Work"
40
+ means a work that combines Covered Software with other material, in
41
+ a separate file or files, that is not Covered Software.
42
+
43
+ 1.8. "License"
44
+ means this document.
45
+
46
+ 1.9. "Licensable"
47
+ means having the right to grant, to the maximum extent possible,
48
+ whether at the time of the initial grant or subsequently, any and
49
+ all of the rights conveyed by this License.
50
+
51
+ 1.10. "Modifications"
52
+ means any of the following:
53
+
54
+ (a) any file in Source Code Form that results from an addition to,
55
+ deletion from, or modification of the contents of Covered
56
+ Software; or
57
+
58
+ (b) any new file in Source Code Form that contains any Covered
59
+ Software.
60
+
61
+ 1.11. "Patent Claims" of a Contributor
62
+ means any patent claim(s), including without limitation, method,
63
+ process, and apparatus claims, in any patent Licensable by such
64
+ Contributor that would be infringed, but for the grant of the
65
+ License, by the making, using, selling, offering for sale, having
66
+ made, import, or transfer of either its Contributions or its
67
+ Contributor Version.
68
+
69
+ 1.12. "Secondary License"
70
+ means either the GNU General Public License, Version 2.0, the GNU
71
+ Lesser General Public License, Version 2.1, the GNU Affero General
72
+ Public License, Version 3.0, or any later versions of those
73
+ licenses.
74
+
75
+ 1.13. "Source Code Form"
76
+ means the form of the work preferred for making modifications.
77
+
78
+ 1.14. "You" (or "Your")
79
+ means an individual or a legal entity exercising rights under this
80
+ License. For legal entities, "You" includes any entity that
81
+ controls, is controlled by, or is under common control with You. For
82
+ purposes of this definition, "control" means (a) the power, direct
83
+ or indirect, to cause the direction or management of such entity,
84
+ whether by contract or otherwise, or (b) ownership of more than
85
+ fifty percent (50%) of the outstanding shares or beneficial
86
+ ownership of such entity.
87
+
88
+ 2. License Grants and Conditions
89
+ --------------------------------
90
+
91
+ 2.1. Grants
92
+
93
+ Each Contributor hereby grants You a world-wide, royalty-free,
94
+ non-exclusive license:
95
+
96
+ (a) under intellectual property rights (other than patent or trademark)
97
+ Licensable by such Contributor to use, reproduce, make available,
98
+ modify, display, perform, distribute, and otherwise exploit its
99
+ Contributions, either on an unmodified basis, with Modifications, or
100
+ as part of a Larger Work; and
101
+
102
+ (b) under Patent Claims of such Contributor to make, use, sell, offer
103
+ for sale, have made, import, and otherwise transfer either its
104
+ Contributions or its Contributor Version.
105
+
106
+ 2.2. Effective Date
107
+
108
+ The licenses granted in Section 2.1 with respect to any Contribution
109
+ become effective for each Contribution on the date the Contributor first
110
+ distributes such Contribution.
111
+
112
+ 2.3. Limitations on Grant Scope
113
+
114
+ The licenses granted in this Section 2 are the only rights granted under
115
+ this License. No additional rights or licenses will be implied from the
116
+ distribution or licensing of Covered Software under this License.
117
+ Notwithstanding Section 2.1(b) above, no patent license is granted by a
118
+ Contributor:
119
+
120
+ (a) for any code that a Contributor has removed from Covered Software;
121
+ or
122
+
123
+ (b) for infringements caused by: (i) Your and any other third party's
124
+ modifications of Covered Software, or (ii) the combination of its
125
+ Contributions with other software (except as part of its Contributor
126
+ Version); or
127
+
128
+ (c) under Patent Claims infringed by Covered Software in the absence of
129
+ its Contributions.
130
+
131
+ This License does not grant any rights in the trademarks, service marks,
132
+ or logos of any Contributor (except as may be necessary to comply with
133
+ the notice requirements in Section 3.4).
134
+
135
+ 2.4. Subsequent Licenses
136
+
137
+ No Contributor makes additional grants as a result of Your choice to
138
+ distribute the Covered Software under a subsequent version of this
139
+ License (see Section 10.2) or under the terms of a Secondary License (if
140
+ permitted under the terms of Section 3.3).
141
+
142
+ 2.5. Representation
143
+
144
+ Each Contributor represents that the Contributor believes its
145
+ Contributions are its original creation(s) or it has sufficient rights
146
+ to grant the rights to its Contributions conveyed by this License.
147
+
148
+ 2.6. Fair Use
149
+
150
+ This License is not intended to limit any rights You have under
151
+ applicable copyright doctrines of fair use, fair dealing, or other
152
+ equivalents.
153
+
154
+ 2.7. Conditions
155
+
156
+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
157
+ in Section 2.1.
158
+
159
+ 3. Responsibilities
160
+ -------------------
161
+
162
+ 3.1. Distribution of Source Form
163
+
164
+ All distribution of Covered Software in Source Code Form, including any
165
+ Modifications that You create or to which You contribute, must be under
166
+ the terms of this License. You must inform recipients that the Source
167
+ Code Form of the Covered Software is governed by the terms of this
168
+ License, and how they can obtain a copy of this License. You may not
169
+ attempt to alter or restrict the recipients' rights in the Source Code
170
+ Form.
171
+
172
+ 3.2. Distribution of Executable Form
173
+
174
+ If You distribute Covered Software in Executable Form then:
175
+
176
+ (a) such Covered Software must also be made available in Source Code
177
+ Form, as described in Section 3.1, and You must inform recipients of
178
+ the Executable Form how they can obtain a copy of such Source Code
179
+ Form by reasonable means in a timely manner, at a charge no more
180
+ than the cost of distribution to the recipient; and
181
+
182
+ (b) You may distribute such Executable Form under the terms of this
183
+ License, or sublicense it under different terms, provided that the
184
+ license for the Executable Form does not attempt to limit or alter
185
+ the recipients' rights in the Source Code Form under this License.
186
+
187
+ 3.3. Distribution of a Larger Work
188
+
189
+ You may create and distribute a Larger Work under terms of Your choice,
190
+ provided that You also comply with the requirements of this License for
191
+ the Covered Software. If the Larger Work is a combination of Covered
192
+ Software with a work governed by one or more Secondary Licenses, and the
193
+ Covered Software is not Incompatible With Secondary Licenses, this
194
+ License permits You to additionally distribute such Covered Software
195
+ under the terms of such Secondary License(s), so that the recipient of
196
+ the Larger Work may, at their option, further distribute the Covered
197
+ Software under the terms of either this License or such Secondary
198
+ License(s).
199
+
200
+ 3.4. Notices
201
+
202
+ You may not remove or alter the substance of any license notices
203
+ (including copyright notices, patent notices, disclaimers of warranty,
204
+ or limitations of liability) contained within the Source Code Form of
205
+ the Covered Software, except that You may alter any license notices to
206
+ the extent required to remedy known factual inaccuracies.
207
+
208
+ 3.5. Application of Additional Terms
209
+
210
+ You may choose to offer, and to charge a fee for, warranty, support,
211
+ indemnity or liability obligations to one or more recipients of Covered
212
+ Software. However, You may do so only on Your own behalf, and not on
213
+ behalf of any Contributor. You must make it absolutely clear that any
214
+ such warranty, support, indemnity, or liability obligation is offered by
215
+ You alone, and You hereby agree to indemnify every Contributor for any
216
+ liability incurred by such Contributor as a result of warranty, support,
217
+ indemnity or liability terms You offer. You may include additional
218
+ disclaimers of warranty and limitations of liability specific to any
219
+ jurisdiction.
220
+
221
+ 4. Inability to Comply Due to Statute or Regulation
222
+ ---------------------------------------------------
223
+
224
+ If it is impossible for You to comply with any of the terms of this
225
+ License with respect to some or all of the Covered Software due to
226
+ statute, judicial order, or regulation then You must: (a) comply with
227
+ the terms of this License to the maximum extent possible; and (b)
228
+ describe the limitations and the code they affect. Such description must
229
+ be placed in a text file included with all distributions of the Covered
230
+ Software under this License. Except to the extent prohibited by statute
231
+ or regulation, such description must be sufficiently detailed for a
232
+ recipient of ordinary skill to be able to understand it.
233
+
234
+ 5. Termination
235
+ --------------
236
+
237
+ 5.1. The rights granted under this License will terminate automatically
238
+ if You fail to comply with any of its terms. However, if You become
239
+ compliant, then the rights granted under this License from a particular
240
+ Contributor are reinstated (a) provisionally, unless and until such
241
+ Contributor explicitly and finally terminates Your grants, and (b) on an
242
+ ongoing basis, if such Contributor fails to notify You of the
243
+ non-compliance by some reasonable means prior to 60 days after You have
244
+ come back into compliance. Moreover, Your grants from a particular
245
+ Contributor are reinstated on an ongoing basis if such Contributor
246
+ notifies You of the non-compliance by some reasonable means, this is the
247
+ first time You have received notice of non-compliance with this License
248
+ from such Contributor, and You become compliant prior to 30 days after
249
+ Your receipt of the notice.
250
+
251
+ 5.2. If You initiate litigation against any entity by asserting a patent
252
+ infringement claim (excluding declaratory judgment actions,
253
+ counter-claims, and cross-claims) alleging that a Contributor Version
254
+ directly or indirectly infringes any patent, then the rights granted to
255
+ You by any and all Contributors for the Covered Software under Section
256
+ 2.1 of this License shall terminate.
257
+
258
+ 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
259
+ end user license agreements (excluding distributors and resellers) which
260
+ have been validly granted by You or Your distributors under this License
261
+ prior to termination shall survive termination.
262
+
263
+ ************************************************************************
264
+ * *
265
+ * 6. Disclaimer of Warranty *
266
+ * ------------------------- *
267
+ * *
268
+ * Covered Software is provided under this License on an "as is" *
269
+ * basis, without warranty of any kind, either expressed, implied, or *
270
+ * statutory, including, without limitation, warranties that the *
271
+ * Covered Software is free of defects, merchantable, fit for a *
272
+ * particular purpose or non-infringing. The entire risk as to the *
273
+ * quality and performance of the Covered Software is with You. *
274
+ * Should any Covered Software prove defective in any respect, You *
275
+ * (not any Contributor) assume the cost of any necessary servicing, *
276
+ * repair, or correction. This disclaimer of warranty constitutes an *
277
+ * essential part of this License. No use of any Covered Software is *
278
+ * authorized under this License except under this disclaimer. *
279
+ * *
280
+ ************************************************************************
281
+
282
+ ************************************************************************
283
+ * *
284
+ * 7. Limitation of Liability *
285
+ * -------------------------- *
286
+ * *
287
+ * Under no circumstances and under no legal theory, whether tort *
288
+ * (including negligence), contract, or otherwise, shall any *
289
+ * Contributor, or anyone who distributes Covered Software as *
290
+ * permitted above, be liable to You for any direct, indirect, *
291
+ * special, incidental, or consequential damages of any character *
292
+ * including, without limitation, damages for lost profits, loss of *
293
+ * goodwill, work stoppage, computer failure or malfunction, or any *
294
+ * and all other commercial damages or losses, even if such party *
295
+ * shall have been informed of the possibility of such damages. This *
296
+ * limitation of liability shall not apply to liability for death or *
297
+ * personal injury resulting from such party's negligence to the *
298
+ * extent applicable law prohibits such limitation. Some *
299
+ * jurisdictions do not allow the exclusion or limitation of *
300
+ * incidental or consequential damages, so this exclusion and *
301
+ * limitation may not apply to You. *
302
+ * *
303
+ ************************************************************************
304
+
305
+ 8. Litigation
306
+ -------------
307
+
308
+ Any litigation relating to this License may be brought only in the
309
+ courts of a jurisdiction where the defendant maintains its principal
310
+ place of business and such litigation shall be governed by laws of that
311
+ jurisdiction, without reference to its conflict-of-law provisions.
312
+ Nothing in this Section shall prevent a party's ability to bring
313
+ cross-claims or counter-claims.
314
+
315
+ 9. Miscellaneous
316
+ ----------------
317
+
318
+ This License represents the complete agreement concerning the subject
319
+ matter hereof. If any provision of this License is held to be
320
+ unenforceable, such provision shall be reformed only to the extent
321
+ necessary to make it enforceable. Any law or regulation which provides
322
+ that the language of a contract shall be construed against the drafter
323
+ shall not be used to construe this License against a Contributor.
324
+
325
+ 10. Versions of the License
326
+ ---------------------------
327
+
328
+ 10.1. New Versions
329
+
330
+ Mozilla Foundation is the license steward. Except as provided in Section
331
+ 10.3, no one other than the license steward has the right to modify or
332
+ publish new versions of this License. Each version will be given a
333
+ distinguishing version number.
334
+
335
+ 10.2. Effect of New Versions
336
+
337
+ You may distribute the Covered Software under the terms of the version
338
+ of the License under which You originally received the Covered Software,
339
+ or under the terms of any subsequent version published by the license
340
+ steward.
341
+
342
+ 10.3. Modified Versions
343
+
344
+ If you create software not governed by this License, and you want to
345
+ create a new license for such software, you may create and use a
346
+ modified version of this License if you rename the license and remove
347
+ any references to the name of the license steward (except to note that
348
+ such modified license differs from this License).
349
+
350
+ 10.4. Distributing Source Code Form that is Incompatible With Secondary
351
+ Licenses
352
+
353
+ If You choose to distribute Source Code Form that is Incompatible With
354
+ Secondary Licenses under the terms of this version of the License, the
355
+ notice described in Exhibit B of this License must be attached.
356
+
357
+ Exhibit A - Source Code Form License Notice
358
+ -------------------------------------------
359
+
360
+ This Source Code Form is subject to the terms of the Mozilla Public
361
+ License, v. 2.0. If a copy of the MPL was not distributed with this
362
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
363
+
364
+ If it is not possible or desirable to put the notice in a particular
365
+ file, then You may include the notice in a location (such as a LICENSE
366
+ file in a relevant directory) where a recipient would be likely to look
367
+ for such a notice.
368
+
369
+ You may add additional accurate notices of copyright ownership.
370
+
371
+ Exhibit B - "Incompatible With Secondary Licenses" Notice
372
+ ---------------------------------------------------------
373
+
374
+ This Source Code Form is "Incompatible With Secondary Licenses", as
375
+ defined by the Mozilla Public License, v. 2.0.
data/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # vagrant-guest-plugin-ruby-template
2
+
3
+ This repo is a template for building a Ruby Vagrant guest plugin. Follow the steps to setup your own guest plugin!
4
+
5
+ 1. Copy this repo. Its a template so follow the Github instructions to [create a repo from a template using the UI](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template#creating-a-repository-from-a-template), or use the github cli.
6
+ ```
7
+ $ gh repo create vagrant-guest-myspecialguest --template hashicorp/vagrant-guest-plugin-ruby-template --public
8
+ ```
9
+
10
+ #### Update the gemspec
11
+ 2. Update the gemspec. Choose a good, descriptive name for your project. Rename `my-vagrant-guest-plugin-ruby-template.gemspec` to reflect this, and fill out the required information.
12
+
13
+ 3. Rename all the references of `my-vagrant-guest-plugin-ruby-template.gemspec` to your new name.
14
+
15
+ #### Update the module
16
+ 4. Rename `vagrant-guest.rb` to match the name of your plugin and update the contents of the file. This includes updating the module name `MyVagrantGuestPlugin`, the name and description fields and the ` guest(:myguestplugin) do` line.
17
+
18
+ 5. Rename all the references of `MyVagrantGuestPlugin` to your new name.
19
+
20
+ 6. Update the guest detection method in `lib/guest/guest.rb`. This method will be run by Vagrant to determine if the guest is running the OS assumed by the plugin.
21
+
22
+ #### Add capabilities
23
+ 7. Add any new capabilities the plugin needs to the `guest/cap` module. Be sure to register the capabilities.
24
+
25
+ #### Build and install your gem
26
+ 8. Commit all your changes if you haven't already.
27
+ ```
28
+ $ git add -A
29
+ $ git commit -m "My Vagrant guest plugin"
30
+ ```
31
+
32
+ 9. Build your plugin
33
+ ```
34
+ $ gem build my-vagrant-guest-plugin-ruby-template.gemspec
35
+ Successfully built RubyGem
36
+ Name: my-vagrant-guest-plugin
37
+ Version: 0.0.1
38
+ File: my-vagrant-guest-plugin-0.0.1.gem
39
+ ```
40
+
41
+ 10. (optional) Push your gem to [RubyGems](https://rubygems.org/)
42
+ ```
43
+ $ gem push my-vagrant-guest-plugin-0.0.1.gem
44
+ ```
45
+
46
+ 11. Install your plugin
47
+ ```
48
+ # Install from the locally built gem
49
+ $ vagrant plugin install my-vagrant-guest-plugin-0.0.1.gem
50
+
51
+ # If you pushed the gem to RubyGems, install from RubyGems
52
+ $ vagrant plugin install my-vagrant-guest-plugin
53
+ ```
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+ require 'rake/testtask'
4
+ require 'rspec/core/rake_task'
5
+
6
+ # Immediately sync all stdout so that tools like buildbot can
7
+ # immediately load in the output.
8
+ $stdout.sync = true
9
+ $stderr.sync = true
10
+
11
+ # This installs the tasks that help with gem creation and
12
+ # publishing.
13
+ Bundler::GemHelper.install_tasks
14
+
15
+ namespace :test do
16
+ RSpec::Core::RakeTask.new(:unit) do |t|
17
+ t.pattern = "test/unit/**/*_test.rb"
18
+ t.rspec_opts = "--color"
19
+ end
20
+ end
21
+
22
+ task default: "test:unit"
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
data/Vagrantfile ADDED
@@ -0,0 +1,89 @@
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+
4
+ # All Vagrant configuration is done below. The "2" in Vagrant.configure
5
+ # configures the configuration version (we support older styles for
6
+ # backwards compatibility). Please don't change it unless you know what
7
+ # you're doing.
8
+ Vagrant.configure("2") do |config|
9
+ # The most common configuration options are documented and commented below.
10
+ # For a complete reference, please see the online documentation at
11
+ # https://docs.vagrantup.com.
12
+
13
+ # Every Vagrant development environment requires a box. You can search for
14
+ # boxes at https://vagrantcloud.com/search.
15
+ config.vm.box = "ktogias/mikrotik"
16
+ config.vm.guest = "routeros"
17
+ config.vm.hostname = "testhost"
18
+ config.vm.network "private_network", libvirt__network_name: "testnet", libvirt__forward_mode: "veryisolated", libvirt__dhcp_enabled: false
19
+ config.vm.provider :libvirt do |libvirt|
20
+ libvirt.management_network_mac = "52:54:00:ea:f2:ee"
21
+ end
22
+
23
+ #config.ssh.shell = "\#"
24
+ #config.ssh.insert_key = false
25
+ # config.vm.allow_fstab_modification = false
26
+ # config.vm.allow_hosts_modification = false
27
+ #config.vm.synced_folder '.', '/vagrant', disabled: true
28
+
29
+ # Disable automatic box update checking. If you disable this, then
30
+ # boxes will only be checked for updates when the user runs
31
+ # `vagrant box outdated`. This is not recommended.
32
+ # config.vm.box_check_update = false
33
+
34
+ # Create a forwarded port mapping which allows access to a specific port
35
+ # within the machine from a port on the host machine. In the example below,
36
+ # accessing "localhost:8080" will access port 80 on the guest machine.
37
+ # NOTE: This will enable public access to the opened port
38
+ # config.vm.network "forwarded_port", guest: 80, host: 8080
39
+
40
+ # Create a forwarded port mapping which allows access to a specific port
41
+ # within the machine from a port on the host machine and only allow access
42
+ # via 127.0.0.1 to disable public access
43
+ # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
44
+
45
+ # Create a private network, which allows host-only access to the machine
46
+ # using a specific IP.
47
+ # config.vm.network "private_network", ip: "192.168.33.10"
48
+
49
+ # Create a public network, which generally matched to bridged network.
50
+ # Bridged networks make the machine appear as another physical device on
51
+ # your network.
52
+ # config.vm.network "public_network"
53
+
54
+ # Share an additional folder to the guest VM. The first argument is
55
+ # the path on the host to the actual folder. The second argument is
56
+ # the path on the guest to mount the folder. And the optional third
57
+ # argument is a set of non-required options.
58
+ # config.vm.synced_folder "../data", "/vagrant_data"
59
+
60
+ # Disable the default share of the current code directory. Doing this
61
+ # provides improved isolation between the vagrant box and your host
62
+ # by making sure your Vagrantfile isn't accessible to the vagrant box.
63
+ # If you use this you may want to enable additional shared subfolders as
64
+ # shown above.
65
+ # config.vm.synced_folder ".", "/vagrant", disabled: true
66
+
67
+ # Provider-specific configuration so you can fine-tune various
68
+ # backing providers for Vagrant. These expose provider-specific options.
69
+ # Example for VirtualBox:
70
+ #
71
+ # config.vm.provider "virtualbox" do |vb|
72
+ # # Display the VirtualBox GUI when booting the machine
73
+ # vb.gui = true
74
+ #
75
+ # # Customize the amount of memory on the VM:
76
+ # vb.memory = "1024"
77
+ # end
78
+ #
79
+ # View the documentation for the provider you are using for more
80
+ # information on available options.
81
+
82
+ # Enable provisioning with a shell script. Additional provisioners such as
83
+ # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
84
+ # documentation for more information about their specific syntax and use.
85
+ # config.vm.provision "shell", inline: <<-SHELL
86
+ # apt-get update
87
+ # apt-get install -y apache2
88
+ # SHELL
89
+ end
@@ -0,0 +1,11 @@
1
+ module RouterosGuestPlugin
2
+ module Cap
3
+ class ChangeHostName
4
+ def self.change_host_name(machine, name)
5
+ system("vagrant ssh #{machine.name} -- '" +
6
+ ":if ([/system identity get name] != \"#{name}\") do={ /system identity set name=\"#{name}\" }'")
7
+ end
8
+ end
9
+ end
10
+ end
11
+
@@ -0,0 +1,10 @@
1
+ module RouterosGuestPlugin
2
+ module Cap
3
+ class ConfigureNetworks
4
+ def self.configure_networks(machine, path = "/interface")
5
+ machine.ui.info("ConfigureNetworks is disabled for RouterOS")
6
+ end
7
+ end
8
+ end
9
+ end
10
+
@@ -0,0 +1,17 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
4
+ module RouterosGuestPlugin
5
+ module Cap
6
+ class ConfigureSSHShell
7
+ def self.set_ssh_shell(machine)
8
+ if machine.config.vm.guest == :routeros
9
+ # Echo a message on the guest machine
10
+ machine.ui.info("Setting ssh shell and sudo command to # for RouterOS")
11
+ machine.config.ssh.shell = "#"
12
+ machine.config.ssh.sudo_command = "#"
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,16 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
4
+ module RouterosGuestPlugin
5
+ module Cap
6
+ class DisableSSHInsertKey
7
+ def self.disable_ssh_insert_key(machine)
8
+ if machine.config.vm.guest == :routeros
9
+ # Echo a message on the guest machine
10
+ machine.ui.info("Disabling ssh insert key for RouterOS")
11
+ machine.config.ssh.insert_key = false
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
4
+ module RouterosGuestPlugin
5
+ module Cap
6
+ class DisableSyncedFolder
7
+ def self.disable_synced_folder(machine)
8
+ if machine.config.vm.guest == :routeros
9
+ # Echo a message on the guest machine
10
+ machine.ui.info("Disabling sync folder for RouterOS")
11
+ machine.config.vm.synced_folder '.', '/vagrant', disabled: true
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ module RouterosGuestPlugin
2
+ module Cap
3
+ class Halt
4
+ def self.halt(machine)
5
+ begin
6
+ machine.ui.detail("Executing '/system shutdown' command")
7
+ system ("vagrant ssh #{machine.name} -- '/system shutdown'")
8
+ rescue IOError => e
9
+ machine.ui.warn(e)
10
+ # Ignore, this probably means connection closed because it
11
+ # shut down.
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,11 @@
1
+ module RouterosGuestPlugin
2
+ module Cap
3
+ class NetworkInterfaces
4
+ def self.network_interfaces(machine, path = "/interface")
5
+ machine.ui.info("NetworkInterfaces is disabled for RouterOS")
6
+ []
7
+ end
8
+ end
9
+ end
10
+ end
11
+
@@ -0,0 +1,12 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
4
+ module RouterosGuestPlugin
5
+ module Cap
6
+ class PersistMountSharedFolder
7
+ def self.persist_mount_shared_folder(machine, folders)
8
+ machine.ui.info("PersistMountSharedFolder is disabled for RouterOS")
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
4
+ require 'logger'
5
+
6
+ module RouterosGuestPlugin
7
+ class Guest < Vagrant.plugin("2", :guest)
8
+ def detect?(machine)
9
+ machine.config.vm.guest == "routeros"
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module RouterosGuestPlugin
2
+ module Provisioner
3
+ class Shell < Vagrant.plugin("2", "provisioner")
4
+ def provision
5
+ if @machine.config.vm.guest == :routeros
6
+ # Echo a message on the guest machine
7
+ @machine.ui.info("Shell provisioner is disabled for RouterOS")
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
4
+ module RouterosGuestPlugin
5
+ VERSION = File.read(File.expand_path("../../../VERSION", __FILE__)).chop
6
+ end
@@ -0,0 +1,104 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
4
+ begin
5
+ require "vagrant"
6
+ rescue LoadError
7
+ raise "Vagrant is required!"
8
+ end
9
+
10
+ require "guest/guest"
11
+
12
+ module RouterosGuestPlugin
13
+ class Plugin < Vagrant.plugin("2")
14
+ # TODO: rename name and description
15
+ name "RouterosGuestPlugin"
16
+ description <<-DESC
17
+ This is my guest plugin.
18
+ DESC
19
+
20
+ # TODO: rename :myguestplugin to something more relevant.
21
+ # You can also define this plugin as a child of an existing
22
+ # guest plugin here. A child plugin will inherit all of the
23
+ # capabilities of the parent. To do that add the parent
24
+ # as an argument to `guest`. For example `guest(:myguestplugin, :linux)`
25
+ # sets the parent plugin to be the linux guest plugin.
26
+ guest(:routeros, :debian) do
27
+ Guest
28
+ end
29
+
30
+ guest_capability(:routeros, :persist_mount_shared_folder) do
31
+ require_relative 'guest/cap/persist_mount_shared_folder'
32
+ Cap::PersistMountSharedFolder
33
+ end
34
+
35
+ guest_capability(:routeros, :network_interfaces) do
36
+ require_relative 'guest/cap/network_interfaces'
37
+ Cap::NetworkInterfaces
38
+ end
39
+
40
+ guest_capability(:routeros, :configure_networks) do
41
+ require_relative 'guest/cap/configure_networks'
42
+ Cap::ConfigureNetworks
43
+ end
44
+
45
+ guest_capability(:routeros, :change_host_name) do
46
+ require_relative 'guest/cap/change_host_name'
47
+ Cap::ChangeHostName
48
+ end
49
+
50
+ guest_capability(:routeros, :halt) do
51
+ require_relative 'guest/cap/halt'
52
+ Cap::Halt
53
+ end
54
+
55
+ action_hook(:set_custom_ssh_shell, :machine_action_up) do |hook|
56
+ require_relative 'guest/cap/configure_ssh_shell'
57
+ hook.prepend(Proc.new do |env|
58
+ Cap::ConfigureSSHShell.set_ssh_shell(env[:machine])
59
+ end)
60
+ end
61
+
62
+ action_hook(:set_custom_ssh_shell, :machine_action_halt) do |hook|
63
+ require_relative 'guest/cap/configure_ssh_shell'
64
+ hook.prepend(Proc.new do |env|
65
+ Cap::ConfigureSSHShell.set_ssh_shell(env[:machine])
66
+ end)
67
+ end
68
+
69
+ action_hook(:disable_synced_folder, :machine_action_up) do |hook|
70
+ require_relative 'guest/cap/disable_synced_folder'
71
+ hook.prepend(Proc.new do |env|
72
+ Cap::DisableSyncedFolder.disable_synced_folder(env[:machine])
73
+ end)
74
+ end
75
+
76
+ action_hook(:disable_synced_folder, :machine_action_halt) do |hook|
77
+ require_relative 'guest/cap/disable_synced_folder'
78
+ hook.prepend(Proc.new do |env|
79
+ Cap::DisableSyncedFolder.disable_synced_folder(env[:machine])
80
+ end)
81
+ end
82
+
83
+ action_hook(:disable_ssh_insert_key, :machine_action_up) do |hook|
84
+ require_relative 'guest/cap/disable_ssh_insert_key'
85
+ hook.prepend(Proc.new do |env|
86
+ Cap::DisableSSHInsertKey.disable_ssh_insert_key(env[:machine])
87
+ end)
88
+ end
89
+
90
+ action_hook(:disable_ssh_insert_key, :machine_action_halt) do |hook|
91
+ require_relative 'guest/cap/disable_ssh_insert_key'
92
+ hook.prepend(Proc.new do |env|
93
+ Cap::DisableSSHInsertKey.disable_ssh_insert_key(env[:machine])
94
+ end)
95
+ end
96
+
97
+ provisioner "shell" do
98
+ require_relative "guest/provisioner/shell"
99
+ Provisioner::Shell
100
+ end
101
+
102
+
103
+ end
104
+ end
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |gem|
4
+ # TODO: rename name, author, email, description, summary,
5
+ # license, and homepage
6
+ gem.name = "vagrant-routeros"
7
+ gem.version = File.read('VERSION').chop
8
+ gem.authors = ["Konstantinos Togias"]
9
+ gem.email = ["ktogias@gmail.com"]
10
+ gem.description = "Vagrant RouterOS guest plugin"
11
+ gem.summary = "A guest plugin for RouterOS. Mostly configuring and disabling capabilities that cause errors."
12
+ gem.license = 'MIT'
13
+ gem.homepage = "https://github.com/ktogias/vagrant-routeros-plugin"
14
+
15
+ gem.add_development_dependency "rake", "~> 13.0"
16
+ gem.add_development_dependency "rspec", "~> 3.5.0"
17
+
18
+ gem.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|testdrive)/}) }
19
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
20
+ gem.require_paths = ["lib"]
21
+ end
metadata ADDED
@@ -0,0 +1,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-routeros
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Konstantinos Togias
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-02-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '13.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '13.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 3.5.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 3.5.0
41
+ description: Vagrant RouterOS guest plugin
42
+ email:
43
+ - ktogias@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".github/workflows/build.yml"
49
+ - ".github/workflows/release.yml"
50
+ - ".gitignore"
51
+ - CHANGELOG.md
52
+ - Gemfile
53
+ - LICENSE
54
+ - README.md
55
+ - Rakefile
56
+ - VERSION
57
+ - Vagrantfile
58
+ - lib/guest/cap/change_host_name.rb
59
+ - lib/guest/cap/configure_networks.rb
60
+ - lib/guest/cap/configure_ssh_shell.rb
61
+ - lib/guest/cap/disable_ssh_insert_key.rb
62
+ - lib/guest/cap/disable_synced_folder.rb
63
+ - lib/guest/cap/halt.rb
64
+ - lib/guest/cap/network_interfaces.rb
65
+ - lib/guest/cap/persist_mount_shared_folder.rb
66
+ - lib/guest/guest.rb
67
+ - lib/guest/provisioner/shell.rb
68
+ - lib/guest/version.rb
69
+ - lib/vagrant-routeros.rb
70
+ - vagrant-routeros.gemspec
71
+ homepage: https://github.com/ktogias/vagrant-routeros-plugin
72
+ licenses:
73
+ - MIT
74
+ metadata: {}
75
+ post_install_message:
76
+ rdoc_options: []
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ requirements: []
90
+ rubygems_version: 3.5.5
91
+ signing_key:
92
+ specification_version: 4
93
+ summary: A guest plugin for RouterOS. Mostly configuring and disabling capabilities
94
+ that cause errors.
95
+ test_files: []