role dependencies and variables

Hello

I want to create meta role to setup web site configuration nginx + php-fpm

playbook client.yml:

  • roles:

  • { role: web-site, sites: 'domain.com, domain1.com’, fpm_pool: ‘domain’ }

  • { role: web-site, sites: ‘site.com, site1.com’, fpm_pool: ‘site’, www_dir: ‘web’, memory_limit: ‘128MB’ }

role/web-site/meta/main.yml:

allow_duplicates: yes

dependencies:

  • { role: php-fpm, pool: “{{ fpm_pool }}” }

role/php-fpm/

I include web-site role twice but role php-fpm invoked only once . Why ? and how can i invoke php-fpm role twice ?

Add the following to roles/php-fpm/meta/main.yml and that role will be invoked for each dependency

allow_duplicates: yes

Thanks. It’s working now.