{"id":20331017,"url":"https://github.com/cans/celery-worker-setup","last_synced_at":"2026-06-01T06:31:31.713Z","repository":{"id":139897803,"uuid":"102185329","full_name":"cans/celery-worker-setup","owner":"cans","description":"Ansible role for setting up Celery workers","archived":false,"fork":false,"pushed_at":"2017-10-15T22:01:58.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T12:30:00.336Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/cans.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":"2017-09-02T09:08:51.000Z","updated_at":"2019-06-21T12:47:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"7a457801-a07c-430f-aeef-bb671b02f420","html_url":"https://github.com/cans/celery-worker-setup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cans/celery-worker-setup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cans%2Fcelery-worker-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cans%2Fcelery-worker-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cans%2Fcelery-worker-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cans%2Fcelery-worker-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cans","download_url":"https://codeload.github.com/cans/celery-worker-setup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cans%2Fcelery-worker-setup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33763648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-14T20:18:29.231Z","updated_at":"2026-06-01T06:31:31.682Z","avatar_url":"https://github.com/cans.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"celery-worker\n=============\n\nA role to setup the configuration of a set of Celery workers supervised\nby systemd.\n\n\nEach worker has to be described through items as the one that follows:\n\n```yaml\n- app_name: 'MyApp'                      # (mandatory)\n  app_variable: 'my_app'                 # (default: `celeryw_app_variable`)\n  celeryd_bin: '/usr/local/bin/celery'   # (default: `celeryw_bin`)\n  group: \"adm\"                           # (default: `celeryw_`)\n  log_dir:                               # (default: `celeryw_log_dir`)\n  log_filename: \"%n%I\"                   # (default: `celeryw_log_filename`)\n  log_level: \"INFO\"                      # (default: `celeryw_log_level`)\n  pid_filename: `%n-master.pid`          # (default: `celeryw_pid_filename`)\n  queues: `%n-master.pid`                # (default: `celeryw_queues`)\n```\n\nBasically all variables in the [Role variables](#role-variables) section\nbelow can be overriden, on a per-worker basis, in the item discribing the\nworker through a key that has the same name (omitting the role namespace\nprefix). The only two exceptions are the `app_name` and `app_module`\nvariables that you _must_ provide for each worker you define.\n\n\nRequirements\n------------\n\nThis role has no requirements. \n\n\nRole Variables\n--------------\n\nAll variables in this role are namespaced with the prefix `celeryw_`.\n\n### Defaults\n\n- `celeryw_app_variable`: module level variable that hold a reference\n  to the celery application (default: \"app\");\n- `celeryw_bin`: path to the celery binary (default: \"/usr/bin/celery\")\n- `celeryw_daemon_options: extraneous options to be passed _as is_ on\n  the celery command line (default: \"\");\n- `celeryw_etc_dir`: path to the directory in which store celery's\n  worker(s) configuration files (default: \"/etc/celery\");\n- `celeryw_group`: group under which the celery processes should\n  run (default: `{{ansible_user_id}}`)\n- `celeryw_log_dir`: path to the directory in which store celery's logs\n  files (`/var/log/celery`);\n- `celeryw_log_filename`: name to use for the log files. Refer to\n  celery's documentation to know more about available template\n  substitutions (default: `%n%I.log`);\n- `celeryw_log_level`: (default: `ERROR`)\n- `celeryw_pid_filename`: `%n.pid`\n- `celeryw_queues`: \"celery\"\n- `celeryw_run_dir`: path in which store celery's PID files _etc._\n  (default: `/var/run/celery`)\n- `celeryw_user`: identity under which the celery processes should\n  run (default: `{{ansible_user_id}}`)\n- `celeryw_workers`: the variable that contains the list of workers\n  to set-up (default: `[]`);\n\n\n### Variables intended for other roles\n\nNone\n\n\nDependencies\n------------\n\nTo have systemd manage for you celery workers, this role depends on the\n`cans.systemd-unit-install` role.\n\n\nExample Playbook\n----------------\n\nThis first example will configure workers for two applications, relying\nmostly on the [default values](#defaults) provided in the role:\n\n```yaml\n- hosts: servers\n  roles:\n     - role: cans.celery-worker\n       celeryw_workers:\n         - app_name: \"mailer\"\n           app_module: \"application.interfaces.tasks.mailer\"\n         - app_name: \"data-cruncher\"\n           app_module: \"application.interfaces.tasks.cruncher\"\n           app_variable: \"cruncher_app\"\n```\n\nThis second example overrides more variables some at a global level,\nin the playbook's `vars` section, others at the worker description\nlevel:\n\n```yaml\n\n- hosts: servers\n  vars:\n     celeryw_bin: \"/opt/local/python-virtualenvs/python3.6/bin/celery\"\n  roles:\n     - role: cans.celery-worker\n       celeryw_workers:\n         - app_name: \"mailer\"\n           app_module: \"application.interfaces.tasks.mailer\"\n         - app_name: \"data-cruncher\"\n           app_module: \"application.interfaces.tasks.cruncher\"\n           app_variable: \"cruncher_app\"\n         - app_name: \"legacy-data-cruncher\"\n           app_module: \"legacy.interfaces.tasks.cruncher\"\n           conf_dir: \"/opt/local/etc/celery\"\n           celery_bin: \"/opt/local/python-virtualenvs/python2.5/bin/celery\"\n```\n\nYou may also refer to the playbook found under the `test` directory\nfor more examples.\n\n\nLicense\n-------\n\nGPLv2\n\n\nAuthor Information\n------------------\n\nCopyright © 2017, Nicolas CANIART.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcans%2Fcelery-worker-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcans%2Fcelery-worker-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcans%2Fcelery-worker-setup/lists"}