<commit_before>---
- name: install nginx
  apt: state=latest pkg=nginx
  when: ansible_distribution == 'Ubuntu'

- name: install nginx
  yum: state=latest pkg=nginx
  when: ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat'

- name: create directories for ssl certificiates
  file: path=/etc/nginx/ssl state=directory

- name: generate TLS key
  command:
    openssl req -subj
    '/C={{ nginx_country | default(nginx.country) }}/ST={{ nginx_state | default(nginx.state) }}/L={{ nginx_city | default(nginx.city) }}/O={{ nginx_org | default(nginx.org) }}/CN={{ nginx_cn | default(nginx.cn) }}'
    -x509 -nodes -days {{ nginx_days | default(nginx.days) }} -newkey rsa:{{ nginx_rsa | default(nginx.rsa) }} -keyout {{ nginx_key_file | default(nginx.key_file) }}
    -out {{ nginx_cert_file | default(nginx.cert_file)  }}

- name: fix key perms
  file: path={{ item }} mode=600
  with_items:
    - "{{ nginx_cert_file | default(nginx.cert_file) }}"
    - "{{ nginx_key_file | default(nginx.key_file) }}"

- name: copy nginx config file
  template: src=templates/centos/nginx.conf.j2 dest=/etc/nginx/nginx.conf
  when: ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat'

- name: copy nginx config file
  template: src=templates/ubuntu/nginx.conf.j2 dest=/etc/nginx/sites-enabled/default
  when: ansible_distribution == 'Ubuntu'

- name: restart nginx
  service: name=nginx state=restarted daemon_reload=yes enabled=yes<commit_msg>skip nginx restart when DOCKER_BUILD is set (#41)<commit_after>---
- name: install nginx
  apt: state=latest pkg=nginx
  when: ansible_distribution == 'Ubuntu'

- name: install nginx
  yum: state=latest pkg=nginx
  when: ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat'

- name: create directories for ssl certificiates
  file: path=/etc/nginx/ssl state=directory

- name: generate TLS key
  command:
    openssl req -subj
    '/C={{ nginx_country | default(nginx.country) }}/ST={{ nginx_state | default(nginx.state) }}/L={{ nginx_city | default(nginx.city) }}/O={{ nginx_org | default(nginx.org) }}/CN={{ nginx_cn | default(nginx.cn) }}'
    -x509 -nodes -days {{ nginx_days | default(nginx.days) }} -newkey rsa:{{ nginx_rsa | default(nginx.rsa) }} -keyout {{ nginx_key_file | default(nginx.key_file) }}
    -out {{ nginx_cert_file | default(nginx.cert_file)  }}

- name: fix key perms
  file: path={{ item }} mode=600
  with_items:
    - "{{ nginx_cert_file | default(nginx.cert_file) }}"
    - "{{ nginx_key_file | default(nginx.key_file) }}"

- name: copy nginx config file
  template: src=templates/centos/nginx.conf.j2 dest=/etc/nginx/nginx.conf
  when: ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat'

- name: copy nginx config file
  template: src=templates/ubuntu/nginx.conf.j2 dest=/etc/nginx/sites-enabled/default
  when: ansible_distribution == 'Ubuntu'

- name: restart nginx
  service: name=nginx state=restarted daemon_reload=yes enabled=yes
  when: DOCKER_BUILD is undefined or DOCKER_BUILD == 'no'
{'fraction_non_alphanumeric': 0.14389920424403183, 'fraction_numerical': 0.005968169761273209, 'mean_word_length': 4.445848375451264, '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': '7119385', 'n_tokens_mistral': 1163, 'n_tokens_neox': 1082, 'n_words': 243}