diff --git a/cloudera_rm_mngr.rax.sh b/cloudera_rm_mngr.rax.sh new file mode 100755 index 0000000..f0e5794 --- /dev/null +++ b/cloudera_rm_mngr.rax.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +export RAX_CREDS_FILE=$(grep rax_credentials_file playbooks/group_vars/all|cut -d"'" -f2) +export RAX_REGION=$(grep rax_region playbooks/group_vars/all|cut -d"'" -f2) + +ansible-playbook -vvv -i inventory/rax.py playbooks/remove_cloudera.yml diff --git a/playbooks/remove_cloudera.yml b/playbooks/remove_cloudera.yml new file mode 100644 index 0000000..fb9cbab --- /dev/null +++ b/playbooks/remove_cloudera.yml @@ -0,0 +1,40 @@ +--- +- include: create_groups.yml + +- name: "remove clouder-agent role to all nodes" + hosts: hadoop-cluster + any_errors_fatal: true + become: yes + pre_tasks: + - name: "Show hadoop-cluster info" + debug: var="{{ hostvars[inventory_hostname] }}" + when: debug + tasks: + - name: "remove agent" + yum: name='cloudera-manager-agent' state=removed + +- name: "drop scm mysql mysql db on master nodes" + hosts: master-nodes + any_errors_fatal: true + become: yes + pre_tasks: + - name: "Show cluster info" + debug: var="{{ hostvars[inventory_hostname] }}" + when: debug + tasks: + - name: 'remove scm db from master nodes' + mysql_db: name='scm' state=absent + +- name: "remove cloudera-mngr role to cm-node group" + hosts: cm-node + become: yes + pre_tasks: + - name: "Show cluster info" + debug: var="{{ hostvars[inventory_hostname] }}" + when: debug + tasks: + - name: "remove cloudera manager" + yum: name={{ item }} state=removed + with_items: + - cloudera-manager-server + - cloudera-manager-daemons