How to upgrade hiera on PE3.8 without master remediating it back? - hiera

We have PE3.8 with hiera v1.3.4. However, I want to upgrade hiera to v3.0.5 (using gem install hiera). When we do this, the Puppet Master automatically reverts that back to 1.3.4 after a while.
(Hiera v1.3.4 is a symlink in /usr/local/bin. After upgrade it is the v3.0.5 executable.)
What is the correct way to upgrade hiera on the Puppet Master?
Thanks, Ed

Related

Chef:Install Apache at custom path/location

I want to install apache using chef. But when I use:
package 'httpd' do
action :install
end
It will install apache inside /etc/httpd but I want to install apache in another directory (for example: /abc).
The Chef package resource uses the underlying system's package manager such as yum, apt.
You haven't mentioned the distribution you are running on. However, using package 'httpd' on YUM based distribution will trigger yum install httpd
So, first find how you can change/set the install path using the underlying OS command. E.g. for YUM:
yum --installroot=<path> install <package>
In a Chef package resource:
package 'httpd' do
options '--installroot=/abc'
action :install
end
I have created a custom package and then installed in to desired loaction it helped me a lot Thank you very much everyone

downgrade rpm package from experimental repo just by disabling the repo and yum update

I have packages Foo-2.0.rpm and Foo-2.3.rpm. The former is normally distributed by the Linux distro but old. Foo-2.3 is the latest version, and the rpm I am making. I am writing the .spec file, and for now, keep it in my own repo.
I thought--and I thought I even did--that I could replace Foo-2.3 with Foo-2.0 (downgrade to the stable version) by doing the following:
yum-config-manager --disable myrepo
yum --update Foo
Provided that Foo-2.3 was installed, the expected outcome is to have Foo-2.0 in place of Foo-2.3.
However, now, it gives me the following message only:
# yum update Foo
No packages marked for update
"yum downgrade Foo" seems a working command.
Why "yum update" does not work as I expected? Is it because of my spec file? Or is it just something that is not working?
In the .spec file of Foo, Foo "Provides: Foo-2.3," and "Conflicts: Foo <= 2.1." I have lost a few the spec files in development. Although I think disabling the repo and "yum update" downgraded Foo, my memory might be wrong.
yum upgrade always went up. When in the repo is a higher version, then upgrade. If there is older, just do nothing. It always acted this way. Even rpm itself behave this way. But for rpm you can force it to downgrade with upgrade with rpm -Uvh --force Foo-2.0.rpm. For yum there is no way. You have to use downgrade command.
And BTW in your spec file should be:
Provides: Foo-2.3
Obsoletes: Foo <= 2.1
But this is usually needed when you rename the package. Which I believe is not your case.

Control yum update packages sequence

Couldn't find an answer anywhere so I will try here.
Is there a way to tell yum, while running yum update, to update a specific package as the last one?
I am not talking about requires / dependencies, It just needs to be updated after all other packages on the system.
In a nutshell, I manage local repositories in my environment and this particular rpm holds the version for each repository, so by updating it as last I can label the client with that particular version.
You can run two yum commands. First one excluding the .rpm that you don't want to be updated and second, running your usual update.
$ yum --exclude="foo*.rpm" update
If foo*.rpm comes from a particular repository, then during the update, you can disable it using its name. Name of a repository can be found by looking into /etc/yum.repos.d/*.repo file or using the command
$ yum repolist
Then disable the repo and update. Note, this will disable update of all packages coming from this repo.
$ yum --disablerepo="nameOfRepo" update
Finally, run your usual update
$ yum update

Reinstall rhn-client-tools with non working yum

For every yum command it will return SSL certificate error
Loaded plugins: fastestmirror, rhnplugin, security
The SSL certificate failed verification.
My SSL cert if valid.
I checked rhel site for https://access.redhat.com/solutions/93313 but the problem is i cannot reinstall rhn-client-tools since yum is actually not working and for some other reasons i cannot boot it from DVD/image.
Any tips on this?
Before trying to reinstall, have you also checked your firewall settings and the time and date setting on your server ?
If the firewall is not the issue, I would suggest a simpler approach, just by going to RH's site and downloading the appropriate rhn-client-tools RPM package, copying it to your server and installing it.
"What about the possible dependencies?" I foresee you asking...
Use a different server (or VM) with the same OS version that has access to the internet.
use yum with the download only plugin to only download all the needed dependencies (you must have the yum-plugin-downloadonly package installed beforehand) in a local directory like so:
yum install --downloadonly --downloaddir=<directory> <package>
Copy the packages downloaded at step #2 to your affected machine and install them using the rpm utility as so: rpm -ivh /path/to/yum/download/dir/*

Fedora 21 packages repo in cobbler not found

I am attempting to install Fedora 21 with additional packages (dhcp, tftp-server, tftp, subversion, vim) using cobbler as my provisioning system over pxeboot.
The problem is that the installation will show an error about packages/groups not existing when it tries to install packages for Fedora, specifically it will pop up an error for all of the packages I try to install in the list below. It seems that the repo information is not right because not a single one of my packages is being installed even though when I check the repo on the web they are present.Here are the relevant sections from my kickstart file.
install
url --url=http://192.168.1.1/cblr/links/Fedora_21_Server-i386/
repo --name="Fedora_21_i386_Server" --baseurl=http://192.168.1.1/cblr/repo_mirror/Fedora_21_i386/
auth --useshadow --passalgo=md5
graphical
firstboot --disable
keyboard us
lang en_US
timezone America/Los_Angeles
selinux --disabled
logging --level=info
reboot
bootloader --location=mbr
zerombr
clearpart --all --initlabel
part swap --fstype="swap" --size=1000
part / --fstype="ext3" --grow --size=1
%packages
#base
#base-x
#editors
#graphical-internet
#system-tools
#admin-tools
#fonts
#lxde-desktop
dhcp
tftp
tftp-server
subversion
vim-enhanced
vsftpd
minicom
%end
I have also tried setting --baseurl as a Fedora mirror (--baseurl=http://mirror.pnl.gov/fedora/linux/releases/21/Server/i386/os/) but that does not work either. I have the above repo added as a cobbler repo and I have linked my Fedora 21 profile to it. One caveat is that I chose "No" for the local mirror option because right now my VM does not have enough space for the Fedora repo.
One solution is to install the packages in a post-install section using standard yum commands. For example,
%post
yum -y install minicom
yum -y install vsftpd
I've used this workaround with F20 installs.