{"id":15514294,"url":"https://github.com/petems/lockfile_tasks","last_synced_at":"2026-05-01T01:31:14.828Z","repository":{"id":137299659,"uuid":"106477601","full_name":"petems/lockfile_tasks","owner":"petems","description":"Tasks for managing Puppet lockfiles","archived":false,"fork":false,"pushed_at":"2017-11-09T17:51:21.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T19:21:22.504Z","etag":null,"topics":["lockfile","puppet","puppet-lockfiles","puppet-process","puppet-runs"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/petems.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2017-10-10T22:19:26.000Z","updated_at":"2023-07-17T16:51:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"29466c9e-1f1f-4013-a2ad-83cad585ca42","html_url":"https://github.com/petems/lockfile_tasks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/petems/lockfile_tasks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petems%2Flockfile_tasks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petems%2Flockfile_tasks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petems%2Flockfile_tasks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petems%2Flockfile_tasks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/petems","download_url":"https://codeload.github.com/petems/lockfile_tasks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petems%2Flockfile_tasks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32482460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: 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":["lockfile","puppet","puppet-lockfiles","puppet-process","puppet-runs"],"created_at":"2024-10-02T09:58:31.317Z","updated_at":"2026-05-01T01:31:14.802Z","avatar_url":"https://github.com/petems.png","language":"Ruby","readme":"# lockfile_tasks\n\n[![Build Status](https://travis-ci.org/petems/lockfile_tasks.svg?branch=master)](https://travis-ci.org/petems/lockfile_tasks)\n\n#### Table of Contents\n\n1. [Description](#description)\n2. [Setup - The basics of getting started with lockfile_tasks](#setup)\n    * [What lockfile_tasks affects](#what-lockfile_tasks-affects)\n    * [Setup requirements](#setup-requirements)\n    * [Beginning with lockfile_tasks](#beginning-with-lockfile_tasks)\n3. [Usage - Configuration options and additional functionality](#usage)\n4. [Reference - An under-the-hood peek at what the module is doing and how](#reference)\n5. [Limitations - OS compatibility, etc.](#limitations)\n6. [Development - Guide for contributing to the module](#development)\n\n## Description\n\nPuppet has two main lockfiles:\n\n* `agent_catalog_run_lockfile` - A file created when a Puppet run is happening. The file contains the PID of the running Puppet process\n* `agent_disabled_lockfile` - A file created by an admin to stop Puppet runs from occuring, for example `puppet agent --disable \"Blocking Puppet during change window - John Smith\"\n\nThis module contains tasks to inspect, create and delete these Puppet lockfiles on nodes.\n\nThere are a few scenarios for needing these tasks or to manually intervene to change the lockfiles:\n\n* A puppet agent process is killed ungracefully (such as with a `kill -9`), which left the old lockfile in place.\n* A system hard-rebooted mid Puppet run\n* A network issue causes a hung connection to the Puppet master (such as https://tickets.puppetlabs.com/browse/PUP-7517)\n* You want to easily mass-disable Puppet runs on a selection of machines for a change-window or to avoid Puppet runs occuring during investigation\n\n## Setup\n\n### What lockfile_tasks affects\n\nThis task modifies the Puppet lockfiles, generally `/opt/puppetlabs/puppet/cache/state/agent_catalog_run.lock` and `/opt/puppetlabs/puppet/cache/state/agent_disabled.lock`.\n\nMost of the tasks will have safety-guards to make sure you don't make changes to these files without explicitly asking to, as this can be dangerous. For example,  removing a catalog lockfile whilst an existing Puppet run is happening, causing conflicts.\n\n### Setup Requirements\n\nRelies on Puppet being installed on the target nodes \u003e Puppet 4, as it uses the Puppet ruby path at `/opt/puppetlabs/puppet/bin/ruby`.\n\nIt's possible to write code that could work on a Puppet 3 machine, but Puppet 3 is EOL so I won't do it in this module.\n\n### Beginning with lockfile_tasks\n\nEnsure Puppet \u003e= 4 is installed on the target nodes.\n\n## Usage\n\n### `lockfile_tasks::lockfile_details`\n\n```bash\nbolt task run lockfile_tasks::lockfile_details --nodes lockfile-tasks.puppet.vm\n```\n\nThis will give different outputs depending on the presence of lockfiles and the pids or reasons mentioned in the lockfiles:\n\n#### Admin lockfile present and string given\n\n```\nlockfile-tasks.puppet.vm:\n\nConfigured Catalog run lockfile setting is /opt/puppetlabs/puppet/cache/state/agent_catalog_run.lock\nConfigured Admin Lockfile setting is /opt/puppetlabs/puppet/cache/state/agent_disabled.lock\nCatalog Lockfile absent\nAdmin Disable Lockfile present, reason for agent disable given is 'Disabling Puppet runs - John Doe'\n\n\nRan on 1 node in 0.53 seconds\n```\n\n\n#### Catalog lockfile present, pid not running\n\n```\nlockfile-tasks.puppet.vm:\n\nConfigured Catalog run lockfile setting is /opt/puppetlabs/puppet/cache/state/agent_catalog_run.lock\nConfigured Admin Lockfile setting is /opt/puppetlabs/puppet/cache/state/agent_disabled.lock\nCatalog Lockfile present, PID in file is 7777\nPID 7777 is not running\nAdmin Disable Lockfile absent\n\n\nRan on 1 node in 0.53 seconds\n```\n\n#### Catalog lockfile present, pid running and lockfile not older than an hour\n\n```\nConfigured Catalog run lockfile setting is /home/vagrant/.puppetlabs/opt/puppet/cache/state/agent_catalog_run.lock\nConfigured Admin Lockfile setting is /opt/puppetlabs/puppet/cache/state/agent_disabled.lock\nCatalog Lockfile present, PID in file is 7777\nPID 7777 is running\nLockfile is 3 minutes old\nAdmin Disable Lockfile absent\n\n\nRan on 1 node in 0.53 seconds\n```\n\n#### Catalog lockfile present, pid running and lockfile older than an hour\n\n```\nConfigured Catalog run lockfile setting is /home/vagrant/.puppetlabs/opt/puppet/cache/state/agent_catalog_run.lock\nConfigured Admin Lockfile setting is /opt/puppetlabs/puppet/cache/state/agent_disabled.lock\nCatalog Lockfile present, PID in file is 7777\nPID 7777 is running\nLockfile is 67 minutes old\nLockfile is over an hour old, so we consider it stale and it might be worth killing the process\nThis could be due to a bug (such as https://tickets.puppetlabs.com/browse/PUP-7517) or a long-running process in a Puppet run\nAdmin Disable Lockfile absent\n\n\nRan on 1 node in 0.53 seconds\n```\n\n\n## Reference\n\n### `lockfile_tasks::lockfile_details`\n\n`lockfile_tasks::lockfile_details` has no variables or customisation.\n\n## Limitations\n\nTested on Linux and Windows.\n\n## Development\n\nTo test on a local Vagrant VM:\n\n```bash\nvagrant up\nvagrant ssh-config \u003e\u003e ~/.ssh/config\nbolt task run lockfile_tasks --nodes lockfile-tasks.puppet.vm --user vagrant\n```\n\nYou can also run a quick beaker check:\n\n```\nBEAKER_set='ubuntu-1604-docker' bundle exec rspec spec/acceptance/lockfile_details_spec.rb\n```\n\nContribution is welcome.\n\n\n## Release Notes/Contributors/Etc.\n\nThis is the initial release\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetems%2Flockfile_tasks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetems%2Flockfile_tasks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetems%2Flockfile_tasks/lists"}