Skip to content

Instantly share code, notes, and snippets.

@alexwoolford
Last active March 29, 2017 15:50
Show Gist options
  • Save alexwoolford/915911555d113a165a2ec917f7078483 to your computer and use it in GitHub Desktop.
Save alexwoolford/915911555d113a165a2ec917f7078483 to your computer and use it in GitHub Desktop.
---
# hdp_ansible_temp.yml
- hosts: hdp
user: root
tasks:
- name: update all the packages
yum: name=* state=latest
- name: disable selinux
selinux: state=disabled
- name: install ntpd
yum: name=ntp
state=installed
- name: enable ntpd
service: name=ntpd
state=running
enabled=yes
- name: disable firewalld
service: name=firewalld
state=stopped
enabled=no
- name: disable VM swappiness
lineinfile: dest=/etc/sysctl.conf
regexp='^vm.swappiness='
line='vm.swappiness=0'
- name: comment out all Centos servers
lineinfile: dest=/etc/ntp.conf
regexp='^server'
state=absent
- name: comment out all Centos servers
lineinfile: dest=/etc/ntp.conf
regexp='^server'
state=absent
- name: add new ntp server
lineinfile: dest=/etc/ntp.conf
insertafter='^# Please consider joining the pool'
line='server 10.218.70.124'
- name: add new ntp server
lineinfile: dest=/etc/ntp.conf
insertafter='^# Please consider joining the pool'
line='server 10.218.70.123'
- name: restart ntpd
service: name=ntpd
state=restarted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment