Allow moduli to be pulled as file
Added Jinja logic to allow the option to pull the moduli from an online source.
This commit is contained in:
parent
8ea31fd661
commit
e6603ae62a
|
@ -1,8 +1,19 @@
|
||||||
{% from "openssh/map.jinja" import openssh with context %}
|
{% from "openssh/map.jinja" import openssh with context %}
|
||||||
|
|
||||||
{% if salt['pillar.get']('openssh:moduli', False) %}
|
{% 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:
|
ssh_moduli:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: {{ openssh.ssh_moduli }}
|
- 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
|
- contents_pillar: openssh:moduli
|
||||||
|
{% elif moduli_source -%}
|
||||||
|
- source: {{ moduli_source }}
|
||||||
|
- source_hash: {{ moduli_source|trim }}.hash
|
||||||
|
{%- endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue