apt-repository not working in debian squeeze

Hi there,

I got a {“failed”: true, “msg”: “Failed to find required executable add-apt-repository”} error when trying to add a repository with apt-repository module on debian squeeze. I found out add-apt-repository is ubuntu specific.

I am using 7.0, is that limitation in place or am I doing something wrong? May be a note on the modules page would make sense in any case.

As a workaround I am trying to add the repository this way, but the command fails in with “~/dotdeb.gpg Not such file or directory” Same command works if run directly on the machine

  • name: Copy dotdeb.list to sources list
    action: copy src=files/etc/apt/dotdeb/dotdeb.list dest=/etc/apt/sources.list.d/dotdeb.list
    tags:

  • common

  • setup

  • packages

  • name: Copy dotdeb public key to home
    action: copy src=files/etc/apt/dotdeb/dotdeb.gpg dest=~/dotdeb.gpg
    tags:

  • common

  • setup

  • packages

  • name: Add the dotdeb public key to a new keyring
    action: command /usr/bin/gpg --no-default-keyring --keyring /etc/apt/trusted.gpg.d/dotdeb.gpg --import ~/dotdeb.gpg – creates=/etc/apt/trusted.gpg.d/dotdeb.gpg
    tags:

  • common

  • setup

  • packages

Any idea about what is wrong? Also, I am not an experienced sysadmin, so maybe copy should include some attributes for owner and permissions. I am running this as root.

Thanks in advance.

I am not a user of this module. If Debian/Ubuntu users can help investigate and fix, that would be great -- thanks!

-- Michael

add-apt-repository comes in the package python-software-properties on ubuntu. For reasons unclear to me, python-software-properties on debian does not include this script. It appears add-apt-repository is ubuntu-specific.

sf

Am aware. So no interest in making it work without that binary? Or perhaps just have a “hey this doesn’t work on your OS” message.

– Michael

Since the docs didn’t mention it was ubuntu-specific, I assumed it would work on debian. I can submit a patch for the docs, but I’m not sure what changes I’d make to the module. Do other debian derivatives include add-apt-repository?

sf

Am aware. So no interest in making it work without that binary? Or
perhaps just have a "hey this doesn't work on your OS" message.

Since the docs didn't mention it was ubuntu-specific, I assumed it would
work on debian. I can submit a patch for the docs, but I'm not sure what
changes I'd make to the module. Do other debian derivatives include
add-apt-repository?

I'm not debian user (sorry) but i find this script that can help you:

* http://blog.anantshri.info/howto-add-ppa-in-debian/
* http://blog.anantshri.info/content/uploads/2010/09/add-apt-repository.sh.txt

You can try to use template to copy script (probably some small change
are required) and use apt_repository to manage your repo.

sf

Bye
       Marco

– Sorry, I cross-posted this to the list digest. It belongs here –

Hi there,

Thanks for all your comments. It seems like apt-add-repository was
added to python-software-properties in version 0.75. The current
version in Debian Stable ('squeeze") is 0.60, so it doesn’t have it
[1].

Anyways, the work-arround I was trying finally worked after changing
the commnad target directory from ~ to /tmp/. Adding a new repo is
just three tasks, so I rather do it this way than through an extra
script. This is are the tasks that are working from me right now.

tasks:

There's an outstanding pull request here:

https://github.com/izhukov/ansible/commit/03f8db55d6b9447af1509e522ed2d5b92ea6eb60

Anyone with preferences want to help review?

If it's available in *newer* Debian I'm inclined to say we could
possibly ignore this?

Presumably it should use the apt-add-repository code if installed.

--Michael

There's an outstanding pull request here:

https://github.com/izhukov/ansible/commit/03f8db55d6b9447af1509e522ed2d5b92ea6eb60

I have tried to review and test, but seems like I am having some
difficulties, commented on the issue:

https://github.com/ansible/ansible/pull/1082#issuecomment-8844382

Presumably it should use the apt-add-repository code if installed.

I believe this pull request does not use apt-add-repository at all.

Cheers