File: ssh_config.erb

package info (click to toggle)
puppet-module-saz-ssh 13.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 564 kB
  • sloc: ruby: 1,511; sh: 10; makefile: 7
file content (60 lines) | stat: -rw-r--r-- 1,533 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File managed by Puppet
<%-
  def bool2str(v)
    case v
    when true
      'yes'
    when false
      'no'
    else
      v
    end
  end
-%>

<%- @options.each do |k, v| -%>
<%- if v.is_a?(Hash) -%>
<%- if k.length > 1024 -%>
<%- fail("Line exceeds 1024 characters: #{k}") -%>
<%- end -%>
<%= k %>
<%- v.sort.each do |key, value| -%>
    <%- if value.is_a?(Array) -%>
    <%- value.each do |a| -%>
    <%- if a != '' && a != nil -%>
    <%- line_content = "#{key} #{bool2str(a)}" -%>
    <%- if line_content.length > 1020 -%>
    <%- fail("Line exceeds 1024 characters: #{line_content}") -%>
    <%- else -%>
    <%= line_content %>
    <%- end -%>
    <%- end -%>
    <%- end -%>
    <%- elsif value != '' && value != nil -%>
    <%- line_content = "#{key} #{bool2str(value)}" -%>
    <%- if line_content.length > 1020 -%>
    <%- fail("Line exceeds 1024 characters: #{line_content}") -%>
    <%- end -%>
    <%= line_content %>
    <%- end -%>
<%- end -%>
<%- else -%>
<%- if v.is_a?(Array) -%>
<%- v.each do |a| -%>
<%- if a != '' && a != nil -%>
<%- line_content = "#{k} #{bool2str(a)}" -%>
<%- if line_content.length > 1024 -%>
<%- fail("Line exceeds 1024 characters: #{line_content}") -%>
<%- end -%>
<%= k %> <%= bool2str(a) %>
<%- end -%>
<%- end -%>
<%- elsif v != :undef && v != '' && v != nil -%>
<%- line_content = "#{k} #{bool2str(v)}" -%>
<%- if line_content.length > 1024 -%>
<%- fail("Line exceeds 1024 characters: #{line_content}") -%>
<%- end -%>
<%= k %> <%= bool2str(v) %>
<%- end -%>
<%- end -%>
<%- end -%>