Skip to content

Instantly share code, notes, and snippets.

@yuuichi-fujioka
Created July 14, 2014 06:45
Show Gist options
  • Save yuuichi-fujioka/9f90d3952c5a40c6a17e to your computer and use it in GitHub Desktop.
Save yuuichi-fujioka/9f90d3952c5a40c6a17e to your computer and use it in GitHub Desktop.
enforce hsotname by inventory
---
- name: set hostname
hostname: name={{inventory_hostname}}
- name: set hostname to hosts
lineinfile: dest=/etc/hosts regexp='.*127.0.1.1.*' line='127.0.1.1 {{inventory_hostname}}' state=present
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment