---
- hosts: all
  # Prevent error occurs before pre_tasks. (ex. Docker container isn't running.)
  gather_facts: no
  pre_tasks:
    - block:
      - name: Do pre-tasks for each connection type
        include: "pre_tasks/connection/{{ ansible_connection }}.yml"
      - name: "Gather fact information on target platform."
        setup:
      - name: Do pre-tasks for each OS family
        include: "pre_tasks/os/{{ ansible_os_family }}.yml"
      tags:
        - always
  roles:
    - role: FGtatsuro.python-requirements
      tags:
        - python
    - role: FGtatsuro.ruby
      tags:
        - wercker
    - role: FGtatsuro.ansible
      tags:
        - wercker
    - role: FGtatsuro.java
      tags:
        - wercker
  tasks:
    - name: Do tasks for each OS family
      include: "tasks/os/{{ ansible_os_family }}.yml"
      tags:
        - always
  post_tasks:
    - block:
      - name: Do post-tasks for each OS family
        include: "post_tasks/os/{{ ansible_os_family }}.yml"
      - name: Do post-tasks for connection type
        include: "post_tasks/connection/{{ ansible_connection }}.yml"
      tags:
        - always

---
- hosts: all
  # Prevent error occurs before pre_tasks. (ex. Docker container isn't running.)
  gather_facts: no
  pre_tasks:
    - block:
      - name: Do pre-tasks for each connection type
        include: "pre_tasks/connection/{{ ansible_connection }}.yml"
      - name: "Gather fact information on target platform."
        setup:
      - name: Do pre-tasks for each OS family
        include: "pre_tasks/os/{{ ansible_os_family }}.yml"
      tags:
        - always
  roles:
    - role: FGtatsuro.python-requirements
      tags:
        - python
    - role: FGtatsuro.ruby
      tags:
        - wercker
    - role: FGtatsuro.ansible
      tags:
        - wercker
    - role: FGtatsuro.java
      tags:
        - wercker
  tasks:
    - name: Do tasks for each OS family
      include: "tasks/os/{{ ansible_os_family }}.yml"
      tags:
        - always
    - name: Ensure /opt directory exists
      file:
        path: '/opt'
        owner: 'root'
        group: 'root'
        state: 'directory'
      become: yes
  post_tasks:
    - block:
      - name: Do post-tasks for each OS family
        include: "post_tasks/os/{{ ansible_os_family }}.yml"
      - name: Do post-tasks for connection type
        include: "post_tasks/connection/{{ ansible_connection }}.yml"
      tags:
        - always

Add a task to create opt directory.
Add a task to create opt directory.
