Override Ansible task parameters from role
Defining default value for ansible variables and overriding them via ansible playbooks can be achieved using Jinja2 templating.

- name: Create a new user
  user:
    name: "{{ username_variable | default('default_value') }}"
    password: "{{ password_variable | default('default_value') }}"
    state: present


Then if these variables are passed from the playbook it will be used, or else the default values.

  roles:
    - role: common
      vars:
        username_variable: "frank"
        password_variable: "/bib/zsh"