mirror of
https://github.com/saltstack-formulas/openssh-formula.git
synced 2024-12-01 00:25:31 +01:00
df477b25c2
The `map.jinja` now exports a single variable called `mapdata`. We extract the `openssh`, `sshd_config` and `ssh_config` from it to minimize the changes to `.sls` files.
21 lines
829 B
Plaintext
21 lines
829 B
Plaintext
{% from "openssh/map.jinja" import mapdata with context %}
|
|
{%- set openssh = mapdata.openssh %}
|
|
|
|
{% set moduli = salt['pillar.get']('openssh:moduli', False) -%}
|
|
{% set moduli_source = salt['pillar.get']('openssh:moduli_source', False) -%}
|
|
{% if moduli or moduli_source -%}
|
|
ssh_moduli:
|
|
file.managed:
|
|
- name: {{ openssh.ssh_moduli }}
|
|
{% if moduli -%}
|
|
# Although we have the contents of the moduli in the variable 'moduli',
|
|
# inlining the variable here *will* cause problems. Using the '|' literal string indicator
|
|
# Necessitates using the '|indent' filter, and this is too complex.
|
|
# Rather, let salt read the pillar itself.
|
|
- contents_pillar: openssh:moduli
|
|
{% elif moduli_source -%}
|
|
- source: {{ moduli_source }}
|
|
- source_hash: {{ moduli_source|trim }}.hash
|
|
{%- endif %}
|
|
{% endif %}
|