<commit_before>---
- hosts: webservers

  sudo: yes

  tasks:

  - name: Write gunicorn config file
    template: src=assets/gunicorn.j2 dest=/etc/init/ecep.conf
    notify:
      - restart gunicorn

  - name: Write nginx config file
    template: src=assets/nginx.j2 dest=/etc/nginx/sites-available/ecep.conf
    notify:
      - restart nginx

  - name: Link nginx config to sites-enabled
    file: state=link src=/etc/nginx/sites-available/ecep.conf path=/etc/nginx/sites-enabled/ecep
    notify:
      - restart nginx

  - name: Remove default nginx config
    file: state=absent path=/etc/nginx/sites-enabled/default
    notify:
      - restart nginx

  handlers:
  - name: restart nginx
    action: service name=nginx state=restarted

  - name: restart gunicorn
    action: service name=ecep state=restarted<commit_msg>Create password from using apache htpasswd command<commit_after>---
- hosts: webservers

  sudo: yes

  tasks:

  - name: Write gunicorn config file
    template: src=assets/gunicorn.j2 dest=/etc/init/ecep.conf
    notify:
      - restart gunicorn

  - command: touch /etc/nginx/.htpasswd

  - name: Creating User/Password to sign into staging server
    command: htpasswd -b /etc/nginx/.htpasswd ${http_user} ${http_password}
    only_if: "'${http_password}' != '' and '${http_user}' != ''"

  - name: Write nginx config file
    template: src=assets/nginx.j2 dest=/etc/nginx/sites-available/ecep.conf
    notify:
      - restart nginx

  - name: Link nginx config to sites-enabled
    file: state=link src=/etc/nginx/sites-available/ecep.conf path=/etc/nginx/sites-enabled/ecep
    notify:
      - restart nginx

  - name: Remove default nginx config
    file: state=absent path=/etc/nginx/sites-enabled/default
    notify:
      - restart nginx

  handlers:
  - name: restart nginx
    action: service name=nginx state=restarted

  - name: restart gunicorn
    action: service name=ecep state=restarted
{'fraction_non_alphanumeric': 0.1057542768273717, 'fraction_numerical': 0.002073613271124935, 'mean_word_length': 2.987603305785124, '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': '3493969', 'n_tokens_mistral': 679, 'n_tokens_neox': 617, 'n_words': 160}