Author: | Alexander Saltanov |
---|
parameter | required | default | choices | comments |
---|---|---|---|---|
mode | no | 420 | The octal mode for newly created files in sources.list.d (added in Ansible 1.6) | |
repo | yes | none | A source string for the repository. | |
state | no | present |
|
A source string state. |
update_cache | no | yes |
|
Run the equivalent of apt-get update when a change occurs. Cache updates are run after making changes. |
Note
Requires python-apt
# Add specified repository into sources list.
apt_repository: repo='deb http://archive.canonical.com/ubuntu hardy partner' state=present
# Add source repository into sources list.
apt_repository: repo='deb-src http://archive.canonical.com/ubuntu hardy partner' state=present
# Remove specified repository from sources list.
apt_repository: repo='deb http://archive.canonical.com/ubuntu hardy partner' state=absent
# On Ubuntu target: add nginx stable repository from PPA and install its signing key.
# On Debian target: adding PPA is not available, so it will fail immediately.
apt_repository: repo='ppa:nginx/stable'
Note
This module works on Debian and Ubuntu and requires python-apt.
Note
This module supports Debian Squeeze (version 6) as well as its successors.
Note
This module treats Debian and Ubuntu distributions separately. So PPA could be installed only on Ubuntu machines.