Skip to content

Instantly share code, notes, and snippets.

@tridevgurung
Created January 7, 2015 06:01
Show Gist options
  • Save tridevgurung/67116488ad1af803c80d to your computer and use it in GitHub Desktop.
Save tridevgurung/67116488ad1af803c80d to your computer and use it in GitHub Desktop.
Ansible yml playbook to change all the hosts present in servers to /22
- hosts:
servers
user: user
sudo: yes
port: 2020
gather_facts: false
tasks:
- name: Change subnet into /22
lineinfile: dest=/etc/network/interfaces regexp='netmask 255.255.254.0' line='netmask 255.255.252.0'
- name: Restarting networking service
command: /etc/init.d/networking restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment