{"action":"created","comment":{"url":"https://api.github.com/repos/rhtconsulting/rhc-ose/pulls/comments/57830653","id":57830653,"diff_hunk":"@@ -0,0 +1,95 @@\n+# Red Hat Subscription Manager Ansible Role\n+\n+## Parameters\n+\n+This role depends on user specified variables. These can be set in the inventory file, group_vars or passed to the playbook from the CLI. The variables are:\n+\n+### rhsm_method\n+\n+Subscription Manager method to use for registration. Valid values are:\n+\n+* **satellite** - Use a Satellite server. Additional variables required include **rhsm_server**, **rhsm_org** and either (**rhsm_username** and **rhsm_password**) or **rhsm_activationkey**\n+* **hosted** - Use Red Hat's CDN. Additional variables required are **rhsm_server** (defaults to RHSM CDN) and **rhsm_username** and **rhsm_password**\n+* none/false/blank will disable any subscription manager activities (this is the default if no parameters are set)\n+\n+Default: none\n+\n+### rhsm_server\n+\n+Subscription Manager server hostname. If using a Satellite server set the FQDN here. If using RHSM Hosted this value is ignored.\n+\n+Default: none\n+\n+### rhsm_username\n+\n+Subscription Manager username. Required for RHSM Hosted. Can be optionally used for Satellite, but it may be better to use **rhsm_activationkey** for this.\n+\n+Default: none\n+\n+### rhsm_password\n+\n+Subscription Manager password. Required for RHSM Hosted. Can be optionally used for Satellite, but it may be better to use **rhsm_activationkey** for this.\n+\n+Default: none\n+\n+### rhsm_org\n+\n+Optional Satellite Subscription Manager Organization. Required for Satellite, ignored if using RHSM Hosted.\n+\n+Default: none\n+\n+### rhsm_activationkey\n+\n+Optional Satellite Subscription Manager Activation Key, use this instead of **rhsm_username** and **rhsm_password** if using Satellite to provide repositories and authentication in a key instead.\n+\n+Default: none\n+\n+### rhsm_pool\n+\n+Optional Subscription Manager pool, determine this by running **subscription-manager list --available** on a registered system. Valid for RHSM Hosted or Satellite. Specifying **rhsm_activationkey** will ignore this option.\n+\n+Default: none\n+\n+### rhsm_repos\n+\n+Optional Repositories to enable, this can also be specified in the **rhsm_activationkey**. Valid for RHSM Hosted or Satellite. Specifying **rhsm_activationkey** will ignore this option.\n+\n+NOTE: If specifying this value in an inventory file as opposed to group_vars, be sure to define it as a proper list as such:\n+\n+rhsm_repos='[\"rhel-7-server-rpms\", \"rhel-7-server-ose-3.1-rpms\", \"rhel-7-server-extras-rpms\"]'\n+\n+Default: none\n+\n+## Pre-tasks\n+\n+A number of variable checks are performed before any tasks to ensure the proper parameters are set. To include these checks call the pre_task yaml before any roles:\n+\n+```\n+  pre_tasks:\n+  - include: roles/subscription-manager/pre_tasks/pre_tasks.yml \n+```\n+\n+## Tasks\n+\n+The bulk of the work is performed in the main.yml for this role. The pre-task play will set a variable which can be checked to contitionally include this role as such:\n+\n+```\n+  roles:\n+    - { role: subscription-manager, when: not hostvars.localhost.rhsm_skip, tags: 'subscription-manager' }\n+```\n+\n+## Running the Playbook\n+ \n+To register to RHSM Hosted with username and password:\n+\n+```\n+ansible-playbook -i inventory/ose-provision ose-provision.yml -e \"rhsm_method='hosted' rhsm_username=vvaldez rhsm_password='hunter2' openstack_key_name='vvaldez'\"\n+```\n+\n+To register to a Satellite server with an activation key:\n+\n+```\n+ansible-playbook -i inventory/ose-provision ose-provision.yml -e \"rhsm_server='10.12.32.1' rhsm_org='cloud_practice' rhsm_activationkey='rhel-7-ose-3-1' openstack_key_name='vvaldez' rhsm_method='satellite'\"","path":"rhc-ose-ansible/roles/subscription-manager/README.md","position":92,"original_position":92,"commit_id":"7f52e9d3783958bf623fadccaee7a12603a2d890","original_commit_id":"7f52e9d3783958bf623fadccaee7a12603a2d890","user":{"login":"etsauer","id":4500758,"avatar_url":"https://avatars.githubusercontent.com/u/4500758?v=3","gravatar_id":"","url":"https://api.github.com/users/etsauer","html_url":"https://github.com/etsauer","followers_url":"https://api.github.com/users/etsauer/followers","following_url":"https://api.github.com/users/etsauer/following{/other_user}","gists_url":"https://api.github.com/users/etsauer/gists{/gist_id}","starred_url":"https://api.github.com/users/etsauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etsauer/subscriptions","organizations_url":"https://api.github.com/users/etsauer/orgs","repos_url":"https://api.github.com/users/etsauer/repos","events_url":"https://api.github.com/users/etsauer/events{/privacy}","received_events_url":"https://api.github.com/users/etsauer/received_events","type":"User","site_admin":false},"body":"@vvaldez probably want to obfuscate environment specific suff here.","created_at":"2016-03-30T02:44:39Z","updated_at":"2016-03-30T02:44:39Z","html_url":"https://github.com/rhtconsulting/rhc-ose/pull/133#discussion_r57830653","pull_request_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/pulls/133","_links":{"self":{"href":"https://api.github.com/repos/rhtconsulting/rhc-ose/pulls/comments/57830653"},"html":{"href":"https://github.com/rhtconsulting/rhc-ose/pull/133#discussion_r57830653"},"pull_request":{"href":"https://api.github.com/repos/rhtconsulting/rhc-ose/pulls/133"}}},"pull_request":{"url":"https://api.github.com/repos/rhtconsulting/rhc-ose/pulls/133","id":64542312,"html_url":"https://github.com/rhtconsulting/rhc-ose/pull/133","diff_url":"https://github.com/rhtconsulting/rhc-ose/pull/133.diff","patch_url":"https://github.com/rhtconsulting/rhc-ose/pull/133.patch","issue_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/issues/133","number":133,"state":"open","locked":false,"title":"Add subscription-manager support for Hosted or Satellite","user":{"login":"vvaldez","id":1020491,"avatar_url":"https://avatars.githubusercontent.com/u/1020491?v=3","gravatar_id":"","url":"https://api.github.com/users/vvaldez","html_url":"https://github.com/vvaldez","followers_url":"https://api.github.com/users/vvaldez/followers","following_url":"https://api.github.com/users/vvaldez/following{/other_user}","gists_url":"https://api.github.com/users/vvaldez/gists{/gist_id}","starred_url":"https://api.github.com/users/vvaldez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvaldez/subscriptions","organizations_url":"https://api.github.com/users/vvaldez/orgs","repos_url":"https://api.github.com/users/vvaldez/repos","events_url":"https://api.github.com/users/vvaldez/events{/privacy}","received_events_url":"https://api.github.com/users/vvaldez/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\nAdds a subscription-manager role that can support RHSM Hosted or a Satellite server. Authentication can be username/password or an activation key. Repositories can also be passed in as a parameter.\r\n\r\n#### How should this be manually tested?\r\nFirst refer to the subscription-manager role from a playbook, then set the variables appropriate to your scenario. A full README has been included to describe all parameters.\r\n\r\n#### Is there a relevant Issue open for this?\r\nNo known issues.\r\n\r\n#### Who would you like to review this?\r\n/cc @oybed ","created_at":"2016-03-29T22:09:00Z","updated_at":"2016-03-30T02:44:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4f6d7ea43e5851144b8806c411754da6433831c1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/pulls/133/commits","review_comments_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/pulls/133/comments","review_comment_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/issues/133/comments","statuses_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/statuses/7f52e9d3783958bf623fadccaee7a12603a2d890","head":{"label":"vvaldez:subscription-manager","ref":"subscription-manager","sha":"7f52e9d3783958bf623fadccaee7a12603a2d890","user":{"login":"vvaldez","id":1020491,"avatar_url":"https://avatars.githubusercontent.com/u/1020491?v=3","gravatar_id":"","url":"https://api.github.com/users/vvaldez","html_url":"https://github.com/vvaldez","followers_url":"https://api.github.com/users/vvaldez/followers","following_url":"https://api.github.com/users/vvaldez/following{/other_user}","gists_url":"https://api.github.com/users/vvaldez/gists{/gist_id}","starred_url":"https://api.github.com/users/vvaldez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvaldez/subscriptions","organizations_url":"https://api.github.com/users/vvaldez/orgs","repos_url":"https://api.github.com/users/vvaldez/repos","events_url":"https://api.github.com/users/vvaldez/events{/privacy}","received_events_url":"https://api.github.com/users/vvaldez/received_events","type":"User","site_admin":false},"repo":{"id":54612315,"name":"rhc-ose","full_name":"vvaldez/rhc-ose","owner":{"login":"vvaldez","id":1020491,"avatar_url":"https://avatars.githubusercontent.com/u/1020491?v=3","gravatar_id":"","url":"https://api.github.com/users/vvaldez","html_url":"https://github.com/vvaldez","followers_url":"https://api.github.com/users/vvaldez/followers","following_url":"https://api.github.com/users/vvaldez/following{/other_user}","gists_url":"https://api.github.com/users/vvaldez/gists{/gist_id}","starred_url":"https://api.github.com/users/vvaldez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvaldez/subscriptions","organizations_url":"https://api.github.com/users/vvaldez/orgs","repos_url":"https://api.github.com/users/vvaldez/repos","events_url":"https://api.github.com/users/vvaldez/events{/privacy}","received_events_url":"https://api.github.com/users/vvaldez/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vvaldez/rhc-ose","description":"OpenShift Automation and Utilities by Red Hat Consulting","fork":true,"url":"https://api.github.com/repos/vvaldez/rhc-ose","forks_url":"https://api.github.com/repos/vvaldez/rhc-ose/forks","keys_url":"https://api.github.com/repos/vvaldez/rhc-ose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vvaldez/rhc-ose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vvaldez/rhc-ose/teams","hooks_url":"https://api.github.com/repos/vvaldez/rhc-ose/hooks","issue_events_url":"https://api.github.com/repos/vvaldez/rhc-ose/issues/events{/number}","events_url":"https://api.github.com/repos/vvaldez/rhc-ose/events","assignees_url":"https://api.github.com/repos/vvaldez/rhc-ose/assignees{/user}","branches_url":"https://api.github.com/repos/vvaldez/rhc-ose/branches{/branch}","tags_url":"https://api.github.com/repos/vvaldez/rhc-ose/tags","blobs_url":"https://api.github.com/repos/vvaldez/rhc-ose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vvaldez/rhc-ose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vvaldez/rhc-ose/git/refs{/sha}","trees_url":"https://api.github.com/repos/vvaldez/rhc-ose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vvaldez/rhc-ose/statuses/{sha}","languages_url":"https://api.github.com/repos/vvaldez/rhc-ose/languages","stargazers_url":"https://api.github.com/repos/vvaldez/rhc-ose/stargazers","contributors_url":"https://api.github.com/repos/vvaldez/rhc-ose/contributors","subscribers_url":"https://api.github.com/repos/vvaldez/rhc-ose/subscribers","subscription_url":"https://api.github.com/repos/vvaldez/rhc-ose/subscription","commits_url":"https://api.github.com/repos/vvaldez/rhc-ose/commits{/sha}","git_commits_url":"https://api.github.com/repos/vvaldez/rhc-ose/git/commits{/sha}","comments_url":"https://api.github.com/repos/vvaldez/rhc-ose/comments{/number}","issue_comment_url":"https://api.github.com/repos/vvaldez/rhc-ose/issues/comments{/number}","contents_url":"https://api.github.com/repos/vvaldez/rhc-ose/contents/{+path}","compare_url":"https://api.github.com/repos/vvaldez/rhc-ose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vvaldez/rhc-ose/merges","archive_url":"https://api.github.com/repos/vvaldez/rhc-ose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vvaldez/rhc-ose/downloads","issues_url":"https://api.github.com/repos/vvaldez/rhc-ose/issues{/number}","pulls_url":"https://api.github.com/repos/vvaldez/rhc-ose/pulls{/number}","milestones_url":"https://api.github.com/repos/vvaldez/rhc-ose/milestones{/number}","notifications_url":"https://api.github.com/repos/vvaldez/rhc-ose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vvaldez/rhc-ose/labels{/name}","releases_url":"https://api.github.com/repos/vvaldez/rhc-ose/releases{/id}","deployments_url":"https://api.github.com/repos/vvaldez/rhc-ose/deployments","created_at":"2016-03-24T03:36:20Z","updated_at":"2016-03-24T03:36:21Z","pushed_at":"2016-03-29T22:20:34Z","git_url":"git://github.com/vvaldez/rhc-ose.git","ssh_url":"git@github.com:vvaldez/rhc-ose.git","clone_url":"https://github.com/vvaldez/rhc-ose.git","svn_url":"https://github.com/vvaldez/rhc-ose","homepage":null,"size":1482,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"openshift-enterprise-3"}},"base":{"label":"rhtconsulting:openshift-enterprise-3","ref":"openshift-enterprise-3","sha":"558f8d354904a3204058859d89c8ca223b41b310","user":{"login":"rhtconsulting","id":11352795,"avatar_url":"https://avatars.githubusercontent.com/u/11352795?v=3","gravatar_id":"","url":"https://api.github.com/users/rhtconsulting","html_url":"https://github.com/rhtconsulting","followers_url":"https://api.github.com/users/rhtconsulting/followers","following_url":"https://api.github.com/users/rhtconsulting/following{/other_user}","gists_url":"https://api.github.com/users/rhtconsulting/gists{/gist_id}","starred_url":"https://api.github.com/users/rhtconsulting/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhtconsulting/subscriptions","organizations_url":"https://api.github.com/users/rhtconsulting/orgs","repos_url":"https://api.github.com/users/rhtconsulting/repos","events_url":"https://api.github.com/users/rhtconsulting/events{/privacy}","received_events_url":"https://api.github.com/users/rhtconsulting/received_events","type":"Organization","site_admin":false},"repo":{"id":41885529,"name":"rhc-ose","full_name":"rhtconsulting/rhc-ose","owner":{"login":"rhtconsulting","id":11352795,"avatar_url":"https://avatars.githubusercontent.com/u/11352795?v=3","gravatar_id":"","url":"https://api.github.com/users/rhtconsulting","html_url":"https://github.com/rhtconsulting","followers_url":"https://api.github.com/users/rhtconsulting/followers","following_url":"https://api.github.com/users/rhtconsulting/following{/other_user}","gists_url":"https://api.github.com/users/rhtconsulting/gists{/gist_id}","starred_url":"https://api.github.com/users/rhtconsulting/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhtconsulting/subscriptions","organizations_url":"https://api.github.com/users/rhtconsulting/orgs","repos_url":"https://api.github.com/users/rhtconsulting/repos","events_url":"https://api.github.com/users/rhtconsulting/events{/privacy}","received_events_url":"https://api.github.com/users/rhtconsulting/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rhtconsulting/rhc-ose","description":"OpenShift Automation and Utilities by Red Hat Consulting","fork":false,"url":"https://api.github.com/repos/rhtconsulting/rhc-ose","forks_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/forks","keys_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/teams","hooks_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/hooks","issue_events_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/issues/events{/number}","events_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/events","assignees_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/assignees{/user}","branches_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/branches{/branch}","tags_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/tags","blobs_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/git/refs{/sha}","trees_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/statuses/{sha}","languages_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/languages","stargazers_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/stargazers","contributors_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/contributors","subscribers_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/subscribers","subscription_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/subscription","commits_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/commits{/sha}","git_commits_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/git/commits{/sha}","comments_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/comments{/number}","issue_comment_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/issues/comments{/number}","contents_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/contents/{+path}","compare_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/merges","archive_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/downloads","issues_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/issues{/number}","pulls_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/pulls{/number}","milestones_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/milestones{/number}","notifications_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/labels{/name}","releases_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/releases{/id}","deployments_url":"https://api.github.com/repos/rhtconsulting/rhc-ose/deployments","created_at":"2015-09-03T21:49:55Z","updated_at":"2016-03-18T10:14:16Z","pushed_at":"2016-03-30T01:33:17Z","git_url":"git://github.com/rhtconsulting/rhc-ose.git","ssh_url":"git@github.com:rhtconsulting/rhc-ose.git","clone_url":"https://github.com/rhtconsulting/rhc-ose.git","svn_url":"https://github.com/rhtconsulting/rhc-ose","homepage":null,"size":11099,"stargazers_count":11,"watchers_count":11,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":31,"forks":15,"open_issues":31,"watchers":11,"default_branch":"openshift-enterprise-3"}},"_links":{"self":{"href":"https://api.github.com/repos/rhtconsulting/rhc-ose/pulls/133"},"html":{"href":"https://github.com/rhtconsulting/rhc-ose/pull/133"},"issue":{"href":"https://api.github.com/repos/rhtconsulting/rhc-ose/issues/133"},"comments":{"href":"https://api.github.com/repos/rhtconsulting/rhc-ose/issues/133/comments"},"review_comments":{"href":"https://api.github.com/repos/rhtconsulting/rhc-ose/pulls/133/comments"},"review_comment":{"href":"https://api.github.com/repos/rhtconsulting/rhc-ose/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rhtconsulting/rhc-ose/pulls/133/commits"},"statuses":{"href":"https://api.github.com/repos/rhtconsulting/rhc-ose/statuses/7f52e9d3783958bf623fadccaee7a12603a2d890"}}}}