We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
False Positive ANSIBLE0014 does not allow command:args:stdin
# Issue Type
- Bug report

# Ansible and Ansible Lint details

```
ansible --version
ansible 2.4.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'$HOME/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug  2 2017, 11:05:32) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]

ansible-lint --version
ansible-lint 3.4.17
```

- ansible installation method: OS package
- ansible-lint installation method: pip

# Desired Behaviour

The `stdin` argument to the `command` module should not trigger the "Environment variables don't work as part of command" error.

# Actual Behaviour (Bug report only)

The EnvVarsInCommandRule (ANSIBLE0014) linter rule rejects the following playbook:

```
- hosts: localhost
  tasks:
    - command: /bin/cat
      args:
        stdin: "Hello, world!"
```

due to the presence of the `stdin` attribute which was added in Ansible 2.4. This appears to be because `stdin` is missing from `expected_args`.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `lib/ansiblelint/rules/EnvVarsInCommandRule.py`
Content:
```
1 # Copyright (c) 2016 Will Thames <will@thames.id.au>
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to deal
5 # in the Software without restriction, including without limitation the rights
6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 # copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
9 #
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
12 #
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 # THE SOFTWARE.
20 
21 from ansiblelint import AnsibleLintRule
22 from ansiblelint.utils import LINE_NUMBER_KEY, FILENAME_KEY
23 
24 
25 class EnvVarsInCommandRule(AnsibleLintRule):
26     id = 'ANSIBLE0014'
27     shortdesc = "Environment variables don't work as part of command"
28     description = 'Environment variables should be passed to shell or ' \
29                   'command through environment argument'
30     tags = ['bug']
31 
32     expected_args = ['chdir', 'creates', 'executable', 'removes', 'warn',
33                      'cmd', '__ansible_module__', '__ansible_arguments__',
34                      LINE_NUMBER_KEY, FILENAME_KEY]
35 
36     def matchtask(self, file, task):
37         if task["action"]["__ansible_module__"] in ['shell', 'command']:
38             if 'cmd' in task['action']:
39                 first_cmd_arg = task['action']['cmd'].split()[0]
40             else:
41                 first_cmd_arg = task['action']['__ansible_arguments__'][0]
42             return any([arg not in self.expected_args for arg in task['action']] +
43                        ["=" in first_cmd_arg])
44
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/lib/ansiblelint/rules/EnvVarsInCommandRule.py b/lib/ansiblelint/rules/EnvVarsInCommandRule.py
--- a/lib/ansiblelint/rules/EnvVarsInCommandRule.py
+++ b/lib/ansiblelint/rules/EnvVarsInCommandRule.py
@@ -29,7 +29,7 @@
                   'command through environment argument'
     tags = ['bug']
 
-    expected_args = ['chdir', 'creates', 'executable', 'removes', 'warn',
+    expected_args = ['chdir', 'creates', 'executable', 'removes', 'stdin', 'warn',
                      'cmd', '__ansible_module__', '__ansible_arguments__',
                      LINE_NUMBER_KEY, FILENAME_KEY]

{"golden_diff": "diff --git a/lib/ansiblelint/rules/EnvVarsInCommandRule.py b/lib/ansiblelint/rules/EnvVarsInCommandRule.py\n--- a/lib/ansiblelint/rules/EnvVarsInCommandRule.py\n+++ b/lib/ansiblelint/rules/EnvVarsInCommandRule.py\n@@ -29,7 +29,7 @@\n                   'command through environment argument'\n     tags = ['bug']\n \n-    expected_args = ['chdir', 'creates', 'executable', 'removes', 'warn',\n+    expected_args = ['chdir', 'creates', 'executable', 'removes', 'stdin', 'warn',\n                      'cmd', '__ansible_module__', '__ansible_arguments__',\n                      LINE_NUMBER_KEY, FILENAME_KEY]\n", "issue": "False Positive ANSIBLE0014 does not allow command:args:stdin\n# Issue Type\r\n- Bug report\r\n\r\n# Ansible and Ansible Lint details\r\n\r\n```\r\nansible --version\r\nansible 2.4.0.0\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = [u'$HOME/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /usr/lib/python2.7/site-packages/ansible\r\n  executable location = /usr/bin/ansible\r\n  python version = 2.7.5 (default, Aug  2 2017, 11:05:32) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]\r\n\r\nansible-lint --version\r\nansible-lint 3.4.17\r\n```\r\n\r\n- ansible installation method: OS package\r\n- ansible-lint installation method: pip\r\n\r\n# Desired Behaviour\r\n\r\nThe `stdin` argument to the `command` module should not trigger the \"Environment variables don't work as part of command\" error.\r\n\r\n# Actual Behaviour (Bug report only)\r\n\r\nThe EnvVarsInCommandRule (ANSIBLE0014) linter rule rejects the following playbook:\r\n\r\n```\r\n- hosts: localhost\r\n  tasks:\r\n    - command: /bin/cat\r\n      args:\r\n        stdin: \"Hello, world!\"\r\n```\r\n\r\ndue to the presence of the `stdin` attribute which was added in Ansible 2.4. This appears to be because `stdin` is missing from `expected_args`.\n", "before_files": [{"content": "# Copyright (c) 2016 Will Thames <will@thames.id.au>\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\nfrom ansiblelint import AnsibleLintRule\nfrom ansiblelint.utils import LINE_NUMBER_KEY, FILENAME_KEY\n\n\nclass EnvVarsInCommandRule(AnsibleLintRule):\n    id = 'ANSIBLE0014'\n    shortdesc = \"Environment variables don't work as part of command\"\n    description = 'Environment variables should be passed to shell or ' \\\n                  'command through environment argument'\n    tags = ['bug']\n\n    expected_args = ['chdir', 'creates', 'executable', 'removes', 'warn',\n                     'cmd', '__ansible_module__', '__ansible_arguments__',\n                     LINE_NUMBER_KEY, FILENAME_KEY]\n\n    def matchtask(self, file, task):\n        if task[\"action\"][\"__ansible_module__\"] in ['shell', 'command']:\n            if 'cmd' in task['action']:\n                first_cmd_arg = task['action']['cmd'].split()[0]\n            else:\n                first_cmd_arg = task['action']['__ansible_arguments__'][0]\n            return any([arg not in self.expected_args for arg in task['action']] +\n                       [\"=\" in first_cmd_arg])\n", "path": "lib/ansiblelint/rules/EnvVarsInCommandRule.py"}], "after_files": [{"content": "# Copyright (c) 2016 Will Thames <will@thames.id.au>\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\nfrom ansiblelint import AnsibleLintRule\nfrom ansiblelint.utils import LINE_NUMBER_KEY, FILENAME_KEY\n\n\nclass EnvVarsInCommandRule(AnsibleLintRule):\n    id = 'ANSIBLE0014'\n    shortdesc = \"Environment variables don't work as part of command\"\n    description = 'Environment variables should be passed to shell or ' \\\n                  'command through environment argument'\n    tags = ['bug']\n\n    expected_args = ['chdir', 'creates', 'executable', 'removes', 'stdin', 'warn',\n                     'cmd', '__ansible_module__', '__ansible_arguments__',\n                     LINE_NUMBER_KEY, FILENAME_KEY]\n\n    def matchtask(self, file, task):\n        if task[\"action\"][\"__ansible_module__\"] in ['shell', 'command']:\n            if 'cmd' in task['action']:\n                first_cmd_arg = task['action']['cmd'].split()[0]\n            else:\n                first_cmd_arg = task['action']['__ansible_arguments__'][0]\n            return any([arg not in self.expected_args for arg in task['action']] +\n                       [\"=\" in first_cmd_arg])\n", "path": "lib/ansiblelint/rules/EnvVarsInCommandRule.py"}]}