ansible/ansible — pull request #5711 by sivel (2014-01-21 19:07:17+00:00)
Title: Use realpath for plugin directories instead of abspath

Imagine the following "simplified" directory structure:

```
.
├── callback_plugins
│ └── someplugin.py
├── playbooks
│ ├── callback_plugins -> ../callback_plugins
│ └── someapp.yml
└── site.yml
```

We have a scenario where playbooks exist both in the root and inside of the playbooks directory. We can either call site.yml which includes all playbooks inside of the playbooks directory, or an individual playbook in the playbooks directory.

Due to the possibility of running either site.yml or playbooks/someapp.yml we have our callback_plugins directory symlinked into playbooks. Having just 1 or the other doesn't meet all use cases.

Currently the symlink works fine, however when running site.yml, the callback plugin is run twice, due to not deduping the realpath, but using abspath.

We can potentially get around the issue by defining a callback_plugins option in ansible.cfg, but since we do not use a centralized control machine, and our ansible.cfg files vary based on user names and such, enforcing the configuration is troublesome.

This change, simply changes the instances of abspath to realpath, which resolves the duplicate directory problems, and the callback plugins are only executed once.

I'm sure there are also other ways to tackle this, but this seems more simple in the end.