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

fixes #16560 - use new snippets for config management #6317

Merged
merged 1 commit into from
Sep 21, 2016
Merged

fixes #16560 - use new snippets for config management #6317

merged 1 commit into from
Sep 21, 2016

Conversation

stbenjam
Copy link
Contributor

@stbenjam stbenjam commented Sep 14, 2016

Goes along with theforeman/community-templates#299. Users will need to specifically set an "enable-puppet4" param if they want puppet 4.

The eventual goal is to get rid of these templates, but after looking at this today, it's pretty involved. We need to make Katello work with the redhat snippet in foreman https://github.com/theforeman/community-templates/blob/develop/snippets/redhat_register.erb#L16-L42, among some other changes possibly.

@beav
Copy link
Contributor

beav commented Sep 20, 2016

@stbenjam i'm not really familiar with this area, what is the best way to test this PR?

@stbenjam
Copy link
Contributor Author

Well if you really want to test, the only way to do it is provision a client.

The goal of theforeman/forklift#295 is to make that a little easier, it sets up an all-in-one libvirt provisioning environment. It's still a bunch of steps as not everything can be automated, but at least it's like 7 steps instead of 40.

@beav
Copy link
Contributor

beav commented Sep 20, 2016

@stbenjam i'll give theforeman/forklift#295 a shot, thx

@stbenjam
Copy link
Contributor Author

There actually might be an issue since theforeman/puppet-foreman_proxy#267 was merged, I'll have a fix for it shortly if you want to hold off running the playbook until after lunch

@beav
Copy link
Contributor

beav commented Sep 20, 2016

ya i can hold off, no worries

@beav
Copy link
Contributor

beav commented Sep 20, 2016

(assigning this to myself to test a script)

@beav beav self-assigned this Sep 20, 2016
@beav
Copy link
Contributor

beav commented Sep 21, 2016

@stbenjam after provisioning, I get pretty close but it looks like the server hostnames are all just "puppet", and the provisioned system is unable to get its cert

@stbenjam
Copy link
Contributor Author

Did you follow the notes here and modify the puppet_setup snippet? theforeman/forklift#295 (comment)

@beav
Copy link
Contributor

beav commented Sep 21, 2016

I added it to /usr/share/foreman/app/views/unattended/snippets/_puppet_setup.erb. I also confirmed that enable_puppet4 was in the params for the forklift centos 7 HG

@stbenjam
Copy link
Contributor Author

Yea, that's the problem, sorry. It's a little confusing - updating files doesn't change the template, they're stored in the DB. The files are only read by db:seeds.

You need to go into the templates page in the UI and edit it (and potentially unlock it). Or, edit the files and run db:seed again.

Either way, confirm the contents of the puppet_setup snippet has the extra or condition in it for enable-puppet4.

@beav
Copy link
Contributor

beav commented Sep 21, 2016

@stbenjam I am still having trouble with this, I'm not sure where I am going wrong.

I made the following changes to the templates:

  • altered puppet_setup:
elsif @host.param_true?('enable-puppetlabs-pc1-repo') || @host.param_true?('enable-puppet4')
  • altered puppet.conf:
  if (@host.param_true?('enable-puppetlabs-pc1-repo') || @host.param_true?('enable-puppet4')) && (@host.operatingsystem.family == 'Debian' || @host.operatingsystem.family == 'Redhat')

After that I hit the "rebuild pxe default" button, not sure if that matters.

I still have the nested guest running if there's anything you want me to look at on the guest.

@stbenjam
Copy link
Contributor Author

stbenjam commented Sep 21, 2016

No need to touch puppet.conf, or the rebuild pxe default.

You rebuilt the guest after making the changes? You included the changes here from this PR in the templates (particularly Katello kickstart default)?

Can you share the rendered kickstart? Go to the host page, click the 'Templates' tab and on "Provisioning template" click Review.

review

@beav
Copy link
Contributor

beav commented Sep 21, 2016

ah, it looks like it is using /etc/puppet still which does not exist:


# and add the puppet package
yum -t -y -e 0 install puppet

echo "Configuring puppet"
cat > /etc/puppet/puppet.conf << EOF


[main]
vardir = /opt/puppetlabs/puppet/cache
logdir = /var/log/puppetlabs/puppet
rundir = /var/run/puppetlabs
ssldir = /etc/puppetlabs/puppet/ssl

[agent]
pluginsync      = true
report          = true
ignoreschedules = true
ca_server       = centos7-provision-nightly.example.com
certname        = sandy-wintle.example.com
environment     = production
server          = centos7-provision-nightly.example.com

EOF

# Setup puppet to run on system reboot
/sbin/chkconfig --level 345 puppet on

/usr/bin/puppet agent --config /etc/puppet/puppet.conf -o --tags no_such_tag --server centos7-provision-nightly.example.com --no-daemonize

sync

@stbenjam
Copy link
Contributor Author

You updated Katello kickstart default with the changes from this PR?

@stbenjam
Copy link
Contributor Author

That looks like the old puppet.conf snippet, not the new puppet_setup one to me.

@beav
Copy link
Contributor

beav commented Sep 21, 2016

@stbenjam i did not :( I only made the change on the filesystem for this PR, and added 299 in the template editor. I'll make the additional template changes now

@beav
Copy link
Contributor

beav commented Sep 21, 2016

ACK

Notice: /Stage[main]/Motd/File[/etc/motd]/content: 
--- /etc/motd   2013-06-07 14:31:32.000000000 +0000
+++ /tmp/puppet-file20160921-10559-1ah1c8e      2016-09-21 20:21:07.178000000 +0000
@@ -0,0 +1,3 @@
+The operating system is CentOS
+The free memory is 742.13 MiB
+The domain is example.com

Notice: /Stage[main]/Motd/File[/etc/motd]/content: content changed '{md5}d41d8cd98f00b204e9800998ecf8427e' to '{md5}407fc2a03b9194f96735f466f5928b5c'
Notice: Applied catalog in 0.06 seconds

@stbenjam stbenjam merged commit e4fb873 into Katello:master Sep 21, 2016
@stbenjam stbenjam deleted the 16560 branch September 21, 2016 23:32
@beav
Copy link
Contributor

beav commented Sep 21, 2016

🏃 🏃 🏃 🏃

(pretend it is four marionette puppets)

johnpmitsch pushed a commit to johnpmitsch/katello that referenced this pull request Oct 4, 2016
jlsherrill pushed a commit that referenced this pull request Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants