<commit_before>---
- name: Register information about the /vagrant directory.
  stat:
    path: /vagrant
  register: vagrant_directory

- name: Create or restore site database
  include: mysql.yml
  when: wp_mysql_enable

- name: Ensure that installation directory exists
  file:
    path: "{{wp_install_dir}}"
    state: directory

- name: Deploy WordPress if configured.
  include: tasks/deploy.yml
  when: wp_deploy

- name: Get information about index.php.
  stat:
    path: "{{ wp_install_dir }}/index.php"
  register: index_file

- name: Define wordpress_site_exists.
  set_fact:
    wordpress_site_exists: "{{ index_file.stat.exists|default(false) }}"

- name: Download WordPress if configured.
  include: tasks/download-wordpress.yml
  when: install_wordpress | default(False) and not wordpress_site_exists

- name: Install WordPress site if configured.
  include: tasks/install-site.yml
  when: wp_install_site

- name: Fetch random salts for wp-config.php
  command: curl https://api.wordpress.org/secret-key/1.1/salt/
  register: 'wp_salt'

- name: Copy wp-config.php file
  template:
    src: wp-config.php.j2
    dest: "{{wp_install_dir}}/wp-config.php"

- name: Change ownership of installation directory
  file:
    path: "{{wp_install_dir}}"
    owner: "{{ (vagrant_directory.stat.gr_name == 'vagrant_group') | ternary(omit, wp_core_owner) }}"
    group: "{{ (vagrant_directory.stat.gr_name == 'vagrant_group') | ternary(omit, wp_core_owner) }}"
    mode: 0775
    state: directory
    recurse: yes

- name: Change ownership of uploads directory
  file:
    path: "{{wp_install_dir}}/wp-content/uploads/"
    owner: "{{ (vagrant_directory.stat.gr_name == 'vagrant_group') | ternary(omit, wp_core_owner) }}"
    group: "{{ (vagrant_directory.stat.gr_name == 'vagrant_group') | ternary(omit, drupalvm_webserver_user) }}"
    state: directory
    recurse: yes

- name: Install dummy data if configured.
  include: tasks/install-dummy-data.yml
  when: wp_install_dummy_data<commit_msg>Update `kentr.wordpress`<commit_after>---
- name: Register information about the /vagrant directory.
  stat:
    path: /vagrant
  register: vagrant_directory

- name: Create or restore site database
  include: mysql.yml
  when: wp_mysql_enable

- name: Ensure that installation directory exists
  file:
    path: "{{wp_install_dir}}"
    state: directory

- name: Deploy WordPress if configured.
  include: tasks/deploy.yml
  when: wp_deploy

- name: Get information about index.php.
  stat:
    path: "{{ wp_install_dir }}/index.php"
  register: index_file

- name: Define wordpress_site_exists.
  set_fact:
    wordpress_site_exists: "{{ index_file.stat.exists|default(false) }}"

- name: Download WordPress if configured.
  include: tasks/download-wordpress.yml
  when: install_wordpress | default(False) and not wordpress_site_exists

- name: Fetch random salts for wp-config.php
  command: curl https://api.wordpress.org/secret-key/1.1/salt/
  register: 'wp_salt'

- name: Copy wp-config.php file
  template:
    src: wp-config.php.j2
    dest: "{{wp_install_dir}}/wp-config.php"

- name: Change ownership of installation directory
  file:
    path: "{{wp_install_dir}}"
    owner: "{{ (vagrant_directory.stat.gr_name == 'vagrant_group') | ternary(omit, wp_core_owner) }}"
    group: "{{ (vagrant_directory.stat.gr_name == 'vagrant_group') | ternary(omit, wp_core_owner) }}"
    mode: 0775
    state: directory
    recurse: yes

- name: Change ownership of uploads directory
  file:
    path: "{{wp_install_dir}}/wp-content/uploads/"
    owner: "{{ (vagrant_directory.stat.gr_name == 'vagrant_group') | ternary(omit, wp_core_owner) }}"
    group: "{{ (vagrant_directory.stat.gr_name == 'vagrant_group') | ternary(omit, drupalvm_webserver_user) }}"
    state: directory
    recurse: yes

- name: Install WordPress site if configured.
  include: tasks/install-site.yml
  when: wp_install_site

- name: Install dummy data if configured.
  include: tasks/install-dummy-data.yml
  when: wp_install_dummy_data
{'fraction_non_alphanumeric': 0.12009987515605493, 'fraction_numerical': 0.003495630461922597, 'mean_word_length': 4.064475347661189, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '819523', 'n_tokens_mistral': 1388, 'n_tokens_neox': 1337, 'n_words': 322}