Issue 1:
ISSUE TYPE

Bug Report

ANSIBLE VERSION

ansible 2.1.0.0

CONFIGURATION

[defaults]
hostfile = hosts
roles_path = ./roles:./external_roles
transport = ssh
hash_behaviour = merge
retry_files_enabled = False

[ssh_connection]
ssh_args = -o ForwardAgent=yes
scp_if_ssh = True
control_path = ~/.ssh/mux-%%r@%%h:%%p

OS / ENVIRONMENT

CentOS Linux release 7.2.1511

SUMMARY

While running long provisioning playbooks on localhost (-c local, not tested on remote) with this version of ansible it hangs forever in different places (usually hags on stat, template file link|absent modules, although there are also other modules).

when looking into that machine I got strange errors:

ABRT has detected 2 problem(s). For more info run: abrt-cli list --since 1469104014`

# abrt-cli list
id e89d19d057aae4b747282a38f0dcfa4cecbf0ccf
reason: systemd-logind killed by SIGABRT
time: Thu Jul 21 12:30:05 2016
cmdline: /usr/lib/systemd/systemd-logind
package: systemd-208-11.el7_0.6
uid: 0 (root)
count: 1
Directory: /var/spool/abrt/ccpp-2016-07-21-12:30:05-608

id 6c1edc19fab7dec6dc2a3873dcba243dc6d4be12
reason: systemd-journald killed by SIGABRT
time: Thu Jul 21 12:30:05 2016
cmdline: /usr/lib/systemd/systemd-journald
package: systemd-208-11.el7_0.6
uid: 0 (root)
count: 1
Directory: /var/spool/abrt/ccpp-2016-07-21-12:30:05-355

thsese are in systemctl

<E2><97><8F> kdump.service loaded failed failed Crash recovery kernel arming
<E2><97><8F> rightimage.service loaded failed failed LSB: RightLink agent updater
<E2><97><8F> rightlink.service loaded failed failed LSB: RightLink agent
<E2><97><8F> rightscale.service loaded failed failed LSB: RightScale startup

a part of dmesg:

[ 893.387473] ansible-playboo[5172]: segfault at 4e40bc000095 ip 00007f7ec189c258 sp 00007f7eb705c990 error 4 in libpython2.7.so.1.0[7f7ec178d000+178000]
[ 893.408028] abrt-hook-ccpp[5173]: segfault at 0 ip 00007f39920e753b sp 00007fffb1f06b30 error 4 in libreport.so.0.0.1[7f39920d9000+25000]
[ 893.414979] Process 5173(abrt-hook-ccpp) has RLIMIT_CORE set to 1
[ 893.418125] Aborting core

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

Default Variable management

ANSIBLE VERSION

ansible 2.4.0 (fix-aos-login-port 395d4d4c5b) last updated 2017/05/09 08:59:20 (GMT -700)
config file = /Users/damien/projects/cloudlabs-topologies/two-tier-arista-l3/ansible.cfg
configured module search path = [u'/Users/damien/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /Users/damien/projects/ansible/lib/ansible
executable location = /Users/damien/projects/ansible/bin/ansible
python version = 2.7.10 (default, Feb 6 2017, 23:53:20) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]

CONFIGURATION

OS / ENVIRONMENT

Mac OS 10.12.4

SUMMARY

When using multiple inventory files, saved in the directory inventory/, variables stored in host_vars/<inventory_hostname>/xxx.yaml are not loaded.

Assuming we have 4 devices, defined in 2 inventories files:

project/
inventory/
inv1
host_ccc id=11
host_ddd id=12
inv2
host_aaa id=1
host_bbb id=2
host_vars/
host_aaa/
fqdn.yaml `myvar: this is my var`
host_bbb.yaml `myvar: this is my var`

When I'm running a playbook just on 1 device host_ccc (using limit) the variable from host_aaa > hostvars['host_aaa'].myvar` is undefined

if I merge my inventories files (inv1 and inv2) into a single file, the same variable hostvars['host_aaa'].myvar exist for host_ccc

I clearly have a different behavior with 1 or 2 inventory files

STEPS TO REPRODUCE

Create a host_vars directory and create some variable file for 3 hosts

Create a inventory directory and create 2 inventories files, with 2 hosts each

Create another inventory with the same content as both previous inventory files combined

Create a playbook to show variables defined inside host_vars for each host

├── host_vars
│ ├── host_aaa
│ │ └── var.yaml
│ ├── host_bbb.yaml
│ └── host_ccc.yaml
├── inventory
│ ├── inv1
│ └── inv2
├── inventory.ini
└── pb.show_var.yaml

# pb.show_var.yaml
- name: Print Variables
hosts: all
gather_facts: no
connection: local
tasks:
- name: Variables for dev_aaa
debug: var=hostvars['host_aaa'].myvar

- name: Variables for dev_bbb
debug: var=hostvars['host_bbb'].myvar

- name: Variables for dev_ccc (self)
debug: var=myvar

# Inventory
host_aaa id=1
host_bbb id=2
host_ccc id=11
host_ddd id=12

EXPECTED RESULTS

Variables from host_aaa and host_bbb should be defined host_ccc when using multiple inventory files

ACTUAL RESULTS

(ansible-dev) ➜ ansible-bug-inventory-01 git:(master) ansible-playbook -i inventory pb.show_var.yaml --limit=host_ccc

PLAY [Print Variables] **********************************************************************************************

TASK [Variables for dev_aaa] **********************************************************************************************
ok: [host_ccc] => {
"hostvars['host_aaa'].myvar": "VARIABLE IS NOT DEFINED!" <<<<<
}

TASK [Variables for dev_bbb] **********************************************************************************************
ok: [host_ccc] => {
"hostvars['host_bbb'].myvar": "VARIABLE IS NOT DEFINED!" <<<<<<
}

TASK [Variables for dev_ccc (self)] **********************************************************************************************
ok: [host_ccc] => {
"myvar": "this is my var"
}

PLAY RECAP **********************************************************************************************
host_ccc : ok=3 changed=0 unreachable=0 failed=0

(ansible-dev) ➜ ansible-bug-inventory-01 ansible-playbook -i inventory.ini pb.show_var.yaml --limit=host_ccc

PLAY [Print Variables] *********************************************************************************************

TASK [Variables for dev_aaa] **********************************************************************************************
ok: [host_ccc] => {
"hostvars['host_aaa'].myvar": "this is my var"
}

TASK [Variables for dev_bbb] **********************************************************************************************
ok: [host_ccc] => {
"hostvars['host_bbb'].myvar": "this is my var"
}

TASK [Variables for dev_ccc (self)] **********************************************************************************************
ok: [host_ccc] => {
"myvar": "this is my var"
}

PLAY RECAP **********************************************************************************************
host_ccc : ok=3 changed=0 unreachable=0 failed=0