---
- hosts: webserver
become: true
tasks:
- name: install web components
apt: name={{item}} state=present update_cache=yes
with_items:
- apache2
- name: copy apache virtual hosts config
copy: src=demo/demo.conf dest=/etc/apache2/sites-available mode=0755
notify: restart apache2
I'm trying to, on copying demo.conf
to the first host, rename as demo1.conf
and on copying to second host it should be rename as demo2.conf
and so on.
Or can it be renamed as demo{hostname}.conf
?
What are some insights on this particular use case?