File tree Expand file tree Collapse file tree 4 files changed +14
-16
lines changed Expand file tree Collapse file tree 4 files changed +14
-16
lines changed Original file line number Diff line number Diff line change 2929
3030include:
3131 - openssh
32- {%- from " openssh/map.jinja" import openssh with context -% }
33- {%- set openssh_pillar = pillar.get(' openssh' , {}) -% }
34- {%- set auth = openssh_pillar.get(' auth' , {}) -% }
32+ {%- from " openssh/map.jinja" import openssh, sshd_config with context -% }
33+ {%- set auth = openssh.get(' auth' , {}) -% }
3534{%- for identifier,keys in auth.items() -% }
3635 {%- for key in keys -% }
3736 {% if ' present' in key and key[' present' ] % }
3837{{ print_name(identifier, key) }}:
3938 ssh_auth.present:
4039 {{ print_ssh_auth(identifier, key) }}
41- {%- if ' sshd_config' in pillar and ' AuthorizedKeysFile' in pillar[ ' sshd_config ' ] % }
42- - config: ' {{ pillar[ ' sshd_config' ] [' AuthorizedKeysFile' ] }} '
40+ {%- if sshd_config.get( " AuthorizedKeysFile" , None ) % }
41+ - config: ' {{ sshd_config[' AuthorizedKeysFile' ] }} '
4342 {% endif % }
4443 - require:
4544 - service: {{ openssh.service }}
4645 {%- else % }
4746{{ print_name(identifier, key) }}:
4847 ssh_auth.absent:
4948 {{ print_ssh_auth(identifier, key) }}
50- {%- if ' sshd_config' in pillar and ' AuthorizedKeysFile' in pillar[ ' sshd_config ' ] % }
51- - config: ' {{ pillar[ ' sshd_config' ] [' AuthorizedKeysFile' ] }} '
49+ {%- if sshd_config.get( " AuthorizedKeysFile" , None ) % }
50+ - config: ' {{ sshd_config[' AuthorizedKeysFile' ] }} '
5251 {% endif -% }
5352 {%- endif -% }
5453 {%- endfor -% }
Original file line number Diff line number Diff line change 11include:
22 - openssh
33
4- {% from " openssh/map.jinja" import openssh with context -% }
5- {%- set openssh_pillar = salt[" pillar.get" ](" openssh" , {}) -% }
6- {%- set authorized_keys_file = salt[" pillar.get" ](" sshd_config:AuthorizedKeysFile" , None ) % }
4+ {% from " openssh/map.jinja" import openssh, sshd_config with context -% }
5+ {%- set authorized_keys_file = sshd_config.get(" AuthorizedKeysFile" , None ) % }
76
8- {%- for store, config in salt[ " pillar .get" ]( " openssh: auth_map" , {}).items() % }
7+ {%- for store, config in openssh .get( " auth_map" , {}).items() % }
98{%- set store_base = config[" source" ] % }
109# SSH store openssh:auth_map:{{ store }}
1110{%- for user, keys in config.get(" users" , {}).items() % }
Original file line number Diff line number Diff line change 1- {% from " openssh/map.jinja" import openssh with context % }
1+ {% from " openssh/map.jinja" import openssh, sshd_config with context % }
22
33include:
44 - openssh
55
6- {% if salt[ ' pillar.get ' ]( ' sshd_config' , False ) % }
6+ {% if sshd_config % }
77sshd_config- with - ini:
88 ini.options_present:
99 - name: {{ openssh.sshd_config }}
1010 - separator: ' '
1111 - watch_in:
1212 - service: {{ openssh.service }}
1313 - sections:
14- {%- for k,v in salt[ ' pillar.get ' ]( ' sshd_config' ,{}) .items() % }
14+ {%- for k,v in sshd_config.items() % }
1515 {{ k }}: ' {{ v }} '
1616 {%- endfor % }
1717{% endif % }
Original file line number Diff line number Diff line change 1- {% - import_yaml "openssh/defaults.yaml" as default_settings - %}
2- {% - set ssh_config = salt [ 'pillar.get' ]( 'ssh_config' , default = default_settings . default . ssh_config , merge = True ) - %}
1+ {% from "openssh/map.jinja" import ssh_config with context %}
2+
33{#- present in ssh_config and known in actual file options -#}
44{% - set processed_options = [] -%}
55{% - set string_or_list_options = ['KexAlgorithms' , 'Ciphers' , 'MACs' ] -%}
You can’t perform that action at this time.
0 commit comments