Openvpn is packaged by Ubuntu, so it is coming from the Ubuntu package repository. Chef uses the
apt
package provider for thepackage
resource. This means while you saypackage "openvpn"
in your recipe, under the covers Chef looks at the node's platform (e.g., ubuntu 12.04) and usesapt-get install
to install it. If you were using CentOS, it would use yum instead.If you want to use S3 to store a config file, you would specify the source as the URI to the actual file with remote file:
Example:
remote_file "/etc/openvpn/openvpn.conf" do
source "https://your-bukket.s3.amazonaws.com/openvpn.conf"
action :create
end
If the bucket is private, you'll need to use an alternative resource such as aws_s3_file
from Opscode's "aws" cookbook. See the README for information about how to use that resource - it passes in the AWS credentials to access the item in the bucket.
If you want to provide your own openvpn package and download it from S3, you can do so with this:
remote_file "/tmp/openvpn-VERSION.deb" do
source "https://your-bukket.s3.amazonaws.com/openvpn-VERSION.deb"
action :create_if_missing
end
dpkg_package "openvpn" do
source "/tmp/openvpn-VERSION.deb"
action :install
end
(Replace VERSION with your actual version, or otherwise change the filename to suit your preferences)