---
- name: Initialise the ansible enviorment
  hosts: all
  gather_facts: False
  pre_tasks:
    - name: Gathering the system information
      raw: lsb_release -s -i
      register: os_name
      changed_when: false

    - name: If the remote host is not an Ubuntu system, break the execution
      fail:
        msg: "The remote host is not an Ubuntu System. This program does not support."
      when: "'Ubuntu' not in os_name.stdout"

    - name: Install python for Ansible
      raw: test -e /usr/bin/python || (apt -y update && apt install -y python-simplejson)
      changed_when: False

- name: Set up the development system by vagrant ansible provision
  hosts: all
  pre_tasks:
    - name: Determine if the custom variables path exists
      stat:
        path: vars
      register: include_vars_path

    - name: Import the custom variables that are defined in .json, .jsn, .yaml, .yml
      include_vars:
        dir: 'vars'
        depth: 2
        extensions:
          - yaml
          - yml
          - json
          - jsn
      when: include_vars_path.stat.isdir is defined and include_vars_path.stat.isdir

    - name: Set variable of the path for temporary uploads files
      set_fact:
        temp_file_path: "{{ ansible_env.HOME }}/packages"

    - name: Make directory under the ansible home directory for temporary uploads files
      file:
        path: "{{ temp_file_path }}"
        state: directory
        mode: 0755
  roles:
    - base
    - development

---
- name: Initialise the ansible enviorment
  hosts: all
  gather_facts: False
  pre_tasks:
    - name: Gathering the system information
      raw: lsb_release -s -i
      register: os_name
      changed_when: false

    - name: If the remote host is not an Ubuntu system, break the execution
      fail:
        msg: "The remote host is not an Ubuntu System. This program does not support."
      when: "'Ubuntu' not in os_name.stdout"

    - name: Install python for Ansible
      raw: test -e /usr/bin/python || (apt -y update && apt install -y python-simplejson)
      changed_when: False

- name: Set up the development system by vagrant ansible provision
  hosts: all
  pre_tasks:
    - name: Determine if the custom variables path exists
      local_action: stat path=vars
      become: false
      register: include_vars_path

    - name: Import the custom variables that are defined in .json, .jsn, .yaml, .yml
      include_vars:
        dir: 'vars'
        depth: 2
        extensions:
          - yaml
          - yml
          - json
          - jsn
      when: include_vars_path.stat.isdir is defined and include_vars_path.stat.isdir

    - name: Set variable of the path for temporary uploads files
      set_fact:
        temp_file_path: "{{ ansible_env.HOME }}/packages"

    - name: Make directory under the ansible home directory for temporary uploads files
      file:
        path: "{{ temp_file_path }}"
        state: directory
        mode: 0755
  roles:
    - base
    - development

Fix the bug of checking customation variables
Fix the bug of checking customation variables

