F.e. I created two roles via "ansible-galaxy init": deploy_back and deploy_front
Also I wrote a playbook.yml file.
- name: Create cluster become: yes hosts: all roles: - deploy_front - deploy_back
If I launch it via "ansible-playbook playbook.yml" - then on both servers gonna be deployed two roles. How can I deploy different roles on different servers in one playbook?
If I write playbook.yml
- name: Create cluster become: yes hosts: front roles: - deploy_front hosts: db roles: - deploy_db
then outputs looks like "...found a duplicate dict key (hosts)... found a duplicate dict key (roles).... Using last defined value only."