Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

tower_job_list module but I believe that also the other tower_* module have the same error

ANSIBLE VERSION

$ ./build/scripts-2.7/ansible --version

ansible 2.4.0

config file = /etc/ansible/ansible.cfg

configured module search path = [u'/home/gsciorti/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']

ansible python module location = /home/gsciorti/PycharmProjects/ansible/build/lib/ansible

executable location = ./build/scripts-2.7/ansible

python version = 2.7.13 (default, May 10 2017, 20:04:28) [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)]

CONFIGURATION

No ansible.cfg configuration

OS / ENVIRONMENT

$ cat /etc/redhat-release

Fedora release 25 (Twenty Five)

$ pip freeze|grep ansible-tower-cli

ansible-tower-cli==3.1.6

SUMMARY

If you run the tower_job_list module with or without argument it fails with the error "NameError: global name 'tower_argument_spec' is not defined". Also the other tower_* module have the same part of code

Note: you don't need any Ansible Tower to reproduce this issue

I'm interested to know if other people can reproduce the same problem because I'm interested to fix it if it's a bug

STEPS TO REPRODUCE

$ ./build/scripts-2.7/ansible localhost -m tower_job_list
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: NameError: global name 'tower_argument_spec' is not defined
localhost | FAILED! => {
"changed": false,
"failed": true,
"module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible_oP4Pvj/ansible_module_tower_job_list.py\", line 141, in <module>\n main()\n File \"/tmp/ansible_oP4Pvj/ansible_module_tower_job_list.py\", line 102, in main\n argument_spec = tower_argument_spec()\nNameError: global name 'tower_argument_spec' is not defined\n",
"module_stdout": "",
"msg": "MODULE FAILURE",
"rc": 0
}

EXPECTED RESULTS

The execution of the module or an error message about the missing Tower connection information

ACTUAL RESULTS

$ ./build/scripts-2.7/ansible localhost -m tower_job_list
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: NameError: global name 'tower_argument_spec' is not defined
localhost | FAILED! => {
"changed": false,
"failed": true,
"module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible_oP4Pvj/ansible_module_tower_job_list.py\", line 141, in <module>\n main()\n File \"/tmp/ansible_oP4Pvj/ansible_module_tower_job_list.py\", line 102, in main\n argument_spec = tower_argument_spec()\nNameError: global name 'tower_argument_spec' is not defined\n",
"module_stdout": "",
"msg": "MODULE FAILURE",
"rc": 0
}

Issue 2:
Issue Type: Feature Idea

Ansible Version: ansible 1.7.1

Environment: Ubuntu 14.04

Summary:

I request a feature to allow me to specify what filename the apt_repository creates

apt_repository: repo='deb http://archive.canonical.com/ubuntu hardy partner' state=present filename=hardy-partner.list

Steps To Reproduce:

When I add a repo such as:

deb http://dl.google.com/linux/talkplugin/deb/ stable main

A file is created named:

dl_google_com_linux_chrome_deb.list

When I install the package google-chrome-stable, which comes from this repo, it creates:

google-chrome.list

With the same repo content, so apt-get complains about duplicate entries

Expected Results:

Clean repository

Actual Results:

Duplicated repo entries