Blob Blame History Raw
{%- macro puma_service_dropin(service, append=[]) %}
{{ service }}_puma_service_custom:
  file.managed:
    - name: /etc/systemd/system/{{ service }}.service.d/salt.conf
    - makedirs: True
    - contents:
        - {{ pillar['managed_by_salt'] | yaml_encode }}
        - '[Service]'
        - Environment=RAILS_LOG_TO_STDOUT=1
        {%- for append in append %}
        - {{ apend }}
        {%- endfor %}
{%- endmacro %}

{%- macro known_hosts(hosts, user) %}
{%- for target, keys in salt['mine.get'](hosts, 'ssh_host_keys', 'list').items() %}
{%- if 'ed25519.pub' in keys %}
known_hosts_{{ target }}:
  ssh_known_hosts.present:
    - name: {{ target }}
    - user: {{ user }}
    - key: {{ keys['ed25519.pub'].split()[1] }}
    - enc: ssh-ed25519
    - hash_known_hosts: False
{%- endif %}
{%- endfor %}
{%- endmacro %}