Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # vim: ft=ansible
- #
- # usage:
- #
- # ansible-playbook -i <path/to/inventory> update_hosts.yml --ask-become-pass
- #
- #
- - hosts: all
- gather_facts: no
- sudo: yes
- connection: local
- tasks:
- - name: "Build hosts file"
- lineinfile:
- dest: /etc/hosts
- regexp: '.*{{ inventory_hostname }}$'
- line: "{{ ansible_ssh_host }} {{ inventory_hostname }}"
- state: present
- delegate_to: localhost
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement