vagrant-k3s 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +5 -0
  3. data/CODE_OF_CONDUCT.md +84 -0
  4. data/Gemfile +11 -0
  5. data/Gemfile.lock +127 -0
  6. data/LICENSE +177 -0
  7. data/README.md +79 -0
  8. data/Rakefile +24 -0
  9. data/bin/console +15 -0
  10. data/bin/setup +8 -0
  11. data/lib/vagrant-k3s/cap/alpine/curl_install.rb +15 -0
  12. data/lib/vagrant-k3s/cap/debian/curl_install.rb +16 -0
  13. data/lib/vagrant-k3s/cap/linux/curl_installed.rb +17 -0
  14. data/lib/vagrant-k3s/cap/linux/k3s_installed.rb +20 -0
  15. data/lib/vagrant-k3s/cap/redhat/curl_install.rb +22 -0
  16. data/lib/vagrant-k3s/cap/suse/curl_install.rb +18 -0
  17. data/lib/vagrant-k3s/command/kubectl.rb +12 -0
  18. data/lib/vagrant-k3s/command.rb +20 -0
  19. data/lib/vagrant-k3s/config.rb +148 -0
  20. data/lib/vagrant-k3s/plugin.rb +57 -0
  21. data/lib/vagrant-k3s/provisioner.rb +144 -0
  22. data/lib/vagrant-k3s/version.rb +7 -0
  23. data/lib/vagrant-k3s.rb +10 -0
  24. data/vagrant-k3s.gemspec +37 -0
  25. data/vendor/cache/bcrypt_pbkdf-1.1.0.gem +0 -0
  26. data/vendor/cache/builder-3.2.4.gem +0 -0
  27. data/vendor/cache/childprocess-4.1.0.gem +0 -0
  28. data/vendor/cache/concurrent-ruby-1.1.9.gem +0 -0
  29. data/vendor/cache/diff-lcs-1.4.4.gem +0 -0
  30. data/vendor/cache/ed25519-1.2.4.gem +0 -0
  31. data/vendor/cache/erubi-1.10.0.gem +0 -0
  32. data/vendor/cache/excon-0.86.0.gem +0 -0
  33. data/vendor/cache/ffi-1.15.4.gem +0 -0
  34. data/vendor/cache/gssapi-1.3.1.gem +0 -0
  35. data/vendor/cache/gyoku-1.3.1.gem +0 -0
  36. data/vendor/cache/hashicorp-checkpoint-0.1.5.gem +0 -0
  37. data/vendor/cache/httpclient-2.8.3.gem +0 -0
  38. data/vendor/cache/i18n-1.8.10.gem +0 -0
  39. data/vendor/cache/listen-3.7.0.gem +0 -0
  40. data/vendor/cache/little-plugger-1.1.4.gem +0 -0
  41. data/vendor/cache/log4r-1.1.10.gem +0 -0
  42. data/vendor/cache/logging-2.3.0.gem +0 -0
  43. data/vendor/cache/mime-types-3.3.1.gem +0 -0
  44. data/vendor/cache/mime-types-data-3.2021.0901.gem +0 -0
  45. data/vendor/cache/multi_json-1.15.0.gem +0 -0
  46. data/vendor/cache/net-scp-3.0.0.gem +0 -0
  47. data/vendor/cache/net-sftp-3.0.0.gem +0 -0
  48. data/vendor/cache/net-ssh-6.1.0.gem +0 -0
  49. data/vendor/cache/nori-2.6.0.gem +0 -0
  50. data/vendor/cache/rake-13.0.6.gem +0 -0
  51. data/vendor/cache/rb-fsevent-0.11.0.gem +0 -0
  52. data/vendor/cache/rb-inotify-0.10.1.gem +0 -0
  53. data/vendor/cache/rb-kqueue-0.2.7.gem +0 -0
  54. data/vendor/cache/rexml-3.2.5.gem +0 -0
  55. data/vendor/cache/rspec-3.10.0.gem +0 -0
  56. data/vendor/cache/rspec-core-3.10.1.gem +0 -0
  57. data/vendor/cache/rspec-expectations-3.10.1.gem +0 -0
  58. data/vendor/cache/rspec-mocks-3.10.2.gem +0 -0
  59. data/vendor/cache/rspec-support-3.10.2.gem +0 -0
  60. data/vendor/cache/rubyntlm-0.6.3.gem +0 -0
  61. data/vendor/cache/rubyzip-2.3.2.gem +0 -0
  62. data/vendor/cache/vagrant_cloud-3.0.5.gem +0 -0
  63. data/vendor/cache/wdm-0.1.1.gem +0 -0
  64. data/vendor/cache/winrm-2.3.6.gem +0 -0
  65. data/vendor/cache/winrm-elevated-1.2.3.gem +0 -0
  66. data/vendor/cache/winrm-fs-1.3.5.gem +0 -0
  67. metadata +141 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: fd1b65180a6f4e983ce1564c7559dd232bcff76be269e50b6157920b083d5aa2
4
+ data.tar.gz: 5d8797d4a6383c0c627c2e76247a8b34eddbe2766a2aca32e339a5f9b77291b8
5
+ SHA512:
6
+ metadata.gz: aaa47b130e4074c457811895f8069804020c4daa095f9aa61f972fadf700e92f034e9d9ba62a762e004b7a0b78b0d57fa363234f3fafacc7fd2cd2fc13085756
7
+ data.tar.gz: 1e770cd6237a909d563e365d493e034d53c0e81d2bb7f0fd14c1d046a8a5e99d4c443565d200c26f8a4cdf659ff51b91861b59e1580e32846e13abc0a40f1fc1
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2021-09-14
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at dweomer5@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ group :development do
6
+ gem 'vagrant', git: 'https://github.com/hashicorp/vagrant.git', tag: "v2.2.18"
7
+ end
8
+
9
+ group :plugins do
10
+ gemspec
11
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,127 @@
1
+ GIT
2
+ remote: https://github.com/hashicorp/vagrant.git
3
+ revision: 52857ccac9d315a6e1897c7885f463983ac67957
4
+ tag: v2.2.18
5
+ specs:
6
+ vagrant (2.2.18)
7
+ bcrypt_pbkdf (~> 1.1)
8
+ childprocess (~> 4.1.0)
9
+ ed25519 (~> 1.2.4)
10
+ erubi
11
+ hashicorp-checkpoint (~> 0.1.5)
12
+ i18n (~> 1.8)
13
+ listen (~> 3.5)
14
+ log4r (~> 1.1.9, < 1.1.11)
15
+ mime-types (~> 3.3)
16
+ net-scp (~> 3.0.0)
17
+ net-sftp (~> 3.0)
18
+ net-ssh (>= 6.1.0, < 6.2)
19
+ rb-kqueue (~> 0.2.0)
20
+ rexml (~> 3.2)
21
+ rubyzip (~> 2.0)
22
+ vagrant_cloud (~> 3.0.5)
23
+ wdm (~> 0.1.0)
24
+ winrm (>= 2.3.4, < 3.0)
25
+ winrm-elevated (>= 1.2.1, < 2.0)
26
+ winrm-fs (>= 1.3.4, < 2.0)
27
+
28
+ PATH
29
+ remote: .
30
+ specs:
31
+ vagrant-k3s (0.1.0)
32
+
33
+ GEM
34
+ remote: https://rubygems.org/
35
+ specs:
36
+ bcrypt_pbkdf (1.1.0)
37
+ builder (3.2.4)
38
+ childprocess (4.1.0)
39
+ concurrent-ruby (1.1.9)
40
+ diff-lcs (1.4.4)
41
+ ed25519 (1.2.4)
42
+ erubi (1.10.0)
43
+ excon (0.86.0)
44
+ ffi (1.15.4)
45
+ gssapi (1.3.1)
46
+ ffi (>= 1.0.1)
47
+ gyoku (1.3.1)
48
+ builder (>= 2.1.2)
49
+ hashicorp-checkpoint (0.1.5)
50
+ httpclient (2.8.3)
51
+ i18n (1.8.10)
52
+ concurrent-ruby (~> 1.0)
53
+ listen (3.7.0)
54
+ rb-fsevent (~> 0.10, >= 0.10.3)
55
+ rb-inotify (~> 0.9, >= 0.9.10)
56
+ little-plugger (1.1.4)
57
+ log4r (1.1.10)
58
+ logging (2.3.0)
59
+ little-plugger (~> 1.1)
60
+ multi_json (~> 1.14)
61
+ mime-types (3.3.1)
62
+ mime-types-data (~> 3.2015)
63
+ mime-types-data (3.2021.0901)
64
+ multi_json (1.15.0)
65
+ net-scp (3.0.0)
66
+ net-ssh (>= 2.6.5, < 7.0.0)
67
+ net-sftp (3.0.0)
68
+ net-ssh (>= 5.0.0, < 7.0.0)
69
+ net-ssh (6.1.0)
70
+ nori (2.6.0)
71
+ rake (13.0.6)
72
+ rb-fsevent (0.11.0)
73
+ rb-inotify (0.10.1)
74
+ ffi (~> 1.0)
75
+ rb-kqueue (0.2.7)
76
+ ffi (>= 0.5.0)
77
+ rexml (3.2.5)
78
+ rspec (3.10.0)
79
+ rspec-core (~> 3.10.0)
80
+ rspec-expectations (~> 3.10.0)
81
+ rspec-mocks (~> 3.10.0)
82
+ rspec-core (3.10.1)
83
+ rspec-support (~> 3.10.0)
84
+ rspec-expectations (3.10.1)
85
+ diff-lcs (>= 1.2.0, < 2.0)
86
+ rspec-support (~> 3.10.0)
87
+ rspec-mocks (3.10.2)
88
+ diff-lcs (>= 1.2.0, < 2.0)
89
+ rspec-support (~> 3.10.0)
90
+ rspec-support (3.10.2)
91
+ rubyntlm (0.6.3)
92
+ rubyzip (2.3.2)
93
+ vagrant_cloud (3.0.5)
94
+ excon (~> 0.73)
95
+ log4r (~> 1.1.10)
96
+ rexml (~> 3.2.5)
97
+ wdm (0.1.1)
98
+ winrm (2.3.6)
99
+ builder (>= 2.1.2)
100
+ erubi (~> 1.8)
101
+ gssapi (~> 1.2)
102
+ gyoku (~> 1.0)
103
+ httpclient (~> 2.2, >= 2.2.0.2)
104
+ logging (>= 1.6.1, < 3.0)
105
+ nori (~> 2.0)
106
+ rubyntlm (~> 0.6.0, >= 0.6.3)
107
+ winrm-elevated (1.2.3)
108
+ erubi (~> 1.8)
109
+ winrm (~> 2.0)
110
+ winrm-fs (~> 1.0)
111
+ winrm-fs (1.3.5)
112
+ erubi (~> 1.8)
113
+ logging (>= 1.6.1, < 3.0)
114
+ rubyzip (~> 2.0)
115
+ winrm (~> 2.0)
116
+
117
+ PLATFORMS
118
+ x86_64-linux
119
+
120
+ DEPENDENCIES
121
+ rake (~> 13.0)
122
+ rspec (~> 3.10.0)
123
+ vagrant!
124
+ vagrant-k3s!
125
+
126
+ BUNDLED WITH
127
+ 2.2.27
data/LICENSE ADDED
@@ -0,0 +1,177 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
data/README.md ADDED
@@ -0,0 +1,79 @@
1
+ # Vagrant::K3s
2
+
3
+ ## Installation
4
+
5
+ ```shell
6
+ vagrant plugin install vagrant-k3s
7
+ vagrant up --provider=<your favorite provider>
8
+ ```
9
+
10
+ ## Usage
11
+
12
+ ```ruby
13
+ Vagrant.configure("2") do |config|
14
+ config.vm.box = "centos/stream8"
15
+ config.vm.provision :k3s do |k3s|
16
+ # installer_url: can be anything that curl can access from the guest
17
+ # default =>`https://get.k3s.io`
18
+ # type => String
19
+ k3s.installer_url = 'https://get.k3s.io'
20
+
21
+ # args: are command line arguments to be passed to the shell, e.g.:
22
+ # `curl ... | sh -s - #{args}`
23
+ # type => String || Array<string>
24
+ k3s.args = "server --token=vagrant"
25
+ # or
26
+ k3s.args = %w[server --token=vagrant]
27
+
28
+ # env: environment variables to be set before invoking the installer script
29
+ # type => String || Array<String> || Hash
30
+ k3s.env = %w[K3S_KUBECONFIG_MODE=0640 K3S_SELINUX=true]
31
+ # or
32
+ k3s.env = {
33
+ :K3S_KUBECONFIG_MODE => '0640', # pass this as a string unless you like weird results in your guest ...
34
+ :K3S_SELINUX => true,
35
+ }
36
+ # or
37
+ k3s.env = <<~ENV
38
+ K3S_KUBECONFIG_MODE=0640
39
+ K3S_SELINUX=true
40
+ ENV
41
+
42
+ # env_path: where to write the envvars to be source prior to invoking the installer script
43
+ # default => `/etc/rancher/k3s/install.env`
44
+ k3s.env_path = '/etc/rancher/k3s/install.env'
45
+
46
+ # config: config file content in yaml
47
+ # type => String || Hash
48
+ k3s.config = {
49
+ :disable => %w[local-storage servicelb]
50
+ }
51
+ # or
52
+ k3s.config = <<~YAML
53
+ disable:
54
+ - local-storage
55
+ - servicelb
56
+ YAML
57
+
58
+ # config_path: where to write the config yaml.
59
+ # if you override this be sure to let k3s know, e.g.
60
+ # k3s.env = { :INSTALL_K3S_EXEC => '--config=/some/other/config.yaml' }
61
+ # or
62
+ # k3s.args = '--config=/some/other/config.yaml'
63
+ # default => `/etc/rancher/k3s/conf.yaml`
64
+ k3s.config_path = '/etc/rancher/k3s/conf.yaml'
65
+ end
66
+ end
67
+
68
+ ```
69
+ ## Development
70
+
71
+ See https://www.vagrantup.com/docs/plugins/development-basics
72
+
73
+ ## Contributing
74
+
75
+ Bug reports and pull requests are welcome on GitHub at https://github.com/dweomer/vagrant-k3s. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/dweomer/vagrant-k3s/blob/master/CODE_OF_CONDUCT.md).
76
+
77
+ ## Code of Conduct
78
+
79
+ Everyone interacting in the Vagrant::K3s project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/dweomer/vagrant-k3s/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rubygems'
4
+ require 'bundler/setup'
5
+ require 'rspec/core/rake_task'
6
+
7
+ # Immediately sync all stdout so that tools like buildbot can
8
+ # immediately load in the output.
9
+ $stdout.sync = true
10
+ $stderr.sync = true
11
+
12
+ # Change to the directory of this file.
13
+ Dir.chdir(File.expand_path("../", __FILE__))
14
+
15
+ # This installs the tasks that help with gem creation and
16
+ # publishing.
17
+ Bundler::GemHelper.install_tasks
18
+
19
+ # Install the `spec` task so that we can run tests.
20
+ RSpec::Core::RakeTask.new(:spec) do |t|
21
+ t.rspec_opts = "--order defined"
22
+ end
23
+ # Default task is to run the unit tests
24
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "vagrant-k3s"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module VagrantPlugins
4
+ module K3s
5
+ module Cap
6
+ module Alpine
7
+ module CurlInstall
8
+ def self.curl_install(machine)
9
+ machine.communicate.sudo("apk --quiet add --no-cache --no-progress curl")
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module VagrantPlugins
4
+ module K3s
5
+ module Cap
6
+ module Debian
7
+ module CurlInstall
8
+ def self.curl_install(machine)
9
+ machine.communicate.sudo("apt-get update -y -qq")
10
+ machine.communicate.sudo("apt-get install -y -qq curl")
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module VagrantPlugins
4
+ module K3s
5
+ module Cap
6
+ module Linux
7
+ module CurlInstalled
8
+ # Check if cURL is installed.
9
+ # @return [true, false]
10
+ def self.curl_installed(machine)
11
+ machine.communicate.test("/usr/bin/which curl", sudo: false)
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module VagrantPlugins
4
+ module K3s
5
+ module Cap
6
+ module Linux
7
+ module K3sInstalled
8
+ # Check if K3s is installed at the given version.
9
+ # @return [true, false]
10
+ def self.k3s_installed(machine, k3s="k3s")
11
+ machine.communicate.execute("/usr/bin/which k3s") do |type, data|
12
+ k3s = data.to_s if type == :stdout
13
+ end
14
+ machine.communicate.test("#{k3s} --version", sudo: true)
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module VagrantPlugins
4
+ module K3s
5
+ module Cap
6
+ module Redhat
7
+ module CurlInstall
8
+ include Linux::CurlInstalled
9
+ def self.curl_install(machine)
10
+ machine.communicate.sudo <<~EOF
11
+ if command -v dnf; then
12
+ dnf -y install curl
13
+ else
14
+ yum -y install curl
15
+ fi
16
+ EOF
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,18 @@
1
+ require_relative '../linux/curl_installed'
2
+
3
+ module VagrantPlugins
4
+ module K3s
5
+ module Cap
6
+ module Suse
7
+ module CurlInstall extend Linux::CurlInstalled
8
+ def self.curl_install(machine)
9
+ unless curl_installed?(machine)
10
+ machine.communicate.sudo("zypper -n -q update")
11
+ machine.communicate.sudo("zypper -n -q install curl")
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module VagrantPlugins
4
+ module K3s
5
+ class CommandKubectl < Vagrant.plugin(2, :command)
6
+ def execute
7
+ # puts "kubectl"
8
+ 0
9
+ end
10
+ end
11
+ end
12
+ end