<commit_before>---

- name: install packages for OCP install
  package: name={{ item }} state=present
  with_items:
    - docker-1.13.1
    - container-selinux
    - atomic-openshift-docker-excluder
    - wget
    - git
    - net-tools
    - bind-utils
    - iptables-services
    - bridge-utils
    - bash-completion
    - kexec-tools
    - sos
    - psacct
    - NetworkManager
    - cri-o

- name: Build hosts file
  lineinfile:
    dest=/etc/hosts
    regexp='.*{{ item.key }}$' line="{{ item.value.address }} {{ item.key }}"
    state=present
  with_dict: "{{ virtual_machines }}"

- name: start NetworkManager
  service: name=NetworkManager state=started enabled=true

- name: Detect Docker storage configuration status
  command: grep -q overlay2 /etc/sysconfig/docker-storage
  register: docker_storage_test
  changed_when: false
  failed_when: false

- name: Wipe signatures from docker disk
  command: "wipefs --all --force /dev/vdb"
  when: docker_storage_test.rc != 0

- name: Create Docker storage configuration
  copy:
    dest: /etc/sysconfig/docker-storage-setup
    content: |
      STORAGE_DRIVER=overlay2
      DEVS=/dev/vdb
      CONTAINER_ROOT_LV_NAME=dockerlv
      CONTAINER_ROOT_LV_MOUNT_PATH=/var/lib/docker
      VG=ocp
      WIPE_SIGNATURES=true
  when: docker_storage_test.rc != 0

- name: Apply Docker storage configuration changes
  command: docker-storage-setup
  when: docker_storage_test.rc != 0

- name: Enable docker
  command: systemctl enable docker

- name: Start docker
  command: systemctl start docker<commit_msg>Fix failures due cruft from previous runs on docker storage disk.<commit_after>---

- name: install packages for OCP install
  package: name={{ item }} state=present
  with_items:
    - docker-1.13.1
    - container-selinux
    - atomic-openshift-docker-excluder
    - wget
    - git
    - net-tools
    - bind-utils
    - iptables-services
    - bridge-utils
    - bash-completion
    - kexec-tools
    - sos
    - psacct
    - NetworkManager
    - cri-o

- name: Build hosts file
  lineinfile:
    dest=/etc/hosts
    regexp='.*{{ item.key }}$' line="{{ item.value.address }} {{ item.key }}"
    state=present
  with_dict: "{{ virtual_machines }}"

- name: start NetworkManager
  service: name=NetworkManager state=started enabled=true

- name: Detect Docker storage configuration status
  command: grep -q overlay2 /etc/sysconfig/docker-storage
  register: docker_storage_test
  changed_when: false
  failed_when: false

# We need some extra wiping, see
# htttps://bugzilla.redhat.com/show_bug.cgi?id=1572266

- name: Wipe possible ghost PV from docker disk
  command: "pvremove -fy /dev/vdb1"
  ignore_errors: yes
  when: docker_storage_test.rc != 0

- name: Wipe the beginning of the disk from docker disk
  command: "dd if=/dev/zero of=/dev/vdb bs=1M count=4"
  when: docker_storage_test.rc != 0

- name: Create Docker storage configuration
  copy:
    dest: /etc/sysconfig/docker-storage-setup
    content: |
      STORAGE_DRIVER=overlay2
      DEVS=/dev/vdb
      CONTAINER_ROOT_LV_NAME=dockerlv
      CONTAINER_ROOT_LV_MOUNT_PATH=/var/lib/docker
      VG=ocp
      WIPE_SIGNATURES=true
  when: docker_storage_test.rc != 0

- name: Apply Docker storage configuration changes
  command: systemctl start docker-storage-setup
  when: docker_storage_test.rc != 0

- name: Enable docker
  command: systemctl enable docker

- name: Start docker
  command: systemctl start docker
{'fraction_non_alphanumeric': 0.09959231217239371, 'fraction_numerical': 0.00844496214327315, 'mean_word_length': 3.0795724465558196, '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': '750650', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1111, 'n_words': 284}