Reputation: 3929
How can I install a .deb file in a puppet custom module?
I want to run this command in a puppet
wget https://repo.percona.com/apt/percona-release_0.1-6.$(lsb_release -sc)_all.deb
sudo dpkg -i percona-release_0.1-6.$(lsb_release -sc)_all.deb
sudo apt-get update
sudo apt-get install percona-xtradb-cluster-full-57
and this is my current percona.pp
class percona {
exec{'percona_deb':
command => "/usr/bin/wget -q https://repo.percona.com/apt/percona-release_0.1-6.$(lsb_release -sc)_all.deb -O /tmp/percona-re$
creates => "/tmp/percona-release_0.1-6.$(lsb_release -sc)_all.deb",
}
}
running the script in agent /opt/puppetlabs/bin/puppet agent --test
will download the .deb file
Upvotes: 2
Views: 2868
Reputation: 63
I suggest you using the native resource type package. Then, you can use the provider dpkg and the source you mentioned above to create the solution you are looking for.
For example:
package {'percona':
provider => dpkg,
source => <source_url>,
}
For more resource attributes, you can consult the documentation here.
Upvotes: 2