Ansible script examples

EXAMPLE: Restart NTP daemon in Linux First create the playbook pbntprestart.yml as below and run using this command. The cdhservers is where you define all your hostnames. $ ansible-playbook pbntprestart.yml -u root -k The content of pbntprestart.yml  is below: $ cat pbntprestart.yml --- - hosts: cdhservers tasks: - name: NTPRESTART shell: service ntpd restart register: out1 … Continue reading Ansible script examples

Install Ansible on Windows 10 WSL-Ubuntu

Steps to install Ansible on Windows 10. First we need to enable Windows Subsystem for Linux (Beta) which is an Ubuntu linux on Windows. Complete the steps in this blog: https://plenium.wordpress.com/2017/11/21/install-linux-on-windows/   <<<NEXT STEPS>>> Install Ansible Latest Releases Via Apt (Ubuntu) To configure the PPA on your machine and install ansible run these commands: $ sudo … Continue reading Install Ansible on Windows 10 WSL-Ubuntu