Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apt repo issue (no puppet-agent found) trying to install puppet 4.3.1 #32

Closed
MikeCaspar opened this issue Jan 2, 2016 · 6 comments
Closed

Comments

@MikeCaspar
Copy link
Contributor

Have tried installed with a specific version number as well as latest.

After some experimentation found a way to install...

Error...

Building dependency tree...
Reading state information...
E: Version '1.3.2' for 'puppet-agent' was not found
20:13:13 +0000 CRIT: Installation failed
20:13:13 +0000 CRIT: Please file a bug report at https://github.com/petems/puppet-install-shell/
20:13:13 +0000 CRIT: 
20:13:13 +0000 CRIT: Version: 4.3.1
20:13:13 +0000 CRIT: Platform: ubuntu
20:13:13 +0000 CRIT: Platform Version: 14.04
20:13:13 +0000 CRIT: Machine: x86_64
20:13:13 +0000 CRIT: OS: Linux
20:13:13 +0000 CRIT: 
20:13:13 +0000 CRIT: Please detail your operating system type, version and any other relevant details

I found this in the output which gave me clue....

20:12:27 +0000 INFO: Ubuntu platform! Lets get you a DEB...
20:12:27 +0000 INFO: Downloading http://apt.puppetlabs.com/puppetlabs-release-pc1-trusty.deb
20:12:27 +0000 INFO:   to file /tmp/install.sh.2084.24561/puppetlabs-release-pc1-trusty.deb

Eventually, I managed to get the puppet agent to install by using the instructions on this page from puppetlabs...

http://docs.puppetlabs.com/puppet/4.3/reference/install_linux.html

I'm not sure if the problem is the reference to trust or wheezy, but by following the instructions, I did the following...

wget https://apt.puppetlabs.com/puppetlabs-release-pc1-wheezy.deb
dpkg -i puppetlabs-release-pc1-wheezy.deb

My Vagrantfile uses...

config.vm.box = 'ubuntu/trusty64'

From what I can tell, the script command could be the problem.

I just thought I'd share here as a problem with some clues as to where it might get fixed.

@MikeCaspar MikeCaspar changed the title apt repo issue (no puppet-agent found) trying to install puppet-agent only apt repo issue (no puppet-agent found) trying to install puppet 4.3.1 Jan 2, 2016
@petems
Copy link
Owner

petems commented Jan 2, 2016

Weird, on precise boxes the version number is "1.3.2-1trusty", I'll have to take that into account in the install script...

@MikeCaspar
Copy link
Contributor Author

Hi there... I ended up having more problems..

It appears that the ubuntu/trusty64 image has a version of puppet already installed.. I'm not sure why this is this way (maybe to support the provision puppet.

Anyways, I thought I'd let you know what I ended up needing to do (in the event it helps out at all).

  • remove this plugin (unfortunately).. It would not run without errors.

Included the following script .. (I have shared the part I can with you).

## in case an older version of puppet is installed, remove it
apt-get purge puppet -y
rm /etc/puppet -rf
apt-get autoremove -y

apt-get install wget 
wget https://apt.puppetlabs.com/puppetlabs-release-pc1-wheezy.deb
dpkg -i puppetlabs-release-pc1-wheezy.deb
apt-get update

# install new puppet agent now...
apt-get install puppet-agent

Now, everything is installed perfectly (based on the new version 4.X directory structure).

You'll find now that puppet is located in the following location...

/opt/puppetlabs/puppet/bin

and etc. files...

/etc/puppetlabs/puppet

If using 'ubuntu/trusty64' is a bad idea for this plugin, I suppose you could always restrict to particular boxes.. Up to you.

I hope this info helps you out.

@petems
Copy link
Owner

petems commented Jan 3, 2016

@MikeCaspar It's possible to use this plugin to run a script of your choice, so you could integrate this in the Vagrantfile using the plugin.

For example this worked for me: (Gist link is to your above code)

config.vm.define :trusty_ubuntu_box do |trusty_ubuntu_box|
    trusty_ubuntu_box.puppet_install.puppet_version = :latest
    trusty_ubuntu_box.puppet_install.install_url = 'https://gist.githubusercontent.com/petems/6723c2eedb9d32d7ad97/raw/990ff448f6430aa015e208668a3cecb3f1db0d4b/purge_old_install_new.sh'

    trusty_ubuntu_box.vm.box = "ubuntu/trusty64"

    trusty_ubuntu_box.vm.provision "shell", inline: "puppet --version"

end

Can you confirm if that works for you?

petems added a commit that referenced this issue Jan 3, 2016
* Catches #32
* Uses @MikeCaspar's code to clear out pre-installed Puppet
@MikeCaspar
Copy link
Contributor Author

Hi there. Things worked out well !! Thanks.

There is one Tiny quirk (not sure if its worth trying to change ? I think I'll leave it for now).

The user vagrant has the path added to the shell of "/opt/puppetlabs/bin/" nicely.

For some reason, the path change didn't copy over to the root user. This is the Default behaviour though, so not sure how big of a deal this is.

I like the idea of the gist by the way :-> Nice approach.

I've created a repo for the future in the event this script should be improved over time (which I suspect it might be.). It could also serve other people as well..

I'll add you as a contributor to the repo... I put a license on it (MIT) as it's fairly destructive in nature. repo

This would make the new config...

config.vm.define :trusty_ubuntu_box do |trusty_ubuntu_box|
    trusty_ubuntu_box.puppet_install.puppet_version = :latest
    trusty_ubuntu_box.puppet_install.install_url = 'https://raw.githubusercontent.com/MikeCaspar/vagrant-purge-old-puppet-from-ubuntu/master/scripts/1.0.0/purge-install.sh'

    trusty_ubuntu_box.vm.box = "ubuntu/trusty64"

    trusty_ubuntu_box.vm.provision "shell", inline: "puppet --version"

end

Feel free to add yourself as a contributor to the README.MD any time.

Here's the repo [https://github.com/MikeCaspar/vagrant-purge-old-puppet-from-ubuntu] https://github.com/MikeCaspar/vagrant-purge-old-puppet-from-ubuntu

@MikeCaspar
Copy link
Contributor Author

Hi, just so you know. I created a /latest so you don't have to adjust the versions unless you want to.

@petems
Copy link
Owner

petems commented Jan 3, 2016

👍

@petems petems closed this as completed Jan 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants