diff --git a/openssh/moduli.sls b/openssh/moduli.sls index d871006..7e0bd3a 100644 --- a/openssh/moduli.sls +++ b/openssh/moduli.sls @@ -1,8 +1,19 @@ {% 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: 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 %} diff --git a/pillar.example b/pillar.example index 070a400..e22873a 100644 --- a/pillar.example +++ b/pillar.example @@ -155,13 +155,21 @@ openssh: - cname-to-minion.example.org - alias.example.org -# specify DH parameters (see /etc/ssh/moduli) + # specify DH parameters (see /etc/ssh/moduli) moduli: | # Time Type Tests Tries Size Generator Modulus 20120821045639 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293680B09D63 20120821045830 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C6042936814C2FFB 20120821050046 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C60429368214FC53 20120821050054 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C60429368218E83F + # ALTERNATIVELY, specify the location of the moduli file. Examples: + #moduli_source: http://some.server.somewhere/salt/moduli + #moduli_source: salt://files/ssh/moduli + # If moduli is specified, moduli_source will be ignored. + # Also, a proper hash file *must* be included in the same path. E.g.: + # http://some.server.somewhere/salt/moduli.hash + # salt://files/ssh/moduli.hash + # These will be automatically referenced to by the ssh_moduli state. # Required for openssh.known_hosts mine_functions: