nymphia 0.1.2 → 0.2.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.
- checksums.yaml +4 -4
- data/README.md +25 -20
- data/examples/base.rb +5 -5
- data/examples/company.rb +13 -13
- data/examples/result.example +2 -1
- data/lib/nymphia/dsl/context.rb +5 -0
- data/lib/nymphia/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e63af421a0ea05d92b9373afb3ec820b48926c1
|
4
|
+
data.tar.gz: e78bc17a8c1f2ea1783408968d8c3630adaafcc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45cc06ed31ce52ebba9f4b1ea366943f4fc208528bec9f7c146d4ec32213081f0f0f737965be47dfc12b7e352d550c5a31524c44cf82907e81e1d462dafa03e0
|
7
|
+
data.tar.gz: 1ed0a913d24959116dde40454f96adf2ee3dfa97e150b11bbff5830ae6759bf9b2ab236e2de320e1bdde8afbfb5c6ea415bec681be8d6076c4d9aabc3f0130b4
|
data/README.md
CHANGED
@@ -35,19 +35,20 @@ identity_file :private, '~/.ssh/id_rsa.1'
|
|
35
35
|
|
36
36
|
my_server_port = 4321
|
37
37
|
|
38
|
-
host
|
38
|
+
host('alice', 'my server on VPS') {
|
39
39
|
hostname 'alice.example.com'
|
40
40
|
user 'alice'
|
41
41
|
port my_server_port
|
42
42
|
use_identify_file :private
|
43
|
-
|
43
|
+
}
|
44
44
|
```
|
45
45
|
|
46
46
|
Following ssh config file is generated after the code is compiled.
|
47
47
|
|
48
48
|
```
|
49
49
|
#
|
50
|
-
# This config is generated by Nymphia 0.1.
|
50
|
+
# This config is generated by Nymphia 0.1.2
|
51
|
+
# @ 2017-12-08T16:34:15+09:00
|
51
52
|
#
|
52
53
|
|
53
54
|
# my server on VPS
|
@@ -64,19 +65,21 @@ Method `host` generate `Host` directive. First argument is name of host, Second
|
|
64
65
|
|
65
66
|
### Splitting files
|
66
67
|
|
67
|
-
You can use `
|
68
|
+
You can use `include_file` method to include other Nymphia file like following example. Absolute path and relative path are acceptable as the file path.
|
69
|
+
|
70
|
+
We could use `load` in previous version, but `load` is obsoleted now.
|
68
71
|
|
69
72
|
```ruby
|
70
73
|
identity_file :private, '~/.ssh/id_rsa.1'
|
71
74
|
|
72
|
-
host
|
75
|
+
host('alice', 'my server on VPS') {
|
73
76
|
hostname 'alice.example.com'
|
74
77
|
user 'alice'
|
75
78
|
port 4321
|
76
79
|
use_identify_file :private
|
77
|
-
|
80
|
+
}
|
78
81
|
|
79
|
-
|
82
|
+
include_file 'other_nymphia_file.rb'
|
80
83
|
```
|
81
84
|
|
82
85
|
### Proxy method
|
@@ -86,7 +89,7 @@ Method `proxy` is almost same to `host`, but `local_forward` method can be used
|
|
86
89
|
```ruby
|
87
90
|
identity_file :company_gateway, '~/.ssh/id_rsa.company.gw'
|
88
91
|
|
89
|
-
proxy
|
92
|
+
proxy('awsproxy.company.apne1') {
|
90
93
|
hostname 'gw.apne1.example.com'
|
91
94
|
user 'alice'
|
92
95
|
port 19822
|
@@ -105,14 +108,15 @@ proxy 'awsproxy.company.apne1' do
|
|
105
108
|
'localhost' => 10389,
|
106
109
|
'ldap.apne.aws.example.com' => 398,
|
107
110
|
}
|
108
|
-
|
111
|
+
}
|
109
112
|
```
|
110
113
|
|
111
114
|
Following ssh config file is generated after the code is compiled.
|
112
115
|
|
113
116
|
```
|
114
117
|
#
|
115
|
-
# This config is generated by Nymphia 0.1.
|
118
|
+
# This config is generated by Nymphia 0.1.2
|
119
|
+
# @ 2017-12-08T16:34:15+09:00
|
116
120
|
#
|
117
121
|
|
118
122
|
Host awsproxy.company.apne1
|
@@ -133,31 +137,31 @@ Nymphia has `group` and `gateway` method to make ssh config more structurally. F
|
|
133
137
|
identity_file :company, '~/.ssh/id_rsa.company'
|
134
138
|
identity_file :company_gateway, '~/.ssh/id_rsa.company.gw'
|
135
139
|
|
136
|
-
gateway
|
140
|
+
gateway('company.gateway') {
|
137
141
|
hostname 'gw.example.com'
|
138
142
|
user 'alice'
|
139
143
|
port 19822
|
140
|
-
|
144
|
+
}
|
141
145
|
|
142
|
-
group
|
146
|
+
group('company.ap-northeast-1') {
|
143
147
|
use_gateway 'company.gateway'
|
144
148
|
|
145
|
-
default_params
|
149
|
+
default_params {
|
146
150
|
check_host_ip 'no'
|
147
151
|
strict_host_key_checking 'no'
|
148
152
|
user 'alice'
|
149
153
|
port 9822
|
150
154
|
use_identify_file :company, :company_gateway
|
151
|
-
|
155
|
+
}
|
152
156
|
|
153
|
-
host
|
157
|
+
host('*.apne.aws.example.com')
|
154
158
|
|
155
|
-
host
|
159
|
+
host('alice.apne.aws.example.com') {
|
156
160
|
hostname '10.16.16.16'
|
157
161
|
user 'white_rabbit'
|
158
162
|
port 7777
|
159
|
-
|
160
|
-
|
163
|
+
}
|
164
|
+
}
|
161
165
|
```
|
162
166
|
|
163
167
|
Following ssh config file is generated after the code is compiled.
|
@@ -165,7 +169,8 @@ Following ssh config file is generated after the code is compiled.
|
|
165
169
|
```
|
166
170
|
|
167
171
|
#
|
168
|
-
# This config is generated by Nymphia 0.1.
|
172
|
+
# This config is generated by Nymphia 0.1.2
|
173
|
+
# @ 2017-12-08T16:34:15+09:00
|
169
174
|
#
|
170
175
|
|
171
176
|
Host company.gateway
|
data/examples/base.rb
CHANGED
@@ -2,18 +2,18 @@ identity_file :private, '~/.ssh/id_rsa.1'
|
|
2
2
|
|
3
3
|
my_server_port = 4321
|
4
4
|
|
5
|
-
host
|
5
|
+
host('alice', 'my server on VPS') {
|
6
6
|
hostname 'alice.example.com'
|
7
7
|
user 'alice'
|
8
8
|
port my_server_port
|
9
9
|
use_identify_file :private
|
10
|
-
|
10
|
+
}
|
11
11
|
|
12
|
-
host
|
12
|
+
host('queen', 'NAS in my home network') {
|
13
13
|
hostname '172.16.16.3'
|
14
14
|
user 'alice'
|
15
15
|
port my_server_port
|
16
16
|
use_identify_file :private
|
17
|
-
|
17
|
+
}
|
18
18
|
|
19
|
-
|
19
|
+
include_file 'company.rb'
|
data/examples/company.rb
CHANGED
@@ -2,33 +2,33 @@ identity_file :company, '~/.ssh/id_rsa.company'
|
|
2
2
|
identity_file :company_gateway, '~/.ssh/id_rsa.company.gw'
|
3
3
|
identity_file :company_internal, '~/.ssh/id_rsa.company.in'
|
4
4
|
|
5
|
-
gateway
|
5
|
+
gateway('company.gateway', 'Gateway saerver of my company') {
|
6
6
|
hostname 'gw.example.com'
|
7
7
|
user 'alice'
|
8
8
|
port 19822
|
9
|
-
|
9
|
+
}
|
10
10
|
|
11
|
-
group
|
11
|
+
group('company.ap-northeast-1') {
|
12
12
|
use_gateway 'company.gateway'
|
13
13
|
|
14
|
-
default_params
|
14
|
+
default_params {
|
15
15
|
check_host_ip 'no'
|
16
16
|
strict_host_key_checking 'no'
|
17
17
|
user 'alice'
|
18
18
|
port 9822
|
19
19
|
use_identify_file :company, :company_gateway
|
20
|
-
|
20
|
+
}
|
21
21
|
|
22
|
-
host
|
22
|
+
host('*.apne.aws.example.com')
|
23
23
|
|
24
|
-
host
|
24
|
+
host('alice.apne.aws.example.com') {
|
25
25
|
hostname '10.16.16.16'
|
26
26
|
user 'white_rabbit'
|
27
27
|
port 7777
|
28
|
-
|
29
|
-
|
28
|
+
}
|
29
|
+
}
|
30
30
|
|
31
|
-
proxy
|
31
|
+
proxy('awsproxy.company.apne1') {
|
32
32
|
hostname 'gw.apne1.example.com'
|
33
33
|
user 'alice'
|
34
34
|
port 19822
|
@@ -47,8 +47,8 @@ proxy 'awsproxy.company.apne1' do
|
|
47
47
|
'localhost' => 10389,
|
48
48
|
'ldap.apne.aws.example.com' => 398,
|
49
49
|
}
|
50
|
-
|
50
|
+
}
|
51
51
|
|
52
|
-
host
|
52
|
+
host('ghe.company.example.com') {
|
53
53
|
use_identify_file :company_internal
|
54
|
-
|
54
|
+
}
|
data/examples/result.example
CHANGED
data/lib/nymphia/dsl/context.rb
CHANGED
@@ -37,6 +37,11 @@ class Nymphia::DSL::Context
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def load(load_file_path)
|
40
|
+
warn "#{caller[0]}: #load method is obsolated. Use #include_file"
|
41
|
+
include_file(load_file_path)
|
42
|
+
end
|
43
|
+
|
44
|
+
def include_file(load_file_path)
|
40
45
|
absolute_load_file_path = Pathname.new(@path).dirname.join(load_file_path)
|
41
46
|
dsl_code = File.read(absolute_load_file_path)
|
42
47
|
|
data/lib/nymphia/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nymphia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mozamimy (Moza USANE)
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|