Last active
March 29, 2017 15:50
-
-
Save alexwoolford/915911555d113a165a2ec917f7078483 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# 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