Difference between "command" or specific module execution in Ansible
<p>I'm starting with Ansible, and I found that there is a module called <code>command</code> which lets me execute any command in a remote node.</p>

<p>I saw a couple of example where initial setups are solved by using <code>command</code> instead of specific modules. For example, as far as I know, both of these do the same task:</p>

<pre><code>- name: Install git using apt module
  apt:
    name: git
    state: present

- name: Install git using command
  command: apt-get install git
</code></pre>

<p>So, my question is: <strong>is there any difference or any reason to use a module instead of command?</strong></p>