If it were my code, i'd probably instead of checking for the nagios user existing, check that the package is installed ( ie rpm -q and register output), or do a stat on the /usr/local/nagios/etc directory and copy the file if is exists.. its not a whole lot compact or cleaner than what you have, but it at least wont fail if for some reason you have a nagios user on a box, but dont have the directory structure in place such as your current code. In your example, if the nagios user is there, it assumes that the /usr/local/nagios/etc path exists as a landing pad for your nrpe.cfg file.
Since i dont know what is you install nrpe via a package manager, below is an example using stat to check for the etc directory
- name: Checking for existing nagios etc directory
stat:
path: "/usr/local/nagios/etc"
register: nag_dir
- name: Copy nrpe.cfg to client
copy:
src: /etc/ansible/masterfiles/nagios/nrpe.cfg
dest: /usr/local/nagios/etc/