File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 265
265
user => ' root' ,
266
266
type => $key .split(' ' )[0],
267
267
key => $key .split(' ' )[1],
268
- options => [' restrict' ],
268
+ options => [' restrict' , ssh::client::from_restriction() ],
269
269
tag => ' profile::puppet::server::puppet_sync' ,
270
270
}
271
271
}
Original file line number Diff line number Diff line change
1
+ # @summary constructs a ssh authorized_keys from= restriction
2
+ # for connections from this machine.
3
+ function ssh::client::from_restriction () >> String[1] {
4
+ $ips = [$facts [' networking' ][' ip' ], $facts [' networking' ][' ip6' ]].filter |$x | {
5
+ # check if we have a routable IPv6 address (and not just a link-local one)
6
+ $x =~ NotUndef and !($x =~ /^fe80/)
7
+ }.sort
8
+
9
+ " from=\" ${ips.join(',')}\" "
10
+ }
You can’t perform that action at this time.
0 commit comments