title: How to get value of --limit argument inside an Ansible playbook?
body: <p>In ansible, is it possible to get the value of the argument to the "--limit" option within a playbook? I want to do is something like this:</p>
  
  <pre><code>---
  - hosts: all
    remote user: root
    tasks:
    - name: The value of the --limit argument
      debug:
        msg: "argument of --limit is {{ ansible-limit-arg }}"
  </code></pre>
  
  <p>Then when I run he command:</p>
  
  <pre><code>$ ansible-playbook getLimitArg.yaml --limit webhosts
  </code></pre>
  
  <p>I'll get this output:</p>
  
  <pre><code>argument of --limit is webhost
  </code></pre>
  
  <p>Of course, I made up the name of the variable "ansible-limit-arg", but is there a valid way of doing this? I could specify "webhosts" twice, the second time with --extra-args, but that seems a roundabout way of having to do this.</p>