{"action":"created","comment":{"url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/pulls/comments/24533206","id":24533206,"diff_hunk":"@@ -0,0 +1,75 @@\n+require 'spec_helper'\n+describe 'pam::service', :type => :define do\n+  context 'on a RedHat OS' do\n+    let(:facts) {\n+      {\n+        :osfamily                   => 'RedHat',\n+        :operatingsystemmajrelease  => '5',\n+      }\n+    }\n+    context 'with no parameters' do\n+      let(:title) { 'test' }\n+      it { should contain_class('pam') }\n+      it { should contain_file('pam.d-service-test').with(\n+        'ensure'  => 'file',\n+        'owner'   => 'root',\n+        'group'   => 'root',\n+        'mode'    => '0644',\n+        'content' => nil\n+      ) }\n+    end\n+    context 'when absent' do\n+      let(:title) { 'test' }\n+      let :params do\n+          {\n+            :ensure  => 'absent'\n+          }\n+        end\n+      it { should contain_file('pam.d-service-test').with(\n+        'ensure'  => 'absent'\n+      ) }\n+    end\n+    context 'when given content' do\n+      let(:title) { 'test' }\n+      let :params do\n+          {\n+            :content  => 'session required pam_permit.so'\n+          }\n+        end\n+      it { should contain_file('pam.d-service-test').with_content(\n+        'session required pam_permit.so'\n+      ) }\n+    end\n+    context 'when given an array of lines' do\n+      let(:title) { 'test' }\n+      let :params do\n+          {\n+            :lines  => [\n+              '@include common-auth',\n+              '@include common-account',\n+              'session required pam_permit.so',\n+              'session required pam_limits.so'\n+            ]\n+          }\n+        end\n+      it { should contain_file('pam.d-service-test').with_content(","path":"spec/defines/service_spec.rb","position":55,"original_position":55,"commit_id":"4532f01527f4eb0da54b15099c36a1a34054463e","original_commit_id":"4532f01527f4eb0da54b15099c36a1a34054463e","user":{"login":"Aethylred","id":90848,"avatar_url":"https://avatars.githubusercontent.com/u/90848?v=3","gravatar_id":"","url":"https://api.github.com/users/Aethylred","html_url":"https://github.com/Aethylred","followers_url":"https://api.github.com/users/Aethylred/followers","following_url":"https://api.github.com/users/Aethylred/following{/other_user}","gists_url":"https://api.github.com/users/Aethylred/gists{/gist_id}","starred_url":"https://api.github.com/users/Aethylred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aethylred/subscriptions","organizations_url":"https://api.github.com/users/Aethylred/orgs","repos_url":"https://api.github.com/users/Aethylred/repos","events_url":"https://api.github.com/users/Aethylred/events{/privacy}","received_events_url":"https://api.github.com/users/Aethylred/received_events","type":"User","site_admin":false},"body":"I had been wondering how to do that (even if it is ugly).","created_at":"2015-02-11T21:06:01Z","updated_at":"2015-02-11T21:06:01Z","html_url":"https://github.com/ghoneycutt/puppet-module-pam/pull/100#discussion_r24533206","pull_request_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/pulls/100","_links":{"self":{"href":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/pulls/comments/24533206"},"html":{"href":"https://github.com/ghoneycutt/puppet-module-pam/pull/100#discussion_r24533206"},"pull_request":{"href":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/pulls/100"}}},"pull_request":{"url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/pulls/100","id":28890696,"html_url":"https://github.com/ghoneycutt/puppet-module-pam/pull/100","diff_url":"https://github.com/ghoneycutt/puppet-module-pam/pull/100.diff","patch_url":"https://github.com/ghoneycutt/puppet-module-pam/pull/100.patch","issue_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/issues/100","number":100,"state":"open","locked":false,"title":"Make pam::service resources reversible","user":{"login":"Aethylred","id":90848,"avatar_url":"https://avatars.githubusercontent.com/u/90848?v=3","gravatar_id":"","url":"https://api.github.com/users/Aethylred","html_url":"https://github.com/Aethylred","followers_url":"https://api.github.com/users/Aethylred/followers","following_url":"https://api.github.com/users/Aethylred/following{/other_user}","gists_url":"https://api.github.com/users/Aethylred/gists{/gist_id}","starred_url":"https://api.github.com/users/Aethylred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aethylred/subscriptions","organizations_url":"https://api.github.com/users/Aethylred/orgs","repos_url":"https://api.github.com/users/Aethylred/repos","events_url":"https://api.github.com/users/Aethylred/events{/privacy}","received_events_url":"https://api.github.com/users/Aethylred/received_events","type":"User","site_admin":false},"body":"What can be locked with puppet, can now be unlocked with puppet.\r\n\r\nPreviously if you defined a pam::service resource and then removed it, the content would remain on the node. This could leave vital services (e.g. `sudo`) locked and unusable. This PR does the following:\r\n\r\n* adds an `ensure` parameter to `pam::service` to actively remove resources created on the node when set to `absent`\r\n* adds a `lines` parameter to `pam::service` so it can be handed an array of strings like the other resources in the module.\r\n* Includes spec tests for `pam::service` which were not done at all previously.","created_at":"2015-02-09T00:54:41Z","updated_at":"2015-02-11T21:06:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd661018f3f40188c2e99478081da746d58ebc1b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/pulls/100/commits","review_comments_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/pulls/100/comments","review_comment_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/issues/100/comments","statuses_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/statuses/4532f01527f4eb0da54b15099c36a1a34054463e","head":{"label":"Aethylred:service","ref":"service","sha":"4532f01527f4eb0da54b15099c36a1a34054463e","user":{"login":"Aethylred","id":90848,"avatar_url":"https://avatars.githubusercontent.com/u/90848?v=3","gravatar_id":"","url":"https://api.github.com/users/Aethylred","html_url":"https://github.com/Aethylred","followers_url":"https://api.github.com/users/Aethylred/followers","following_url":"https://api.github.com/users/Aethylred/following{/other_user}","gists_url":"https://api.github.com/users/Aethylred/gists{/gist_id}","starred_url":"https://api.github.com/users/Aethylred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aethylred/subscriptions","organizations_url":"https://api.github.com/users/Aethylred/orgs","repos_url":"https://api.github.com/users/Aethylred/repos","events_url":"https://api.github.com/users/Aethylred/events{/privacy}","received_events_url":"https://api.github.com/users/Aethylred/received_events","type":"User","site_admin":false},"repo":{"id":29948056,"name":"puppet-module-pam","full_name":"Aethylred/puppet-module-pam","owner":{"login":"Aethylred","id":90848,"avatar_url":"https://avatars.githubusercontent.com/u/90848?v=3","gravatar_id":"","url":"https://api.github.com/users/Aethylred","html_url":"https://github.com/Aethylred","followers_url":"https://api.github.com/users/Aethylred/followers","following_url":"https://api.github.com/users/Aethylred/following{/other_user}","gists_url":"https://api.github.com/users/Aethylred/gists{/gist_id}","starred_url":"https://api.github.com/users/Aethylred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aethylred/subscriptions","organizations_url":"https://api.github.com/users/Aethylred/orgs","repos_url":"https://api.github.com/users/Aethylred/repos","events_url":"https://api.github.com/users/Aethylred/events{/privacy}","received_events_url":"https://api.github.com/users/Aethylred/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Aethylred/puppet-module-pam","description":"Puppet module to manage PAM","fork":true,"url":"https://api.github.com/repos/Aethylred/puppet-module-pam","forks_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/forks","keys_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/teams","hooks_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/hooks","issue_events_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/issues/events{/number}","events_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/events","assignees_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/assignees{/user}","branches_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/branches{/branch}","tags_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/tags","blobs_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/git/refs{/sha}","trees_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/statuses/{sha}","languages_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/languages","stargazers_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/stargazers","contributors_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/contributors","subscribers_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/subscribers","subscription_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/subscription","commits_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/commits{/sha}","git_commits_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/git/commits{/sha}","comments_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/comments{/number}","issue_comment_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/issues/comments/{number}","contents_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/contents/{+path}","compare_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/merges","archive_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/downloads","issues_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/issues{/number}","pulls_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/pulls{/number}","milestones_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/milestones{/number}","notifications_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/labels{/name}","releases_url":"https://api.github.com/repos/Aethylred/puppet-module-pam/releases{/id}","created_at":"2015-01-28T03:12:08Z","updated_at":"2015-02-08T21:00:22Z","pushed_at":"2015-02-09T03:50:37Z","git_url":"git://github.com/Aethylred/puppet-module-pam.git","ssh_url":"git@github.com:Aethylred/puppet-module-pam.git","clone_url":"https://github.com/Aethylred/puppet-module-pam.git","svn_url":"https://github.com/Aethylred/puppet-module-pam","homepage":null,"size":392,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ghoneycutt:master","ref":"master","sha":"747ada283e43dc2d5457e85a23d58ba8937983f7","user":{"login":"ghoneycutt","id":313891,"avatar_url":"https://avatars.githubusercontent.com/u/313891?v=3","gravatar_id":"","url":"https://api.github.com/users/ghoneycutt","html_url":"https://github.com/ghoneycutt","followers_url":"https://api.github.com/users/ghoneycutt/followers","following_url":"https://api.github.com/users/ghoneycutt/following{/other_user}","gists_url":"https://api.github.com/users/ghoneycutt/gists{/gist_id}","starred_url":"https://api.github.com/users/ghoneycutt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghoneycutt/subscriptions","organizations_url":"https://api.github.com/users/ghoneycutt/orgs","repos_url":"https://api.github.com/users/ghoneycutt/repos","events_url":"https://api.github.com/users/ghoneycutt/events{/privacy}","received_events_url":"https://api.github.com/users/ghoneycutt/received_events","type":"User","site_admin":false},"repo":{"id":10097674,"name":"puppet-module-pam","full_name":"ghoneycutt/puppet-module-pam","owner":{"login":"ghoneycutt","id":313891,"avatar_url":"https://avatars.githubusercontent.com/u/313891?v=3","gravatar_id":"","url":"https://api.github.com/users/ghoneycutt","html_url":"https://github.com/ghoneycutt","followers_url":"https://api.github.com/users/ghoneycutt/followers","following_url":"https://api.github.com/users/ghoneycutt/following{/other_user}","gists_url":"https://api.github.com/users/ghoneycutt/gists{/gist_id}","starred_url":"https://api.github.com/users/ghoneycutt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghoneycutt/subscriptions","organizations_url":"https://api.github.com/users/ghoneycutt/orgs","repos_url":"https://api.github.com/users/ghoneycutt/repos","events_url":"https://api.github.com/users/ghoneycutt/events{/privacy}","received_events_url":"https://api.github.com/users/ghoneycutt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ghoneycutt/puppet-module-pam","description":"Puppet module to manage PAM","fork":false,"url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam","forks_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/forks","keys_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/teams","hooks_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/hooks","issue_events_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/issues/events{/number}","events_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/events","assignees_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/assignees{/user}","branches_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/branches{/branch}","tags_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/tags","blobs_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/git/refs{/sha}","trees_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/statuses/{sha}","languages_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/languages","stargazers_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/stargazers","contributors_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/contributors","subscribers_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/subscribers","subscription_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/subscription","commits_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/commits{/sha}","git_commits_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/git/commits{/sha}","comments_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/comments{/number}","issue_comment_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/issues/comments/{number}","contents_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/contents/{+path}","compare_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/merges","archive_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/downloads","issues_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/issues{/number}","pulls_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/pulls{/number}","milestones_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/milestones{/number}","notifications_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/labels{/name}","releases_url":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/releases{/id}","created_at":"2013-05-16T09:08:32Z","updated_at":"2015-02-05T13:31:53Z","pushed_at":"2015-02-05T13:31:51Z","git_url":"git://github.com/ghoneycutt/puppet-module-pam.git","ssh_url":"git@github.com:ghoneycutt/puppet-module-pam.git","clone_url":"https://github.com/ghoneycutt/puppet-module-pam.git","svn_url":"https://github.com/ghoneycutt/puppet-module-pam","homepage":null,"size":1234,"stargazers_count":2,"watchers_count":2,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":8,"forks":34,"open_issues":8,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/pulls/100"},"html":{"href":"https://github.com/ghoneycutt/puppet-module-pam/pull/100"},"issue":{"href":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/issues/100"},"comments":{"href":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/issues/100/comments"},"review_comments":{"href":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/pulls/100/comments"},"review_comment":{"href":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/pulls/100/commits"},"statuses":{"href":"https://api.github.com/repos/ghoneycutt/puppet-module-pam/statuses/4532f01527f4eb0da54b15099c36a1a34054463e"}}}}