CSC Ansible Playbooks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
ansible-playbooks/update-hosts.yml

13 lines
538 B

---
- hosts: all
remote_user: root
gather_facts: no
tasks:
- name: update hosts
connection: local
git: repo=~git/public/hosts.git dest=generate-hosts-{{ ansible_hostname }}
- name: generate hosts file
connection: local
shell: generate-hosts-{{ ansible_hostname }}/generate-hosts.py < generate-hosts-{{ ansible_hostname }}/hosts.in > generate-hosts-{{ ansible_hostname }}/hosts
- name: copy hosts file
copy: src=generate-hosts-{{ ansible_hostname }}/hosts dest=/etc/hosts backup=yes