<commit_before>{% from 'certbot/map.jinja' import certbot with context %}


include:
    - .pillar_check


{% set needs_backport = grains.get('oscodename') == 'jessie' %}
certbot:
    {% if needs_backport %}
    pkgrepo.managed:
        - name: deb http://ftp.debian.org/debian {{ grains.get('oscodename') }}-backports main
    {% endif %}

    pkg.installed:
        - name: {{ certbot.package }}
        {% if needs_backport %}
        - fromrepo: jessie-backports
        - require:
            - pkgrepo: certbot
        {% endif %}


{% for site in certbot.get('sites', []) %}
certbot-update-{{ site }}:
    cron.present:
        - name: {{ certbot.binary }} certonly
                --standalone
                {% if 'pre_hook' in certbot -%}
                --pre-hook '{{ certbot.pre_hook }}'
                {% endif -%}
                {% if 'post_hook' in certbot -%}
                --post-hook '{{ certbot.post_hook }}'
                {% endif -%}
                --domain {{ site }}
                --quiet
                --email {{ certbot.administrative_contact }}
                --preferred-challenges tls-sni-01
                --agree-tos
                --text
        - identifier: certbot-update-{{ site }}
        - minute: random
{% endfor %}


{% for family in ('ipv4', 'ipv6') %}
certbot-firewall-outgoing-https-{{ family }}:
    firewall.append:
        - family: {{ family }}
        - chain: OUTPUT
        - protocol: tcp
        - dport: 443
        - match:
            - comment
            - owner
        - comment: 'certbot: Allow outgoing https'
        - uid-owner: root
        - jump: ACCEPT
<commit_msg>Drop challenge version specificity<commit_after>{% from 'certbot/map.jinja' import certbot with context %}


include:
    - .pillar_check


{% set needs_backport = grains.get('oscodename') == 'jessie' %}
certbot:
    {% if needs_backport %}
    pkgrepo.managed:
        - name: deb http://ftp.debian.org/debian {{ grains.get('oscodename') }}-backports main
    {% endif %}

    pkg.installed:
        - name: {{ certbot.package }}
        {% if needs_backport %}
        - fromrepo: jessie-backports
        - require:
            - pkgrepo: certbot
        {% endif %}


{% for site in certbot.get('sites', []) %}
certbot-update-{{ site }}:
    cron.present:
        - name: {{ certbot.binary }} certonly
                --standalone
                {% if 'pre_hook' in certbot -%}
                --pre-hook '{{ certbot.pre_hook }}'
                {% endif -%}
                {% if 'post_hook' in certbot -%}
                --post-hook '{{ certbot.post_hook }}'
                {% endif -%}
                --domain {{ site }}
                --quiet
                --email {{ certbot.administrative_contact }}
                --preferred-challenges tls-sni
                --agree-tos
                --text
        - identifier: certbot-update-{{ site }}
        - minute: random
{% endfor %}


{% for family in ('ipv4', 'ipv6') %}
certbot-firewall-outgoing-https-{{ family }}:
    firewall.append:
        - family: {{ family }}
        - chain: OUTPUT
        - protocol: tcp
        - dport: 443
        - match:
            - comment
            - owner
        - comment: 'certbot: Allow outgoing https'
        - uid-owner: root
        - jump: ACCEPT

{'fraction_non_alphanumeric': 0.14574532287266143, 'fraction_numerical': 0.003621001810500905, 'mean_word_length': 1.4943566591422122, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1267227', 'n_tokens_mistral': 1088, 'n_tokens_neox': 967, 'n_words': 209}