<commit_before>---
- name: Add certbot repo
  apt_repository:
    repo: 'ppa:certbot/certbot'
    state: present

- name: Install Let's Encrypt
  apt: name="{{ letsencrypt_package }}"
  tags: ['letsencrypt']

- name: Create Let's Encrypt directories
  file:
    state: directory
    path: "{{ item }}"
    owner: "{{ letsencrypt_webuser }}"
    group: "{{ letsencrypt_webuser }}"
  with_items:
    - "/etc/letsencrypt"
    - "/var/log/letsencrypt"
    - "/var/lib/letsencrypt"
  tags: ['letsencrypt']

- name: Create Let's Encrypt webroot directory
  file:
    state: directory
    path: "{{ letsencrypt_webroot }}"
    owner: "{{ letsencrypt_webuser }}"
    group: "{{ letsencrypt_webuser }}"
  become: True
  become_user: "{{ letsencrypt_webuser }}"
  tags: ['letsencrypt']

- name: Copy nginx config
  template:
    src: "{{ letsencrypt_webserver_config }}"
    dest: "{{ letsencrypt_webserver_sites_available }}/{{ letsencrypt_webserver_config | basename }}"
  when: letsencrypt_webserver == "nginx"
  tags: ['letsencrypt']

- name: Enable nginx config
  file:
    state: link
    path: "{{ letsencrypt_webserver_sites_enabled }}/{{ letsencrypt_webserver_config | basename }}"
    src: "{{ letsencrypt_webserver_sites_available }}/{{ letsencrypt_webserver_config | basename }}"
  when: letsencrypt_webserver == "nginx"
  tags: ['letsencrypt']

- name: Reload nginx
  service: name=nginx state=reloaded
  when: letsencrypt_webserver == "nginx"
  tags: ['letsencrypt']

- name: Generate certificates using webroot
  command: >
    {{ letsencrypt_command }} certonly {{ letsencrypt_flags }} --agree-tos -m "{{ letsencrypt_email }}"
    --webroot -w "{{ letsencrypt_webroot }}" -d {{ item.domains | join(' -d ') }}
  args:
    creates: /etc/letsencrypt/live/{{ item.domains[0] }}/fullchain.pem
  with_items: "{{ letsencrypt_certs }}"
  become: True
  become_user: "{{ letsencrypt_webuser }}"
  tags: ['letsencrypt']

- name: Make sure certbot systemd override dir exists
  file: path=/etc/systemd/system/certbot.service.d state=directory
  tags:
    - letsencrypt

- name: Make sure to restart service on certbot/ssl renewal
  copy:
    src=certbot_override.conf
    dest=/etc/systemd/system/certbot.service.d/certbot.conf
  notify:
    - reload systemd configuration
  tags:
    - letsencrypt
<commit_msg>Adds more tags for letsencrypt<commit_after>---
- name: Add certbot repo
  apt_repository:
    repo: 'ppa:certbot/certbot'
    state: present
  tags:
    - letsencrypt
    - letsencrypt:install

- name: Install Let's Encrypt
  apt: name="{{ letsencrypt_package }}"
  tags: ['letsencrypt', 'letsencrypt:install']

- name: Create Let's Encrypt directories
  file:
    state: directory
    path: "{{ item }}"
    owner: "{{ letsencrypt_webuser }}"
    group: "{{ letsencrypt_webuser }}"
  with_items:
    - "/etc/letsencrypt"
    - "/var/log/letsencrypt"
    - "/var/lib/letsencrypt"
  tags: ['letsencrypt', 'letsencrypt:configuration']

- name: Create Let's Encrypt webroot directory
  file:
    state: directory
    path: "{{ letsencrypt_webroot }}"
    owner: "{{ letsencrypt_webuser }}"
    group: "{{ letsencrypt_webuser }}"
  become: True
  become_user: "{{ letsencrypt_webuser }}"
  tags: ['letsencrypt', 'letsencrypt:configuration']

- name: Copy nginx config
  template:
    src: "{{ letsencrypt_webserver_config }}"
    dest: "{{ letsencrypt_webserver_sites_available }}/{{ letsencrypt_webserver_config | basename }}"
  when: letsencrypt_webserver == "nginx"
  tags: ['letsencrypt', 'letsencrypt:configuration']

- name: Enable nginx config
  file:
    state: link
    path: "{{ letsencrypt_webserver_sites_enabled }}/{{ letsencrypt_webserver_config | basename }}"
    src: "{{ letsencrypt_webserver_sites_available }}/{{ letsencrypt_webserver_config | basename }}"
  when: letsencrypt_webserver == "nginx"
  tags: ['letsencrypt', 'letsencrypt:configuration']

- name: Reload nginx
  service: name=nginx state=reloaded
  when: letsencrypt_webserver == "nginx"
  tags: ['letsencrypt', 'letsencrypt:configuration']

- name: Generate certificates using webroot
  command: >
    {{ letsencrypt_command }} certonly {{ letsencrypt_flags }} --agree-tos -m "{{ letsencrypt_email }}"
    --webroot -w "{{ letsencrypt_webroot }}" -d {{ item.domains | join(' -d ') }}
  args:
    creates: /etc/letsencrypt/live/{{ item.domains[0] }}/fullchain.pem
  with_items: "{{ letsencrypt_certs }}"
  become: True
  become_user: "{{ letsencrypt_webuser }}"
  tags: ['letsencrypt', 'letsencrypt:run']

- name: Make sure certbot systemd override dir exists
  file: path=/etc/systemd/system/certbot.service.d state=directory
  tags:
    - letsencrypt
    - letsencrypt:configuration

- name: Make sure to restart service on certbot/ssl renewal
  copy:
    src=certbot_override.conf
    dest=/etc/systemd/system/certbot.service.d/certbot.conf
  notify:
    - reload systemd configuration
  tags:
    - letsencrypt
    - letsencrypt:configuration

{'fraction_non_alphanumeric': 0.13584752635847527, 'fraction_numerical': 0.00040551500405515005, 'mean_word_length': 3.9979736575481257, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '633377', 'n_tokens_mistral': 1697, 'n_tokens_neox': 1670, 'n_words': 356}