Broker problems with puppet-pe and CentOS 7

84 views
Skip to first unread message

Alex Scoble

unread,
Mar 6, 2015, 7:10:25 PM3/6/15
to puppet...@googlegroups.com
Hi All,

I have razor server all up and running (it's been running for a while, but was only building up esxi hosts before) and it can install centos 7 on a vm, but once the installation is done the razor_postinstall.sh script does not run properly and the PE agent never gets installed.

Unfortunately, there are no indications in the anaconda or other logs why the script isn't running properly.

Any ideas?

Thanks,

Alex

BTW, here is our kickstart file that Razor is handing out to the vm at install:

```
#!/bin/bash
# Kickstart for RHEL/CentOS 7

install
url --url=<%= repo_url %>
cmdline
lang en_US.UTF-8
keyboard us
rootpw <%= node.root_password %>
network --hostname <%= node.hostname %> --noipv6
firewall --enabled --ssh
authconfig --enableshadow --passalgo=sha512 --enablefingerprint
timezone --utc America/Los_Angeles
# Avoid having 'rhgb quiet' on the boot line
bootloader --location=mbr --append="crashkernel=auto"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
zerombr
clearpart --all --initlabel
# Create primary partitions
part biosboot --fstype=biosboot                   --size=1
part /boot --fstype "xfs"                         --size=512 --asprimary
part swap --fstype swap                           --size=1024 --recommended --maxsize=32768
part btrfs.01                                     --size=1024 --grow

btrfs none --label=system/                          btrfs.01
btrfs / --subvol --name=@                           LABEL=system/
btrfs /home --subvol --name=@home                   LABEL=system/
btrfs /var --subvol --name=@var                     LABEL=system/
btrfs /var/log --subvol --name=@varlog              LABEL=system/
btrfs /tmp --subvol --name=@temp                    LABEL=system/
btrfs /var/log/audit --subvol --name=@varlogaudit   LABEL=system/

# reboot automatically
reboot

%packages --nobase
@core
@base
btrfs-progs
xfsdump
xfsprogs
nano
openssh-clients

%end

%post --log=/var/log/razor.log
echo Kickstart post

curl -s -o /root/razor_postinstall.sh <%= file_url("post_install") %>

# Run razor_postinstall.sh on next boot via rc.local
if [ ! -f /etc/rc.d/rc.local ]; then
  # On systems using systemd /etc/rc.d/rc.local does not exist at all
  # though systemd is set up to run the file if it exists
  touch /etc/rc.d/rc.local
  chmod a+x /etc/rc.d/rc.local
fi
echo bash /root/razor_postinstall.sh >> /etc/rc.d/rc.local
chmod +x /root/razor_postinstall.sh

curl -s <%= stage_done_url("kickstart") %>
%end
############
```

Scott McClellan

unread,
Mar 6, 2015, 7:16:51 PM3/6/15
to puppet...@googlegroups.com
Hi Alex,

I would expect to see a GET to retrieve the post_install script in the razor log for the node. Try `razor nodes $name log` and see if it pulls down the script? If it gets past that point, can you see the contents of the file in the /etc/rc.d/rc.local file? Beyond that, it might be helpful to try running the /etc/rc.d/rc.local file manually if it has the expected contents, which should have more debugging info. Does running that script fail or succeed? If it fails, you should see a reason for the failure. If it succeeds, perhaps /etc/rc.d/rc.local isn't being executed at all?

Just a few thoughts; shoot back if you have answers to these.

Scott



--
You received this message because you are subscribed to the Google Groups "puppet-razor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-razor...@googlegroups.com.
To post to this group, send email to puppet...@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-razor.
For more options, visit https://groups.google.com/d/optout.



--
Join us at PuppetConf 2015, October 5-9 in Portland, OR - http://2015.puppetconf.com.  
Register early to save 40%!

Alex Scoble

unread,
Mar 6, 2015, 7:29:23 PM3/6/15
to puppet...@googlegroups.com
Hi Scott,

Thanks for the reply. rc.local is there, but its mode has not been changed to allow execute.

--Alex

Scott McClellan

unread,
Mar 6, 2015, 9:36:45 PM3/6/15
to puppet...@googlegroups.com
Hi Alex,

Can you send the permissions you are seeing for the rc.local file when provisioning finishes? That file might exist before that script gets triggered, meaning the +x doesn't get executed. I'm not aware of any necessary differences between EL6 and EL7 when it comes to rc.local, but the rc.local file permissions could be a lead.

Scott

Scott McClellan

unread,
Mar 7, 2015, 6:09:52 AM3/7/15
to puppet...@googlegroups.com
Hi Alex,

Looks like it was indeed an issue with our kickstart file. I was able to reproduce the issue with Centos 7, seeing the same issue of the rc.local file not being executed/appearing executable. I modified the kickstart.erb file to put this line outside the conditional, like so:

if [ ! -f /etc/rc.d/rc.local ]; then
  # On systems using systemd /etc/rc.d/rc.local does not exist at all
  # though systemd is set up to run the file if it exists
  touch /etc/rc.d/rc.local
fi
chmod a+x /etc/rc.d/rc.local # this line

After that, I performed the install again and it ran the file (but didn't install PE). Reading the install log (/var/log/razor.log) showed I didn't have the packages for EL7 on the puppet master. Easily fixable, and that shows it is running the broker.

I have merged the change into the base redhat task (tracked by PR 286), feel free to update your copy.

Scott
Message has been deleted

Alex Scoble

unread,
Mar 9, 2015, 12:49:59 PM3/9/15
to puppet...@googlegroups.com
Hi Scott,

Don't you need the chmod on both sides of the if statement? As written on RHEL 6, the file will be created, but will not get the right permissions, I think.

--Alex


Scott McClellan

unread,
Mar 9, 2015, 12:54:47 PM3/9/15
to puppet...@googlegroups.com
Hi Alex,

Both execution paths will execute the `chmod` since it is outside the `if` statement.

Scott

--
You received this message because you are subscribed to the Google Groups "puppet-razor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-razor...@googlegroups.com.
To post to this group, send email to puppet...@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-razor.
For more options, visit https://groups.google.com/d/optout.

Alex Scoble

unread,
Mar 9, 2015, 2:43:59 PM3/9/15
to puppet...@googlegroups.com
Yeah, my bad...thanks!

--Alex
Reply all
Reply to author
Forward
0 new messages