<commit_before>---
- name: install packages
  apt: pkg={{ item }} state=present update_cache=no
  with_items:
  - inotify-tools
  register: modcloth_app_install_packages

- name: write upstart conf
  template:
    src={{ modcloth_app_upstart_conf_template }}
    dest=/etc/init/{{ modcloth_app_name }}.conf
    owner=root group=root mode=0644
  when: modcloth_app_upstart_conf_template != ""
  register: modcloth_app_write_upstart_conf

- name: write etc default file
  template:
    src={{ modcloth_app_etc_default_template }}
    dest=/etc/default/{{ modcloth_app_name }}
    owner=root group=root mode=0644
  when: modcloth_app_etc_default_template != ""
  register: modcloth_app_write_etc_default_file

- name: docker login
  shell: docker login --email "{{ modcloth_app_docker_email }}" --username "{{ modcloth_app_docker_username }}" --password "{{ <PASSWORD>cloth_app_docker_password }}" "{{ modcloth_app_docker_registry }}" 
  when: modcloth_app_docker_email and 
        modcloth_app_docker_username and
        modcloth_app_docker_password and
        modcloth_app_docker_registry

- name: pull container
  docker_pull:
    repo={{ modcloth_app_docker_repo }}
    tag={{ modcloth_app_docker_tag }}
  when: modcloth_app_docker_repo != ""
  register: modcloth_app_pull_container

- name: stop app
  service: name={{ modcloth_app_name }} state=stopped
  when: modcloth_app_write_upstart_conf.changed or
        modcloth_app_write_etc_default_file.changed or
        modcloth_app_pull_container.changed

- name: start app
  service: name={{ modcloth_app_name }} state=started<commit_msg>Improtiving task conditional<commit_after>---
- name: install packages
  apt: pkg={{ item }} state=present update_cache=no
  with_items:
  - inotify-tools
  register: modcloth_app_install_packages

- name: write upstart conf
  template:
    src={{ modcloth_app_upstart_conf_template }}
    dest=/etc/init/{{ modcloth_app_name }}.conf
    owner=root group=root mode=0644
  when: modcloth_app_upstart_conf_template != ""
  register: modcloth_app_write_upstart_conf

- name: write etc default file
  template:
    src={{ modcloth_app_etc_default_template }}
    dest=/etc/default/{{ modcloth_app_name }}
    owner=root group=root mode=0644
  when: modcloth_app_etc_default_template != ""
  register: modcloth_app_write_etc_default_file

- name: docker login
  shell: docker login --email "{{ modcloth_app_docker_email }}" --username "{{ modcloth_app_docker_username }}" --password "{{ modcloth_app_docker_password }}" "{{ modcloth_app_docker_registry }}" 
  when: modcloth_app_docker_email is defined and
        modcloth_app_docker_username is defined and
        modcloth_app_docker_password is defined and
        modcloth_app_docker_registry

- name: pull container
  docker_pull:
    repo={{ modcloth_app_docker_repo }}
    tag={{ modcloth_app_docker_tag }}
  when: modcloth_app_docker_repo != ""
  register: modcloth_app_pull_container

- name: stop app
  service: name={{ modcloth_app_name }} state=stopped
  when: modcloth_app_write_upstart_conf.changed or
        modcloth_app_write_etc_default_file.changed or
        modcloth_app_pull_container.changed

- name: start app
  service: name={{ modcloth_app_name }} state=started
{'fraction_non_alphanumeric': 0.09113453192808431, 'fraction_numerical': 0.0049597024178549285, 'mean_word_length': 4.824909747292419, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '1821965', 'n_tokens_mistral': 1128, 'n_tokens_neox': 1041, 'n_words': 207}