---
- hosts: kv:index:n1ql
  vars:
    couhcbase_home: /opt/couchbase
    data_dir: /data
    index_dir: /index
  tasks:
  - name: killing the processes
    shell: 'killall -I -g -q -s SIGKILL {{item}} || true'
    with_items:
      - epmd
      - beam.smp
      - cbq-engine
      - cbft
      - couch_view_index_updater
      - goport
      - goxdcr
      - java
      - indexer
      - memcached
      - moxi
      - mongod
      - mongos
      - mysqld
      - sync_gateway

  - name: uninstalling the database packages
    yum: state=absent name={{item}}
    with_items:
      - 'couchbase*'
      - 'mongodb*'
      - 'MariaDB*'

  - name: removing Couchbase Server files
    file: path={{ couhcbase_home }} state=absent

  - name: removing the files remaining in the "{{ data_dir }}" directory
    shell: rm -fr {{ data_dir }}/*

  - stat: path={{ index_dir }}
    register: index

  - name: removing the files remaining in the "{{ index_dir }}" directory
    shell: rm -fr {{ index_dir }}/*
    when: index.stat.exists

  - name: removing MySQL installation (if any)
    shell: rm -fr /var/lib/mysql

---
- hosts: kv:index:n1ql
  vars:
    couchbase_home: /opt/couchbase
    data_dir: /data
    index_dir: /index
  tasks:
  - name: killing the processes
    shell: 'killall -I -g -q -s SIGKILL {{item}} || true'
    with_items:
      - epmd
      - beam.smp
      - cbq-engine
      - cbft
      - couch_view_index_updater
      - goport
      - goxdcr
      - java
      - indexer
      - memcached
      - moxi
      - mongod
      - mongos
      - mysqld
      - sync_gateway

  - name: uninstalling the database packages
    yum: state=absent name={{item}}
    with_items:
      - 'couchbase*'
      - 'mongodb*'
      - 'MariaDB*'

  - name: removing Couchbase Server files
    file: path={{ couchbase_home }} state=absent

  - name: removing the files remaining in the "{{ data_dir }}" directory
    shell: rm -fr {{ data_dir }}/*

  - stat: path={{ index_dir }}
    register: index

  - name: removing the files remaining in the "{{ index_dir }}" directory
    shell: rm -fr {{ index_dir }}/*
    when: index.stat.exists

  - name: removing MySQL installation (if any)
    shell: rm -fr /var/lib/mysql

Fix typo in variable name
Fix typo in variable name

Change-Id: I97e9c0865529bd043d96efe41f517e0809588c1f
Reviewed-on: http://review.couchbase.org/87062
Tested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Pavel Paulau <dd88eded64e90046a680e3a6c0828ceb8fe8a0e7@gmail.com>
