Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apt_repository does not recognize filename option #32833

Closed
sgutermann opened this issue Nov 12, 2017 · 7 comments
Closed

apt_repository does not recognize filename option #32833

sgutermann opened this issue Nov 12, 2017 · 7 comments
Labels
affects_2.3 This issue/PR affects Ansible v2.3 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@sgutermann
Copy link

sgutermann commented Nov 12, 2017

ISSUE TYPE
  • Bug Report
COMPONENT NAME

apt_repository

ANSIBLE VERSION
ansible 2.3.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.9 (default, Jun 29 2016, 13:08:31) [GCC 4.9.2]
CONFIGURATION

No special configs, default install via pip

OS / ENVIRONMENT

Running ansible on debian jessie.

Deploying to debian stretch.

SUMMARY

FAILED! => {"changed": false, "failed": true, "msg": "Unsupported parameters for (apt_repository) module: filename. Supported parameters include: install_python_apt,mode,repo,state,update_cache,validate_certs"}

STEPS TO REPRODUCE

I simply followed the example in the documentation for apt_repository and added "filename" which should be available since ansible 2.1

- name: DOCKER | Add docker repo to apt
  apt_repository:
    repo: https://download.docker.com/linux/debian stretch stable
    state: present
    update_cache: yes
    filename: 'docker'
EXPECTED RESULTS

I expected to get the apt repo listed under the filename give as described in the documentation.

ACTUAL RESULTS
TASK [docker : DOCKER | Add docker repo to apt] *********************************************************************************************
fatal: [p4rt098.dip0.t-ipconnect.de]: FAILED! => {"changed": false, "failed": true, "msg": "Unsupported parameters for (apt_repository) module: filename. Supported parameters include: install_python_apt,mode,repo,state,update_cache,validate_certs"}

@ansibot ansibot added affects_2.3 This issue/PR affects Ansible v2.3 bug_report needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Nov 12, 2017
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Nov 16, 2017
@pilou-
Copy link
Contributor

pilou- commented Nov 21, 2017

codename parameter has been added in 2.3.0 and is neither listed in ACTUAL RESULTS.

@sgutermann could you check installed Ansible version ?

@ansibot
Copy link
Contributor

ansibot commented Nov 21, 2017

cc @sashka
click here for bot help

@ansibot ansibot added the module This issue/PR relates to a module. label Nov 21, 2017
@sgutermann
Copy link
Author

ansible 2.3.1.0

@sgutermann
Copy link
Author

Same on ansible 2.4.2.0

@pilou-
Copy link
Contributor

pilou- commented Dec 30, 2017

Using devel or stable-2.4 branch and using the task mentioned in the description I got another error:

TASK [DOCKER | Add docker repo to apt] ****
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Invalid repository string: https://download.docker.com/linux/debian stretch stable"}

This error is legit, repo value must begin with deb or deb-src. Once the deb prefix added (repo: deb https://download.docker.com/linux/debian stretch stable), I encounter another legit error:

TASK [DOCKER | Add docker repo to apt] ***********************************************************************************************************************
fatal: [localhost]: FAILED! => {
    "changed": false,
    "rc": 0
}

MSG:

MODULE FAILURE


MODULE_STDOUT:

Traceback (most recent call last):
  File "/tmp/ansible_85nZ6F/ansible_module_apt_repository.py", line 547, in <module>
    main()
  File "/tmp/ansible_85nZ6F/ansible_module_apt_repository.py", line 535, in main
    cache.update()
  File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 464, in update
    raise FetchFailedException(e)
apt.cache.FetchFailedException: W:GPG error: https://download.docker.com/linux/debian stretch InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8, E:The repository 'https://download.docker.com/linux/debian stretch InRelease' is not signed.

nonetheless the filename parameter was taken in account, the file was created:

# cat /etc/apt/sources.list.d/docker.list 
deb https://download.docker.com/linux/debian stretch stable

@sgutermann which error did you encounter ?

@sgutermann
Copy link
Author

Sorry for not updating, but yes, I noticed that with the syntax, however even with the "deb" added in my above example I still get the same error.

Other Playbook, other repo:

fatal: [debian.lamido.de]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"filename": "mssql",
"repo": "deb https://packages.microsoft.com/debian/8/prod jessie main",
"state": "present"
}
},
"msg": "Unsupported parameters for (apt_repository) module: filename Supported parameters include: install_python_apt,mode,repo,state,update_cache,validate_certs"
}

######################################

ansible 2.4.2.0
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/steffen/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python2.7/dist-packages/ansible
executable location = /usr/local/bin/ansible
python version = 2.7.9 (default, Jun 29 2016, 13:08:31) [GCC 4.9.2]

@sgutermann
Copy link
Author

Ok, this is STRANGE, but after completely cleaning out my python and ansible and installing it again it all works.

#########################################

ansible 2.4.2.0
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/steffen/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /home/steffen/.local/lib/python2.7/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 2.7.13 (default, Nov 24 2017, 17:33:09) [GCC 6.3.0 20170516]

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.3 This issue/PR affects Ansible v2.3 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

4 participants