Please help to reduce number of lines in tasks

Hello All,

I think it could better. Basically, copy module is repeated based application and hostname the content changes
Could you please help me to reduce the number of lines in below tasks.

something like this?

- name: "Ensure file copied"
  copy:
    content: "PRODUCTION-A2-A10"
    dest: "{{alter_keystone_path}}/appname/environment.config"
    mode: 484
  when: app_name == "appname1" and ansible_hostname in ("server01",
"server06", "server10", "server14", "server17") or ansible_hostname in
("server02", "server03", "server04", "server05", "server07",
"server14", "server15", "server16", "server18", "server19')