{"id":27789159,"url":"https://github.com/heini/puppet-wait-for","last_synced_at":"2026-03-11T13:15:49.997Z","repository":{"id":7685134,"uuid":"9048412","full_name":"heini/puppet-wait-for","owner":"heini","description":"A pseudo resource type for puppet that enables you to wait for certain conditions. You can use shell commands to query arbitrary things and either react on the exit code or match the output of the command against a regular expression.","archived":false,"fork":false,"pushed_at":"2024-08-25T16:08:48.000Z","size":77,"stargazers_count":9,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-03-07T00:29:04.257Z","etag":null,"topics":["puppet","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heini.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-03-27T07:00:46.000Z","updated_at":"2024-08-25T16:07:16.000Z","dependencies_parsed_at":"2024-08-25T11:23:28.343Z","dependency_job_id":"5af7cc5e-7a1c-4113-88c4-784a47add025","html_url":"https://github.com/heini/puppet-wait-for","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/heini/puppet-wait-for","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heini%2Fpuppet-wait-for","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heini%2Fpuppet-wait-for/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heini%2Fpuppet-wait-for/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heini%2Fpuppet-wait-for/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heini","download_url":"https://codeload.github.com/heini/puppet-wait-for/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heini%2Fpuppet-wait-for/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30382644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T12:49:11.341Z","status":"ssl_error","status_checked_at":"2026-03-11T12:46:41.342Z","response_time":84,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["puppet","ruby"],"created_at":"2025-04-30T17:47:53.019Z","updated_at":"2026-03-11T13:15:49.980Z","avatar_url":"https://github.com/heini.png","language":"Ruby","readme":"# puppet-wait-for\n\n[![Build Status](https://img.shields.io/travis/heini/puppet-wait-for.svg)](https://travis-ci.org/heini/puppet-wait-for)\n\nA Puppet resource type that enables you to either wait for certain amount of time or certain conditions, like\n- shell commands to query arbitrary things and either react on the exit code or match the output of the command against a regular expression, or\n- files or directories to (dis-)appear (new in 3.0)\n\nWarning: By using this module you are leaving the purist Puppet philosophy - this is not really a resource whose state can updated/kept in sync by Puppet. Also, you might be tempted to use this module to work around issues that should be fixed by other means.\n\nThat said, there are situations where this might come in handy - for example, when you need to start/stop services in some asynchronous fashion. Puppet's basic assumption is, that when the code to update a resource has finished, then the resource is in the desired state, period. In the real world, this is not always the case, especially if you are doing a lot of things via exec resources and even more if the exec command forks or kicks off a process which needs some time to come up.\n\n## Installation\n\nEither install the latest release from puppet forge:\n\n```text\npuppet module install heini-wait_for\n```\n\nOr add to your Puppetfile:\n\n```text\nmod 'heini/wait_for'\n```\n\n## Migrating to version 3.x\n\nWith the addition of waiting for files/directories, it doesn't make sense anymore for \"query\" to be the namevar, which means it must from now on be explicitely provided. For example, instead of writing\n\n```puppet\nwait_for { 'command':\n  exit_code =\u003e 0,\n  ...\n}\n```\none should now write\n\n```puppet\nwait_for { 'command_returns_0':\n  query     =\u003e 'command',\n  exit_code =\u003e 0,\n  ...\n}\n```\n\n## Usage\n\nSimply add this module to your Puppetfile to make the type available.\n\n## Examples\n\nWait for a Linux sshd service to start:\n\n```puppet\nservice { 'logstash':\n  ensure =\u003e running,\n  enable =\u003e true,\n}\n\n# Wait for the service to really start.\nwait_for { 'logstash':\n  query             =\u003e 'cat /var/log/logstash/logstash-plain.log 2\u003e /dev/null',\n  regex             =\u003e 'Successfully started Logstash API endpoint',\n  polling_frequency =\u003e 5,  # Wait up to 2 minutes (24 * 5 seconds).\n  max_retries       =\u003e 24,\n  refreshonly       =\u003e true,\n}\n```\n\nWait for a Windows MySQL service to start:\n\n```puppet\nwait_for { 'MySQL service running':\n  query =\u003e 'sc query MySQL5',\n  regex =\u003e '.*STATE\\s*:\\s*4\\s*RUNNING.*',\n}\n```\n\nWait until a command returns an exit code of 5:\n\n```puppet\nwait_for { 'Copy to remote host':\n  query             =\u003e 'scp big_file user@remote.com:/tmp',\n  exit_code         =\u003e 5,   # Handle exit code 5, connection lost.\n  polling_frequency =\u003e 0.3,\n  max_retries       =\u003e 5,\n}\n```\n\nJust wait for 1 minute:\n\n```puppet\nwait_for { 'a_minute':\n  seconds =\u003e 60,\n}\n```\n\nExecute a command and inject some environment variables (just like 'exec' does).\n\n```puppet\nwait_for { 'FOO is set':\n  query       =\u003e 'env',\n  environment =\u003e ['FOO=bar', 'BAR=baz'],\n  regex       =\u003e 'FOO=.*',\n}\n```\n\nWait for a file/directory to (dis-)appear\n```puppet\nwait_for { 'some_new_file':\n  path  =\u003e '/tmp/foo',\n  state =\u003e file,   # or present, absent or directory\n}\n```\n\n## Testing\n\n### Testing\n\nMake sure you have:\n\n* rake\n* bundler\n* Vagrant (for the Beaker tests)\n\nInstall the necessary gems:\n\n```text\nbundle install\n```\n\nTo run the tests from the root of the source code:\n\n```text\nbundle exec rake spec\n```\n\nTo also run the acceptance tests:\n\n```text\nexport BEAKER_PUPPET_COLLECTION=puppet7\nexport BEAKER_PUPPET_INSTALL_VERSION=7.32.1\nbundle exec rspec spec/acceptance\n```\n\nTested using Puppet 7.32.1, 8.8.1 and Ruby 3.1.4.\n\n### Release\n\nThis module uses Puppet Blacksmith to publish to the Puppet Forge.\n\nEnsure you have these lines in `~/.bash_profile`:\n\n```text\nexport BLACKSMITH_FORGE_URL=https://forgeapi.puppetlabs.com\nexport BLACKSMITH_FORGE_USERNAME=xxxxx\nexport BLACKSMITH_FORGE_PASSWORD=xxxxxxxxx\n```\n\nBuild the module:\n\n```text\nbundle exec rake build\n```\n\nPush to Forge:\n\n```text\nbundle exec rake module:push\n```\n\nClean the pkg dir (otherwise Blacksmith will try to push old copies to Forge next time you run it and it will fail):\n\n```text\nbundle exec rake module:clean\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheini%2Fpuppet-wait-for","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheini%2Fpuppet-wait-for","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheini%2Fpuppet-wait-for/lists"}