Skip to content

Commit

Permalink
added remove cluster functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
grierdavid committed Mar 31, 2016
1 parent 64f44d9 commit 2b0f487
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cloudera_rm_mngr.rax.sh
Original file line number Diff line number Diff line change
@@ -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
40 changes: 40 additions & 0 deletions playbooks/remove_cloudera.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2b0f487

Please sign in to comment.