Skip to content

Instantly share code, notes, and snippets.

View nitanka's full-sized avatar

Sanyasi nitanka

  • Banglore
View GitHub Profile
@nitanka
nitanka / clearcache.yml
Created August 14, 2017 06:49
Ansible: To clear cache of servers
- name: Installing HADOOP CLUSTER
hosts: <hostgroup>
become: yes
gather_facts: true
tasks:
- name: Clearing the cache
shell: sync; echo 3 > /proc/sys/vm/drop_caches
@nitanka
nitanka / addhosts.yml
Created August 14, 2017 06:44
Ansible: adding hosts to /etc/hosts from inventory file
name: host mapping /etc/hosts of server
hosts: <hostgroup>
become: true
tasks:
- name: adding hostname mapping /etc/hosts
lineinfile:
dest: /etc/hosts
insertbefore: '^127.0.0.1'
line: '{{ item.0 }} {{ item.1 }}'
with_together: