Puppet and version of a package to install - ubuntu-14.04

Tell me how to specify the correct version for the package to be installed. Updating Virtualbox. Updated normally. But, does it every time. Although, the latest version is already installed.
My manifest file:
class virtualbox {
package { "virtualbox":
provider => dpkg,
ensure => '5.2.18-124319~Ubuntu~trusty',
source => "/tmp/virtualbox-5.2_5.2.18-124319~Ubuntu~trusty_amd64.deb"
}
}
On client:
$ sudo service puppet stop
* Stopping puppet agent
$ sudo puppet agent -v --no-daemonize
Notice: Starting Puppet client version 3.4.3
Info: Retrieving plugin
Info: Caching catalog for w071
Error: Failed to apply catalog: Parameter ensure failed on Package[virtualbox]: Provider must have features 'versionable' to set 'ensure' to '5.2.18-124319~Ubuntu~trusty' at /etc/puppet/manifests/classes/1c_update.pp:7
Wrapped exception:
Provider must have features 'versionable' to set 'ensure' to '5.2.18-124319~Ubuntu~trusty'
If specify latest, the package will be updated every time.

Related

terraform init step with "no available releases match the given constraints ~> 2.1.28"

Actually - received the replaced apple mac laptop (the original one crashed due to bad storage) and i am re-setting up everything with configure, i am stuck and blocked with this "terraform init" step,
Installed terraform version is 0.13.6
Installed AWS CLI is 2.1.32
When "terraform init" is triggered i am getting this below error, any help is appreciated so that i can unblock my work.
Initializing modules...
Initializing the backend...
Initializing provider plugins...
- Using previously-installed hashicorp/kubernetes v1.13.3
- Using previously-installed hashicorp/external v1.1.2
- Finding hashicorp/aws versions matching "~> 2.1.28"...
Error: Failed to query available provider packages
Could not retrieve the list of available versions for provider hashicorp/aws: no available releases match the given constraints ~>
2.1.28
By using ~> 2.1.28, you're saying that you will use any 2.1.x version, as long as the bugfix version is higher than 28. The highest 2.1 version is 2.1.0.
Are you sure you don't mean ~> 2.28.1?
create a config.tf file and add this line
required_providers {
aws = {
source = "registry.terraform.io/hashicorp/aws"
version = "=2.28.0" ## or whatever version you need
}
}

Puppet : Warning: Only one file can be applied per run. Skipping

I'm installing an application called "Bag Of Holding" using the puppet script provided on github. I installed successfully then needed to make a change to the site.pp and init.pp file but when I tried to recompile using (puppet apply ), I got the warning message
Warning: Only one file can be applied per run. Skipping /etc/puppet/manifests/site.pp
And no other activity on the screen. I was unable to access my application after that. After a day of troubleshooting I gave up and started from scratch - re-install my CentOS, puppet, and all the folder directories were in place, but as soon I run "puppet apply", I got the same Warning as previously and I have since not been able to access the application.
How could the compilation fail for a newly installed operating system with application being installed freshly? Is it not possible to run puppet site.pp file more than once? Is there anything hard coded to the server after the first run and can no longer accept additional compilation? Both site.pp and init.pp file are on the github I posted above. I'm running masterless puppet configuration set up.
site.pp code:
# adding boh module to the node
node 'boh.domain' {
class { 'boh':
python_version => 3,
environment => 'dev',
language => 'pt-br',
debug => 'True',
create_superuser => 'true',
pkg_checksum => '86b0164f7fd6c5e4aa43c8f056f08cea',
}
}
Question no longer relevant. I found the fix by ensuring appropriate syntax was being used...puppet apply -
-- modulepath=
Thanks

Vagrant + chef-solo + berkshelf: node.js last version cookbook

