# Модифицированая версия политики, которая работает и в версиях ниже 2.2 # Источники: https://ald-pro.com/threads/obnovlenie-prjamoj-i-obratnoj-zony.173/ # https://www.aldpro.ru/professional/ALD_Pro_Module_06/ALD_Pro_group_policy.html#id51 {% set id = 'rbta_ldap_custom_gp_host_dyndns' %} {% set node = salt['grains.get']('nodename') %} {% set gpo = salt['pillar.get']('aldpro-hosts:' + node + ':' + id) %} {% if gpo %} {% set domain = salt['grains.get']('domain') %} {% set dyndns_update='true' if gpo['dyndns_update']=='' or gpo['dyndns_update']|lower=='true' else 'false' %} {% set dyndns_update_ptr=gpo['dyndns_update_ptr'] if gpo['dyndns_update_ptr']|lower in ['true','false'] else 'false' %} {% set dyndns_refresh_interval = gpo['dyndns_refresh_interval'] if gpo['dyndns_refresh_interval'] != '' and gpo['dyndns_refresh_interval']|int != 0 else '43200' %} {% set dyndns_ttl = gpo['dyndns_ttl'] if gpo['dyndns_ttl'] != '' and gpo['dyndns_ttl']|int != 0 else '3600' %} {{id}}_dyndns_update: ini.options_present: - name: /etc/sssd/sssd.conf - separator: '=' - sections: domain/{{domain}}: dyndns_update: {{dyndns_update}} {{id}}_dyndns_update_ptr: ini.options_present: - name: /etc/sssd/sssd.conf - separator: '=' - sections: domain/{{domain}}: dyndns_update_ptr: {{dyndns_update_ptr}} {{id}}_dyndns_refresh_interval: ini.options_present: - name: /etc/sssd/sssd.conf - separator: '=' - sections: domain/{{domain}}: dyndns_refresh_interval: {{dyndns_refresh_interval}} {{id}}_dyndns_ttl: ini.options_present: - name: /etc/sssd/sssd.conf - separator: '=' - sections: domain/{{domain}}: dyndns_ttl: {{dyndns_ttl}} {% endif %}