{"issue":{"title":"Getting Started - Provisioning - Puppet config needs apt-get update","user":{"login":"jufo","id":732913,"url":"https://api.github.com/users/jufo","avatar_url":"https://secure.gravatar.com/avatar/1aa890b24edcd0605c8ab920992fddda?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"1aa890b24edcd0605c8ab920992fddda"},"created_at":"2011-12-09T11:05:54Z","milestone":null,"labels":[],"state":"open","updated_at":"2011-12-25T21:00:26Z","id":2500484,"closed_at":null,"html_url":"https://github.com/mitchellh/vagrant/issues/586","pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"Using the Puppet manifest shown in the Provisioning part of the Getting Started guide gave these errors:\r\n\r\n```\r\n[default] err: /Stage[main]//Package[apache2]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install apache2' returned 100: Reading package lists...\r\nBuilding dependency tree...\r\nReading state information...\r\nThe following extra packages will be installed:\r\n  apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common libapr1\r\n  libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap ssl-cert\r\nSuggested packages:\r\n  apache2-doc apache2-suexec apache2-suexec-custom\r\nThe following NEW packages will be installed:\r\n  apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common\r\n  libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap ssl-cert\r\n0 upgraded, 10 newly installed, 0 to remove and 5 not upgraded.\r\nNeed to get 3076kB/3342kB of archives.\r\nAfter this operation, 10.2MB of additional disk space will be used.\r\nErr http://us.archive.ubuntu.com/ubuntu/ lucid-updates/main apache2.2-bin 2.2.14-5ubuntu8.4\r\n  404  Not Found [IP: 91.189.92.180 80]\r\nErr http://security.ubuntu.com/ubuntu/ lucid-security/main apache2.2-bin 2.2.14-5ubuntu8.4\r\n  404  Not Found [IP: 91.189.92.166 80]\r\nErr http://security.ubuntu.com/ubuntu/ lucid-security/main apache2-utils 2.2.14-5ubuntu8.4\r\n  404  Not Found [IP: 91.189.92.166 80]\r\nErr http://security.ubuntu.com/ubuntu/ lucid-security/main apache2.2-common 2.2.14-5ubuntu8.4\r\n  404  Not Found [IP: 91.189.92.166 80]\r\nErr http://security.ubuntu.com/ubuntu/ lucid-security/main apache2-mpm-worker 2.2.14-5ubuntu8.4\r\n  404  Not Found [IP: 91.189.92.166 80]\r\nErr http://security.ubuntu.com/ubuntu/ lucid-security/main apache2 2.2.14-5ubuntu8.4\r\n  404  Not Found [IP: 91.189.92.166 80]\r\nFailed to fetch http://security.ubuntu.com/ubuntu/pool/main/a/apache2/apache2.2-bin_2.2.14-5ubuntu8.4_i386.deb  404  Not Found [IP: 91.189.92.166 80]\r\nFailed to fetch http://security.ubuntu.com/ubuntu/pool/main/a/apache2/apache2-utils_2.2.14-5ubuntu8.4_i386.deb  404  Not Found [IP: 91.189.92.166 80]\r\nFailed to fetch http://security.ubuntu.com/ubuntu/pool/main/a/apache2/apache2.2-common_2.2.14-5ubuntu8.4_i386.deb  404  Not Found [IP: 91.189.92.166 80]\r\nFailed to fetch http://security.ubuntu.com/ubuntu/pool/main/a/apache2/apache2-mpm-worker_2.2.14-5ubuntu8.4_i386.deb  404  Not Found [IP: 91.189.92.166 80]\r\nFailed to fetch http://security.ubuntu.com/ubuntu/pool/main/a/apache2/apache2_2.2.14-5ubuntu8.4_i386.deb  404  Not Found [IP: 91.189.92.166 80]\r\nE: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?\r\n```\r\n\r\nI couldn't find a generic (cross-platform) way of using Puppet to ensure that a package manager's lists are up to date, so I used an exec. I also created the puppet group, to stop Puppet complaining about that, and I copied the index.html file from /vagrant to /var/www.\r\n\r\nThis is the Puppet manifest I ended up with (in manifests/lucid32.pp):\r\n\r\n```\r\ngroup { 'puppet': ensure => 'present' }\r\n\r\nexec { 'apt-get update':\r\n  command => '/usr/bin/apt-get update'\r\n}\r\n\r\npackage { 'apache2':\r\n  ensure => present,\r\n  require => Exec['apt-get update']\r\n}\r\n\r\nservice { 'apache2':\r\n  ensure => running,\r\n  require => Package['apache2']\r\n}\r\n\r\nFile {\r\n  owner => 'root',\r\n  group => 'root',\r\n  mode => '0644'\r\n}\r\n\r\nfile { 'index.html':\r\n  path => '/var/www/index.html',\r\n  source => '/vagrant/index.html',\r\n  require => Package['apache2']\r\n}\r\n```\r\n\r\nNote that this is my first exposure to Puppet - there may be better ways of doing this.\r\n","number":586,"url":"https://api.github.com/repos/mitchellh/vagrant/issues/586","comments":3,"assignee":null},"comment":{"user":{"login":"jufo","id":732913,"url":"https://api.github.com/users/jufo","avatar_url":"https://secure.gravatar.com/avatar/1aa890b24edcd0605c8ab920992fddda?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"1aa890b24edcd0605c8ab920992fddda"},"created_at":"2011-12-25T21:00:26Z","updated_at":"2011-12-25T21:00:26Z","id":3271683,"body":"Thanks - Happy Christmas!\n\nOn 25 Dec 2011 14:04, \"dietervds\" <\nreply@reply.github.com>\nwrote:\n\nHad the same issue, and worked like a charm with this manifest. Cheers.\n\n---\nReply to this email directly or view it on GitHub:\nhttps://github.com/mitchellh/vagrant/issues/586#issuecomment-3270833","url":"https://api.github.com/repos/mitchellh/vagrant/issues/comments/3271683"},"action":"created"}