Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

linode cloud module - modules/cloud/linode/linode.py

ANSIBLE VERSION

ansible 2.3.0.0
config file =
configured module search path = Default w/o overrides
python version = 2.7.13 (default, Apr 4 2017, 08:46:44) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]

OS / ENVIRONMENT

Master: Mac OS X El Capitan v10.11.6

Managing: Ubuntu 16.04 on Linode

Python: 2.7.13

SUMMARY

When trying to provision a linode with the linode module (using a playbook very similar to this one), I get an error:

Alert_cpu_threshold must be between 0 and 2000

STEPS TO REPRODUCE

Installed pycurl and linode-python via pip

Updated hosts file to set ansible_python_interpreter

Export LINODE_API_KEY

Attempt to provision linode with the following settings:

tasks:
- name: Linode | Create linode server via Linode API
linode:
name: test
plan: 1
datacenter: 7
distribution: 146
displaygroup: test
swap: 512
wait: yes
wait_timeout: 600
state: present
register: linode

Full example, including hosts file is available in this gist

Executed using ansible-playbook provision.yml -i hosts

If I update my task to include alert_cpu_threshold: 1000, I then get another error:

Alert_diskio_threshold must be between 0 and 100000

EXPECTED RESULTS

Expected result is that the task should return OK and continue on to the next task. Instead the error prevents the task & all subsequent tasks from running.

ACTUAL RESULTS

Not: a linode is created, but not fully provisioned as there is no disk.

PLAY [Provision new linode] **********************************************************************************************************************************************************************

TASK [Linode | Create linode server via Linode API] **********************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Alert_cpu_threshold must be between 0 and 2000."}
to retry, use: --limit @.../ansible/provision.retry

PLAY RECAP ***************************************************************************************************************************************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=1

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

script inventory plugin

ANSIBLE VERSION

ansible 2.4.0.0
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/florian/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0 20170118]

CONFIGURATION

ansible-config dump --only-changed comes back empty.

OS / ENVIRONMENT

Ubuntu 17.04

SUMMARY

If I run ansible-playbook with a static inventory (-i /path/to/hosts), and I use group_vars and host_vars directories relative to that inventory file (as opposed to relative to the playbook file, as documented here), then those variables get parsed correctly.

In Ansible 2.3, if I did the same with a dynamic inventory script (-i /path/to/some-script.py), the behavior would be identical.

In Ansible 2.4, that is no longer the case, and static and dynamic inventory behaves quite differently:

with -i /path/to/hosts, variables in /path/to/group_vars and /path/to/host_vars are correctly added to the inventory.

with -i /path/to/some-script.py, variables in /path/to/group_vars and /path/to/host_vars are ignored, and I need to symlink those directories into the playbook directory to be picked up.

I'm not sure what the correct behavior is, for Ansible 2.4, considering the move from inventory scripts to inventory plugins. But it would seem like static and dynamic inventory ought to behave identically with regard to variable parsing, as it was the case pre-2.4.