そんで、$ ansible-playbook site.yml で role を呼び出している
---
- name: Gitlab Server
hosts: gitlab
become: yes
vars_files:
- proxy.yml
environment: "{{ proxy_env }}"
roles:
- common
- { role: postgres, db_name: gitlab, db_passwd: "{{ db_passwd_gitlab }}" }
- gitlab
- name: Redmine Server
hosts: redmine
become: yes
vars_files:
- proxy.yml
environment: "{{ proxy_env }}"
roles:
- common
- ruby
- { role: postgres, db_name: redmine, db_passwd: "{{ db_passwd_redmine }}" }
- redmine
- passenger
Postgresql に作る database のユーザ名とパスワードを site.yml から与えるようにして postgres role を共通化したのね。オレって賢い!