<commit_before># Include sugarcrm specific configuration
- include_vars: "{{ item }}"
  with_items:
    - sugarcrm.yml
    - version.yml
  tags:
    - configuration
    - update

- include_vars: 'uat.yml'
  when: maestrano_environment == 'uat'
  tags:
    - configuration
    - update

- include_vars: 'production.yml'
  when: maestrano_environment == 'production'
  tags:
    - configuration
    - update

- include_vars: 'local.yml'
  when: maestrano_environment == 'local'
  tags:
    - configuration
    - update

- name: General | Install Application packages
  apt: "name={{ item }} state=present"
  with_items:
    - git
    - curl

- name: SugarCRM | Ensure MySQL is running
  command: service mysql start
  ignore_errors: yes
  tags:
    - configuration

- name: SugarCRM | Create SugarCRM database
  mysql_db:
    login_user: root
    login_password: "{{ <PASSWORD> }}"
    db: "{{ sugarcrm_db_name }}"
    state: present

- name: SugarCRM | Create SugarCRM database user
  mysql_user:
    name: "{{ sugarcrm_db_user }}"
    password: "{{ <PASSWORD> }}"
    priv: "{{ sugarcrm_db_name }}.*:ALL,GRANT"
    state: present
    login_user: root
    login_password: "{{ <PASSWORD> }}"

- name: SugarCRM | Download application from Github
  sudo: false
  git:
    repo: "https://github.com/{{ application_repository }}/sugarcrm.git"
    dest: "{{ sugarcrm_root_path }}"
    version: "{{ application_version }}"
    accept_hostkey: yes
    ssh_opts: "-o StrictHostKeyChecking=no"
    update: yes
    force: yes
  tags:
    - update

- name: SugarCRM | Current commit hash
  shell: 'git log -n 1 --pretty=format:"%H" > {{ sugarcrm_root_path }}/.git-version'
  args:
    chdir: "{{ sugarcrm_root_path }}"
  tags:
    - update

- name: Git | Ignore files permissions changes
  command: "git config core.filemode false chdir={{ sugarcrm_root_path }}"
  tags:
    - update

- name: Ansible | Update scripts
  copy:
    src: "{{ sugarcrm_root_path }}/deploy/ansible"
    dest: /etc/
  tags:
    - update

- name: SugarCRM | Configure Apache virtual host
  template: 
    src: etc-apache24-confd-sugarcrm-conf
    dest: /etc/apache2/sites-available/sugarcrm.conf
    owner: root
    mode: 755

- name: SugarCRM | Enable Apache virtual host 
  file: src=/etc/apache2/sites-available/sugarcrm.conf dest=/etc/apache2/sites-enabled/sugarcrm.conf state=link

- name: Apache | Restart the Apache service
  service: 
    name: apache2 
    state: restarted

- name: SugarCRM | Set file permissions
  file:
    path: "{{ sugarcrm_root_path }}"
    mode: 0755
    owner: www-data
    group: www-data
    state: directory
    recurse: yes
  tags:
    - configuration
<commit_msg>tag "enable apache virtual host" as configuration task<commit_after># Include sugarcrm specific configuration
- include_vars: "{{ item }}"
  with_items:
    - sugarcrm.yml
    - version.yml
  tags:
    - configuration
    - update

- include_vars: 'uat.yml'
  when: maestrano_environment == 'uat'
  tags:
    - configuration
    - update

- include_vars: 'production.yml'
  when: maestrano_environment == 'production'
  tags:
    - configuration
    - update

- include_vars: 'local.yml'
  when: maestrano_environment == 'local'
  tags:
    - configuration
    - update

- name: General | Install Application packages
  apt: "name={{ item }} state=present"
  with_items:
    - git
    - curl

- name: SugarCRM | Ensure MySQL is running
  command: service mysql start
  ignore_errors: yes
  tags:
    - configuration

- name: SugarCRM | Create SugarCRM database
  mysql_db:
    login_user: root
    login_password: "{{ <PASSWORD> }}"
    db: "{{ sugarcrm_db_name }}"
    state: present

- name: SugarCRM | Create SugarCRM database user
  mysql_user:
    name: "{{ sugarcrm_db_user }}"
    password: "{{ <PASSWORD> }}"
    priv: "{{ sugarcrm_db_name }}.*:ALL,GRANT"
    state: present
    login_user: root
    login_password: "{{ <PASSWORD> }}"

- name: SugarCRM | Download application from Github
  sudo: false
  git:
    repo: "https://github.com/{{ application_repository }}/sugarcrm.git"
    dest: "{{ sugarcrm_root_path }}"
    version: "{{ application_version }}"
    accept_hostkey: yes
    ssh_opts: "-o StrictHostKeyChecking=no"
    update: yes
    force: yes
  tags:
    - update

- name: SugarCRM | Current commit hash
  shell: 'git log -n 1 --pretty=format:"%H" > {{ sugarcrm_root_path }}/.git-version'
  args:
    chdir: "{{ sugarcrm_root_path }}"
  tags:
    - update

- name: Git | Ignore files permissions changes
  command: "git config core.filemode false chdir={{ sugarcrm_root_path }}"
  tags:
    - update

- name: Ansible | Update scripts
  copy:
    src: "{{ sugarcrm_root_path }}/deploy/ansible"
    dest: /etc/
  tags:
    - update

- name: SugarCRM | Configure Apache virtual host
  template: 
    src: etc-apache24-confd-sugarcrm-conf
    dest: /etc/apache2/sites-available/sugarcrm.conf
    owner: root
    mode: 755
  tags:
    - configuration

- name: SugarCRM | Enable Apache virtual host 
  file: src=/etc/apache2/sites-available/sugarcrm.conf dest=/etc/apache2/sites-enabled/sugarcrm.conf state=link

- name: Apache | Restart the Apache service
  service: 
    name: apache2 
    state: restarted

- name: SugarCRM | Set file permissions
  file:
    path: "{{ sugarcrm_root_path }}"
    mode: 0755
    owner: www-data
    group: www-data
    state: directory
    recurse: yes
  tags:
    - configuration

{'fraction_non_alphanumeric': 0.11742915354695314, 'fraction_numerical': 0.0051861455825152804, 'mean_word_length': 3.023845007451565, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4327665', 'n_tokens_mistral': 1883, 'n_tokens_neox': 1827, 'n_words': 461}