<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Feature Request</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">ansible 1.6.5</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">My situation is that I have a Mac OS X 10.9 machine which I am running Ansible from.  I want to manage Ubuntu 12.04 hosts.</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">Forgive me if this is a duplicate (I find it hard to imagine I'm the first to encounter this) but I have spent a lot of time searching for an answer.</p>
<p dir="auto">My situation is that I have a Mac OS X 10.9 machine which I am running Ansible from.  I want to manage Ubuntu hosts, ergo they require apt.  I'm unable to find out how to install the python-apt or aptitude modules on my Mac, which of course means I cannot do rudimentary package management on the remote Ubuntu hosts, which ultimately means I'm unable to use Ansible to provision my systems.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">N/A - Self explanatory.</p>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">Expected to be able to use apt: related modules in playbooks.</p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">Apparently unable to use apt module from a Mac OS X machine when managing Ubuntu machines.</p>
<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Bug Report</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">ansible 1.6.1</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Mac OSX</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">If we have a hosts file:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[service1]
www.host1.com

[service2]
www.host1.com"><pre class="notranslate"><code class="notranslate">[service1]
www.host1.com

[service2]
www.host1.com
</code></pre></div>
<p dir="auto">and we have these group_vars:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="group_vars/service1:
    database_host: &quot;www.database.com&quot;
    database_port:  3306

group_vars/service2:
    database_host: &quot;www.differentdatabase.com&quot;
    database_port:  3306"><pre class="notranslate"><code class="notranslate">group_vars/service1:
    database_host: "www.database.com"
    database_port:  3306

group_vars/service2:
    database_host: "www.differentdatabase.com"
    database_port:  3306
</code></pre></div>
<p dir="auto">and we are running this playbook:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- hosts: service1
  remote_user: root"><pre class="notranslate"><code class="notranslate">- hosts: service1
  remote_user: root
</code></pre></div>
<p dir="auto">the variables from group_vars/service1 and group_vars/service2 overwrite each other if we're deploying to the same server. This means service1 will get service2 groups variables and get the incorrect database host and port.</p>
<p dir="auto">to get around these, we've added DNS entries (aliases to <a href="http://www.host1-service.com" rel="nofollow">www.host1-service.com</a>) so our host looks like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[service1]
www.host1-service1.com

[service2]
www.host1-service2.com"><pre class="notranslate"><code class="notranslate">[service1]
www.host1-service1.com

[service2]
www.host1-service2.com
</code></pre></div>
<p dir="auto">but this is highly error prone and is not ideal. What are some different methods to getting around this issue? (or misunderstanding of group_vars)</p>
<p dir="auto">The way I'm doing multi environmental deployments is like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="inventory/stage/hosts
inventory/stage/group_vars/
inventory/stage/group_vars/service1
inventory/stage/group_vars/service2

inventory/live/hosts
inventory/live/group_vars/
inventory/live/group_vars/service1
inventory/live/group_vars/service2"><pre class="notranslate"><code class="notranslate">inventory/stage/hosts
inventory/stage/group_vars/
inventory/stage/group_vars/service1
inventory/stage/group_vars/service2

inventory/live/hosts
inventory/live/group_vars/
inventory/live/group_vars/service1
inventory/live/group_vars/service2
</code></pre></div>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">Summary describes how to reproduce this.</p>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">group_vars should not be overwritten by another group when sharing the same host</p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">group_vars are overwritten by another group when sharing the same host</p>