Basically, i need a working machine with node.js & npm installed.
I've configured a vagrant + berkshelf + chef enviroment, but i can't find a lastest version (>= 4.0.0) nodejs cookbook as source for my berksfile.
I've tried with this:
https://supermarket.chef.io/cookbooks/nodejs
from chef supermarket but install a old version of node + npm.
I am experiencing for the first time vagrant and chef so i can't understand how find it.
Can someone help me?
In your role or node settings you can specify default attributes for any cookbook you use. Cookbook nodejs allows you to set NodeJS version with the attribute version (check its attributes/default.rb file). But this attribute is taken into account only when NodeJS is installed from precompiled binaries or sources. So you need to specify install_method as well (default is package, i.e. installation via system package manager).
One more thing: you need to manually specify binary package checksum, which you can find in every release folder here: https://nodejs.org/download/release/
So, to install the latest version from official binaries use the following settings in role or node:
"nodejs": {
"install_method": "binary",
"binary": {
"checksum": "75b029b30d4a4147d67cf75bf6e034291fb5919c6935ec23f8365cee2d463f12"
},
"version": "5.3.0"
}

How to uninstall package using puppet

I have installed mysql in a client node using Puppet. Now I want to uninstall it in the client node. I tried the following configuration in site.pp:
package { '::mysql::server':
ensure => 'purged'
}
This did not work. Can someone show me how to uninstall mysql (or any package for that matter)?
That syntax is wrong. ::mysql::server is either referencing a puppet class or defined type. You only need to specify the package name to the package type.
package { 'mysql_package_name':
ensure => absent
}
Replacing mysql_package_name with the name of the package for the distro you are using.

Installing MongoDb with Puppet

I'm a newbie in Puppet, so maybe you'll find my question a bit stupid...
So, I'm looking for puppet recipe that will install and run Mongodb 2.2 on my machine. By googling I found this module http://forge.puppetlabs.com/puppetlabs/mongodb But I didn't understand clear what should I do?
It said I have to install module on puppet node first. What does exactly it means?
Let's say, I have a set of machines those must be configured via puppet.
What do I have to add to puppet recipe to reach this aim?
In case someone might be interest on installing the last version of MongoDB this worked very well for me. At the moment of writing the latest stable version is MongoDB 3.0.3.
First of all update your OS repositories via the puppet apt module (in case you're using a Debian or Ubuntu distribution). Change the data below according to your distribution and version. Check here to get the MongoDB official repositories information: http://docs.mongodb.org/manual/administration/install-on-linux/#recommended
# $::lsbdistcodename should contain what you usually get
# with the `lsb_release -sc` command
$server_lsbdistcodename = downcase($::lsbdistcodename)
apt::source { 'mongodb-org-3.0':
location => 'http://repo.mongodb.org/apt/debian',
release => "${server_lsbdistcodename}/mongodb-org/3.0",
repos => 'main',
key => '7F0CEB10',
key_server => 'keyserver.ubuntu.com',
include_src => false
}
And then set the mongodb::globals class properly to make sure you get MongoDB 3. The MongoDB puppet module I'm using is this one.
class { 'mongodb::globals':
manage_package_repo => false, # disable the 10gen repository
server_package_name => 'mongodb-org',
service_name => 'mongod',
version => '3.0.3',
}->
class { '::mongodb::server': }
Getting mongodb installed with puppet isn't as easy as it seems. It's somewhat difficult to get official Puppet Labs module v0.8.0 to install mongodb 2.6.3. You end up getting an apt error about mongodb-10gen=2.6.3 not being found. There's an issue and a patch already but it hasn't been published yet.
So here's what you need to do:
git clone https://github.com/puppetlabs/puppetlabs-mongodb.git
Then use the following puppet config:
class { '::mongodb::globals':
manage_package_repo => true,
server_package_name => 'mongodb-org',
version => '2.6.3'
}->
class { '::mongodb::server': }
This Worked for me.
If you are running puppet standalone, you will have already installed the puppet gem and have the puppet executable. To intall the module, you run puppet module install puppetlabs/mongodb. After the module installation, you can simply include the mongodb module in your node definition
node 'myhost' {
include mongodb
}
If you want to run a number of nodes that need access to the module, you'll have to setup a puppetmaster and install the node. See [Basic Agent/Master setup][1] for more info. Make sure that pluginsync=true is enabled in puppet.conf so the module can make it's way to the remote agents.
The puppetmaster will then need a file, normally site.pp defined with the nodes it should configure. Finally, include the mongodb module on each node you want to run mongodb and you should be up and running.

Resources