Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1305824 - foreman_scap_client crontab entry is not removed when a Compliance Policy is removed
Summary: foreman_scap_client crontab entry is not removed when a Compliance Policy is ...
Keywords:
Status: CLOSED DUPLICATE of bug 1362665
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: SCAP Plugin
Version: 6.1.6
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-09 10:34 UTC by David Sanz
Modified: 2017-03-16 16:13 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-23 10:01:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description David Sanz 2016-02-09 10:34:36 UTC
Description of problem:
Puppet class correctly creates an entry in the root crontab but, if the compliance policy is deleted, the entry is not being removed:


Version-Release number of selected component (if applicable):

# cat /usr/share/puppet/modules/foreman_scap_client/metadata.json 
{
  "name": "isimluk-foreman_scap_client",
  "version": "0.3.6",
  "author": "isimluk",
  "summary": "This puppet module configures foreman_scap_client.",
  "license": "GNU General Public License, version 2 (GPLv2)",
  "source": "https://github.com/OpenSCAP/puppet-foreman_scap_client.git",
  "project_page": "https://github.com/OpenSCAP/puppet-foreman_scap_client",
  "issues_url": "https://github.com/OpenSCAP/puppet-foreman_scap_client/issues",
  "dependencies": [
    { "name": "puppetlabs/stdlib",        "version_requirement": ">= 4.2.0" }
  ]
}

# rpm -qa | grep foreman_scap
rubygem-foreman_scap_client-0.1.0.4-1.el6_6sat.noarch

# rpm -qa | grep foreman_scap
puppet-foreman_scap_client-0.3.3-10.el7sat.noarch


How reproducible:


Steps to Reproduce:
1.Delete the compliance policy in the Satellite WebUI
2.Execute puppet agent -t in the client
3.# crontab -l from the root account

Actual results:
# crontab -l
# HEADER: This file was autogenerated at Tue Feb 09 10:21:06 +0000 2016 by puppet.
# HEADER: While it can still be managed manually, it is definitely not recommended.
# HEADER: Note particularly that the comments starting with 'Puppet Name' should
# HEADER: not be deleted, as doing so could cause duplicate cron jobs.
# Puppet Name: foreman_scap_client_3
0 13 * * * /usr/bin/foreman_scap_client 3

# puppet agent -t
Info: Retrieving plugin
Info: Loading facts in /var/lib/puppet/lib/facter/rh_certificates.rb
Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
Info: Loading facts in /var/lib/puppet/lib/facter/pe_version.rb
Info: Loading facts in /var/lib/puppet/lib/facter/root_home.rb
Info: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb
Info: Caching catalog for testrhel.n1data.lan
Warning: The package type's allow_virtual parameter will be changing its default value from false to true in a future release. If you do not want to allow virtual packages, please explicitly set allow_virtual to false.
   (at /usr/lib/ruby/site_ruby/1.8/puppet/type.rb:816:in `set_default')
Info: Applying configuration version '1455013339'
Notice: /Stage[main]/Foreman_scap_client/File[foreman_scap_client]/content: 
--- /etc/foreman_scap_client/config.yaml	2016-02-09 09:29:57.630806269 +0000
+++ /tmp/puppet-file20160209-30050-2f986v-0	2016-02-09 10:22:20.304803075 +0000
@@ -21,10 +21,3 @@
 
 # policy (key is id as in Foreman)
 
-3:
-  :profile: 'xccdf_org.ssgproject.content_profile_common'
-  :content_path: '/var/lib/openscap/content/6298742afc45309f86ac467c0c9a3e433ff505dd3d237dd8cbf72be1a02937bb.xml'
-  # Download path
-  # A path to download SCAP content from proxy
-  :download_path: '/compliance/policies/3/content'
-

Info: /Stage[main]/Foreman_scap_client/File[foreman_scap_client]: Filebucketed /etc/foreman_scap_client/config.yaml to puppet with sum 74da6ab6e27352fbeaecbf0ed46f322b
Notice: /Stage[main]/Foreman_scap_client/File[foreman_scap_client]/content: content changed '{md5}74da6ab6e27352fbeaecbf0ed46f322b' to '{md5}aeeebbd70a42b09128e3304654bd2a14'
Notice: Finished catalog run in 0.20 seconds

# crontab -l
# HEADER: This file was autogenerated at Tue Feb 09 10:21:06 +0000 2016 by puppet.
# HEADER: While it can still be managed manually, it is definitely not recommended.
# HEADER: Note particularly that the comments starting with 'Puppet Name' should
# HEADER: not be deleted, as doing so could cause duplicate cron jobs.
# Puppet Name: foreman_scap_client_3
0 13 * * * /usr/bin/foreman_scap_client 3

# /usr/bin/foreman_scap_client 3
/usr/lib/ruby/gems/1.8/gems/foreman_scap_client-0.1.0.4/lib/foreman_scap_client/client.rb:121:in `ensure_scan_file': undefined method `[]' for nil:NilClass (NoMethodError)
	from /usr/lib/ruby/gems/1.8/gems/foreman_scap_client-0.1.0.4/lib/foreman_scap_client/client.rb:14:in `run'
	from /usr/bin/foreman_scap_client:10

Expected results:
crontab entry removed

Additional info:

Comment 1 Bryan Kearney 2016-07-26 19:05:21 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 2 Ondřej Pražák 2016-11-23 10:01:13 UTC
This was fixed as a part of https://bugzilla.redhat.com/show_bug.cgi?id=1362665
Entries from root crontab were moved to '/etc/cron.d/foreman_scap_client_cron', which is correctly updated by Puppet.

*** This bug has been marked as a duplicate of bug 1362665 ***


Note You need to log in before you can comment on or make changes to this bug.