{"id":13805601,"url":"https://github.com/projectatomic/adb-vagrant-registration","last_synced_at":"2025-05-13T19:31:29.454Z","repository":{"id":22072347,"uuid":"25401603","full_name":"projectatomic/adb-vagrant-registration","owner":"projectatomic","description":"A plugin to add \"register\" and \"unregister\" capabilities to Vagrant guests.","archived":false,"fork":false,"pushed_at":"2020-03-21T18:38:55.000Z","size":280,"stargazers_count":53,"open_issues_count":27,"forks_count":24,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-15T13:27:12.185Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/projectatomic.png","metadata":{"files":{"readme":"README.adoc","changelog":"CHANGELOG.adoc","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-18T15:42:13.000Z","updated_at":"2025-01-12T17:23:10.000Z","dependencies_parsed_at":"2022-08-19T04:50:08.993Z","dependency_job_id":null,"html_url":"https://github.com/projectatomic/adb-vagrant-registration","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectatomic%2Fadb-vagrant-registration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectatomic%2Fadb-vagrant-registration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectatomic%2Fadb-vagrant-registration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/projectatomic%2Fadb-vagrant-registration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/projectatomic","download_url":"https://codeload.github.com/projectatomic/adb-vagrant-registration/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254012978,"owners_count":21999346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T01:01:02.855Z","updated_at":"2025-05-13T19:31:29.125Z","avatar_url":"https://github.com/projectatomic.png","language":"Ruby","funding_links":[],"categories":["Notable plugins"],"sub_categories":[],"readme":"[[vagrant-registration]]\n= vagrant-registration\n:toc:\n:toc-placement!:\n\nThe vagrant-registration plugin for Vagrant allows developers to easily\nregister their guests for updates on systems with a subscription model\n(like Red Hat Enterprise Linux).\n\nThis plugin would run _register_ action on `vagrant up` before any\nprovisioning and _unregister_ on `vagrant halt` or `vagrant destroy`.\nThe actions then call the registration capabilities that have to be\nprovided for the given OS.\n\n'''\ntoc::[]\n'''\n\n== Installation\n\nInstall vagrant-registration as any other Vagrant plugin:\n\n[source,shell]\n----\n$ vagrant plugin install vagrant-registration\n----\n\nIf you are on Fedora, you can install the packaged version of the plugin\nby running:\n\n[source,shell]\n----\n# dnf install vagrant-registration\n----\n\n== Usage\n\nThe plugin is designed in a registration-manager agnostic way, which\nmeans, that the plugin itself, depends neither on any OS nor on the way\nof registration. The vagrant-registration plugin only calls registration\ncapabilities for the given guest, passes the configuration options to\nthem and handles interactive registration.\n\nThat being said, this plugin currently ships only with registration\ncapability files for RHEL's Subscription Manager and `rhn_register`.\nFeel free to submit others.\n\nTo configure the plugin, always include the configuration options\nmentioned in this file within the following configuration block in your\nVagrantfile.\n\n....\nVagrant.configure('2') do |config|\n  ...\nend\n....\n\n=== General Configuration\n\n* *skip* skips the registration. If you wish to skip the registration\nprocess altogether, you can do so by setting a `skip` option to `true`:\n\n[source,ruby]\n----\n  config.registration.skip = true\n----\n\n* *unregister_on_halt* disables or enables automatic unregistration on\nhalt (on shut down). By default the plugin unregisters on halt, you can\nhowever change that by setting the option to `false` so that the box\nwill unregister only on destroy:\n\n[source,ruby]\n----\n  config.registration.unregister_on_halt = false\n----\n\n* *manager* selects the registration manager provider. By default the\nplugin will use the `subscription_manager` as the registration manager\nprovider. You can however, change that by setting the option to a\ndifferent manager:\n\n[source,ruby]\n----\n  config.registration.manager = 'subscription_manager'\n----\n\n=== Credential Configuration\n\nYou can set up the credentials as follows:\n\n[source,ruby]\n----\nVagrant.configure('2') do |config|\n  ...\n  if Vagrant.has_plugin?('vagrant-registration')\n    config.registration.username = 'foo'\n    config.registration.password = 'bar'\n  end\n\n  # Alternatively\n  if Vagrant.has_plugin?('vagrant-registration')\n    config.registration.org = 'foo'\n    config.registration.activationkey = 'bar'\n  end\n  ...\nend\n----\n\nThis should go, preferably, into the Vagrantfile in your Vagrant home\ndirectory (defaults to ~/.vagrant.d), to make it available for every\nproject. It can be later overridden in an individual project's\nVagrantfile if needed.\n\nIf you prefer not to store your username and/or password on your\nfilesystem, you can optionally configure vagrant-registration plugin to\nuse environment variables such as:\n\n[source,ruby]\n----\nVagrant.configure('2') do |config|\n  ...\n  config.registration.username = ENV['SUB_USERNAME']\n  config.registration.password = ENV['SUB_PASSWORD']\n  ...\nend\n----\n\nIf you do not configure your credentials as outlined above, you will\nreceive a maximum of 3 prompts for them during the `vagrant up` process.\n\nPlease note that the interactive mode asks you for the preferred\nregistration pair only for the configured manager.\n\n=== HTTP Proxy Configuration\n\nHTTP Proxy can be configured via the __proxy__, _proxyUser_ and\n_proxyPassword_ configuration options:\n\n[source,ruby]\n----\nVagrant.configure('2') do |config|\n  ...\n  if Vagrant.has_plugin?('vagrant-registration')\n    config.registration.proxy = 'mongo:8080'\n    config.registration.proxyUser = 'flash'\n    config.registration.proxyPassword = 'zarkov'\n  end\n  ...\nend\n----\n\nAs described in the link:#credentials-configuration[credentials\nconfiguration] section, these settings can be placed either into the\nVagrantfile in the Vagrant home directory or provided as environment\nvariables.\n\n=== subscription-manager Configuration\n\nThe vagrant-registration plugin uses `subscription_manager` as the\ndefault manager. This can also be explicitly configured by setting the\n`manager` option to `subscription_manager`:\n\n[source,ruby]\n----\nVagrant.configure('2') do |config|\n  ...\n  if Vagrant.has_plugin?('vagrant-registration')\n    config.registration.manager = 'subscription_manager'\n  end\n  ...\nend\n----\n\nIn case you choose `subscription_manager` as the manager, you would be\nasked for your user credentials, such as the username and password.\n\nThe vagrant-registration plugin supports all the options for the\nsubscription-manager's register command. You can set any option easily\nby setting `config.registration.OPTION_NAME = 'OPTION_VALUE'` in your\nVagrantfile (please see the subscription-manager's documentation for\noption description).\n\n==== subscription-manager Default Options\n\n* **--force**: Subscription Manager will fail if you attempt to register\nan already registered machine (see the man page for explanation),\ntherefore vagrant-registration appends the `--force` flag automatically\nwhen subscribing. If you would like to disable this feature, set `force`\noption to `false`:\n\n[source,ruby]\n----\n  config.registration.force = false\n----\n\n* **--auto-attach**: Vagrant would fail to install packages on\nregistered RHEL system if the subscription is not attached, therefore\nvagrant-registration appends the `--auto-attach` flag automatically when\nsubscribing. To disable this option, set `auto_attach` option to\n`false`:\n\n[source,ruby]\n----\n  config.registration.auto_attach = false\n----\n\nNote that the `auto_attach` option is set to false when using\norg/activationkey for registration or if pools are specified.\n\n==== subscription-manager Options Reference\n\n[source,ruby]\n----\n  # The username to subscribe with (required)\n  config.registration.username\n\n  # The password of the subscriber (required)\n  config.registration.password\n\n  # Give the hostname of the subscription service to use (required for Subscription\n  # Asset Manager, defaults to Customer Portal Subscription Management)\n  config.registration.serverurl\n\n  # A path to a CA certificate, this file would be copied to /etc/rhsm/ca and\n  # if the file does not have .pem extension, it will be automatically added\n  config.registration.ca_cert\n\n  # Give the hostname of the content delivery server to use to receive updates\n  # (required for Satellite 6)\n  config.registration.baseurl\n\n  # Give the organization to which to join the system (required, except for\n  # hosted environments)\n  config.registration.org\n\n  # Register the system to an environment within an organization (optional)\n  config.registration.environment\n\n  # Name of the subscribed system (optional, defaults to hostname if unset)\n  config.registration.name\n\n  # Auto attach suitable subscriptions (optional, auto attach if true,\n  # defaults to true)\n  config.registration.auto_attach\n\n  # Attach existing subscriptions as part of the registration process (optional)\n  config.registration.activationkey\n\n  # Set the service level to use for subscriptions on that machine\n  # (optional, used only used with the --auto-attach)\n  config.registration.servicelevel\n\n  # Set the operating system minor release to use for subscriptions for\n  # the system (optional, used only used with the --auto-attach)\n  config.registration.release\n\n  # Force the registration (optional, force if true, defaults to true)\n  config.registration.force\n\n  # Set what type of consumer is being registered (optional, defaults to system)\n  config.registration.type\n\n  # Skip the registration (optional, skip if true, defaults to false)\n  config.registration.skip\n\n  # Specify a HTTP proxy to use. This config option if of the format [\u003chost\u003e|\u003cip\u003e:\u003cport\u003e], eg mongo:8080\n  config.registration.proxy\n\n  # Specify a username to use with an authenticated HTTP proxy\n  config.registration.proxyUser\n\n  # Specify a password to use with an authenticated HTTP proxy\n  config.registration.proxyPassword\n\n  # Attach to specified pool(s) (optional)\n  #\n  # Example:\n  #   config.registration.pools = [ 'POOL-ID-1', 'POOL-ID-2' ]\n  config.registration.pools\n----\n\n=== rhn-register Configuration\n\nvagrant-registration will use the `rhn_register` manager only if\nexplicitly configured by setting the `manager` option to `rhn_register`:\n\n[source,ruby]\n----\nVagrant.configure('2') do |config|\n  ...\n  if Vagrant.has_plugin?('vagrant-registration')\n    config.registration.manager = 'rhn_register'\n  end\n  ...\nend\n----\n\nIn case of a `rhn_register` manager, the preferred registration pair is\nthe username/password/serverurl combination.\n\nvagrant-registration supports most of the options of rhnreg_ks's\ncommand. You can set any option easily by setting\n`config.registration.OPTION_NAME = 'OPTION_VALUE'` in your Vagrantfile\n(please see the `rhnreg_ks`'s documentation for option description).\n\n`rhn_register` manager reuses the naming of `subscription-manager`'s\ncommand options where possible.\n\n==== rhn-register Default Options\n\n* **--force**: `rhnreg_ks` command will fail if you attempt to register\nan already registered machine (see the man page for explanation),\ntherefore vagrant-registration appends the `--force` flag automatically\nwhen subscribing. If you would like to disable this feature, set `force`\noption to `false`:\n\n[source,ruby]\n----\n  config.registration.force = false\n----\n\n==== rhn-register Options Reference\n\n[source,ruby]\n----\n  # The username to register the system with under Spacewalk Server, Red Hat Satellite or\n  # Red Hat Network Classic. This can be an existing Spacewalk, Red Hat Satellite or\n  # Red Hat Network Classic username, or a new  user‐name.\n  config.registration.username\n\n  # The password associated with the username specified with the `--username` option.\n  # This is an unencrypted password.\n  config.registration.password\n\n  # Give the URL of the subscription service to use (required for registering a\n  # system with the \"Spacewalk Server\", \"Red Hat Satellite\" or \"Red Hat Network Classic\").\n  # The configuration name is mapped to the `--serverUrl` option of rhnreg_ks command.\n  #\n  # The serverurl is mandatory and if you do not provide a value,\n  # you will be prompted for them in the \"up process.\"\n  config.registration.serverurl\n\n  # A path to a CA certificate file (optional)\n  # The configuration name is mapped to the `--sslCACert` option of rhnreg_ks command.\n  #\n  # The CA certificate file is be uploaded to /usr/share/rhn/\u003cca_file_name\u003e in guest\n  # and the configuration  in `/etc/sysconfig/rhn/up2date` is updated to:\n  # `sslCACert=/usr/share/rhn/\u003cca_file_name\u003e`\n  #\n  # As default only the configuration in `/etc/sysconfig/rhn/up2date` is updated\n  # to point to the CA certificate file that is present on Fedora, CentOS and RHEL:\n  # `sslCACert=/usr/share/rhn/RHNS-CA-CERT`\n  config.registration.ca_cert\n\n  # Give the organization to which to join the system (required, except for\n  # hosted environments)\n  # The configuration name is mapped to the `--systemorgid` option of rhnreg_ks command.\n  config.registration.org\n\n  # Name of the subscribed system (optional, defaults to hostname if unset)\n  # The configuration name is mapped to the `--profilename` option of rhnreg_ks command.\n  config.registration.name\n\n  # Attach existing subscriptions as part of the registration process (optional)\n  config.registration.activationkey\n\n  # Subscribe this system to the EUS channel tied to the system's redhat-release (optional)\n  config.registration.use_eus_channel\n\n  # Do not probe or upload any hardware info (optional)\n  config.registration.nohardware\n\n  #  Do not profile or upload any package info (optional)\n  config.registration.nopackages\n\n  # Do not upload any virtualization info (optional)\n  config.registration.novirtinfo\n\n  # Do not start rhnsd after completion (optional)\n  config.registration.norhnsd\n\n  # Force the registration (optional, force if true, defaults to true)\n  config.registration.force\n\n  # Skip the registration (optional, skip if true, defaults to false)\n  config.registration.skip\n\n  # Specify a HTTP proxy to use. This config option if of the format [\u003chost\u003e|\u003cip\u003e:\u003cport\u003e], eg mongo:8080\n  config.registration.proxy\n\n  # Specify a username to use with an authenticated HTTP proxy\n  config.registration.proxyUser\n\n  # Specify a password to use with an authenticated HTTP proxy\n  config.registration.proxyPassword\n----\n\n== Development\n\nThe use of https://rvm.io[RVM] is recommended. Verified to work with ruby-2.2.10.\n\n....\nrvm install 2.2\nrvm use 2.2\n....\n\nTo install a development environment, clone the repo and prepare\ndependencies by:\n\n....\ngem install bundler\nbundle install\n....\n\n=== Tests\n\n==== Minitest\n\nThe source contains a set of\nhttp://ruby-doc.org/stdlib-2.0.0/libdoc/minitest/rdoc/MiniTest.html[Minitest]\nbased unit tests. They can be run via:\n\n....\n$ bundle exec rake test\n....\n\n==== Acceptance tests\n\nThe source also contains a set of https://cucumber.io/[Cucumber] based\nacceptance tests. They can be run via:\n\n....\n$ bundle exec rake features\n....\n\nThe tests assume that the CDK box files are available under\n__build/boxes/cdk-\u003cprovider\u003e.box__. You can either copy the box files\nmanually or use the _get_cdk_ rake task to download them.\n\nAs per default, only the scenarios for CDK in combination with\nVirtualBox are run. You can also run the tests against Libvirt, using\nthe environment variable __PROVIDER__:\n\n....\n# Run tests against Libvirt\n$ bundle exec rake features PROVIDER=libvirt\n\n# Run against VirtualBox and Libvirt\n$ bundle exec rake features PROVIDER=virtualbox,libvirt\n....\n\nYou can also run a single feature specifying the explicit feature file\nto use:\n\n....\n$ bundle exec rake features FEATURE=features/\u003cfeature-filename\u003e.feature\n....\n\nAfter test execution the acceptance test reports can be found under\n__build/features_report.html__. They can also be opened via:\n\n....\n$ bundle exec rake features:open_report\n....\n\n== Releasing\n\nTo release a new version of vagrant-registration you will need to do the following:\n\n*(only contributors of the GitHub repo and owners of the project at RubyGems will have rights to do this)*\n\n1. First, bump, commit, and push the version in ~/lib/vagrant-registration/version.rb:\n    * Follow [Semantic Versioning](http://semver.org/).\n2. Then, create a matching GitHub Release (this will also create a tag):\n    * Preface the version number with a `v`.\n    * https://github.com/projectatomic/adb-vagrant-registration/releases\n3. You will then need to build and push the new gem to RubyGems:\n    * `rake build`\n    * `gem push pkg/vagrant-registration-1.3.2.gem`\n4. Then, when John Doe runs the following, they will receive the updated vagrant-registration plugin:\n    * `vagrant plugin update`\n    * `vagrant plugin update vagrant-registration`\n\n== Acknowledgements\n\nThe project would like to make sure we thank\nhttps://github.com/purpleidea/[purpleidea],\nhttps://github.com/humaton/[humaton],\nhttps://github.com/strzibny[strzibny],\nhttps://github.com/scollier/[scollier],\nhttps://github.com/puzzle[puzzle], https://github.com/voxik[voxik],\nhttps://github.com/lukaszachy[lukaszachy],\nhttps://github.com/goern[goern],\nhttps://github.com/iconoeugen[iconoeugen] and\nhttps://github.com/pvalena[pvalena] (in no particular order) for their\ncontributions of ideas, code and testing for this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectatomic%2Fadb-vagrant-registration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojectatomic%2Fadb-vagrant-registration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectatomic%2Fadb-vagrant-registration/lists"}