diff --git a/Enable-multiverse-on-Ubuntu.md b/Enable-multiverse-on-Ubuntu.md new file mode 100644 index 0000000..d39b7bf --- /dev/null +++ b/Enable-multiverse-on-Ubuntu.md @@ -0,0 +1,22 @@ +Some Ubuntu packages require the "multiverse" component (e.g., ec2-api-tools). Here's a simple playbook that enables the component and installs the ec2-api-tools package. + +Note that this uses the Ubuntu package archive hosted on EC2, so it may only work on instances running inside of EC2. + + - hosts: all + sudo: True + gather_facts: True + + tasks: + - name: ensure multiverse component is enabled + apt_repository: repo="deb http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ $item multiverse" + with_items: + - ${ansible_distribution_release} + - ${ansible_distribution_release}-updates + - ${ansible_distribution_release}-security + + - name: ensure EC2 API tools are installed + apt: pkg=ec2-api-tools update-cache=yes + +Some notes about this: + * You need to gather_facts set to True so that the ansible_distribution_release variable gets set. This variable contains the codename of the Ubuntu distribution (e.g., precise for 12.04). + * You need to set update-cache=yes when installing the first package from multiverse, so that apt retrieves the package information from the multiverse before trying to install the package. This is equivalent to doing an "apt-get update". \ No newline at end of file