{"id":19872038,"url":"https://github.com/saltstack-formulas/memcached-formula","last_synced_at":"2025-05-02T09:30:59.614Z","repository":{"id":8924441,"uuid":"10653408","full_name":"saltstack-formulas/memcached-formula","owner":"saltstack-formulas","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-19T15:05:31.000Z","size":41,"stargazers_count":15,"open_issues_count":3,"forks_count":78,"subscribers_count":38,"default_branch":"master","last_synced_at":"2023-03-11T09:43:43.733Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html","language":"SaltStack","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saltstack-formulas.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2013-06-12T22:06:05.000Z","updated_at":"2023-03-06T01:20:10.000Z","dependencies_parsed_at":"2022-08-27T22:32:04.981Z","dependency_job_id":null,"html_url":"https://github.com/saltstack-formulas/memcached-formula","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltstack-formulas%2Fmemcached-formula","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltstack-formulas%2Fmemcached-formula/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltstack-formulas%2Fmemcached-formula/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltstack-formulas%2Fmemcached-formula/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saltstack-formulas","download_url":"https://codeload.github.com/saltstack-formulas/memcached-formula/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224305531,"owners_count":17289446,"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-11-12T16:14:19.149Z","updated_at":"2024-11-12T16:14:20.227Z","avatar_url":"https://github.com/saltstack-formulas.png","language":"SaltStack","funding_links":[],"categories":[],"sub_categories":[],"readme":"memcached\n=========\n\nInstall and start the memcached service on GNU/Linux and FreeBSD\n\n.. note::\n\n    See the full `Salt Formulas installation and usage instructions\n    \u003chttp://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html\u003e`_.\n\nAvailable states\n================\n\n.. contents::\n    :local:\n\n``memcached``\n-------------\n\nInstalls and starts memcached service\n\n``memcached.config``\n--------------------\n\nMemcached configuration file\n\n``memcached.python_memcached``\n------------------------------\n\nInstalls ``python-memcached`` package for RedHat/CentOS and ``python-memcache`` package for Debian\n\n``memcached.libmemcached``\n--------------------\n\nInstalls libmemcached development files to install ``pylibmc`` as python driver\n\n``memcached.uninstall``\n-------------\n\nStops the memcached service and uninstalls the package.\n\nInstructions\n============\n\n1.  Add this repository as a `GitFS backend`_ in your Salt master config.\n\n2.  Determine which minions will run memcached and ``include`` the\n    ``memcached`` state.\n\n    One possible example is to run memcached on each server that is also\n    running your web application. The following contrived example uses a Django\n    web app deployed from an internal Git repository::\n\n        include:\n          - memcached\n          - memcached.python_memcached\n\n        python-django:\n          pkg:\n            - installed\n\n        https://internal-repos/mydjangoapp.git:\n          git.latest:\n            - target: /var/www/mydjangoapp\n            - require:\n              - pkg: python-django\n              - pkg: python-memcached\n\n3.  (Optional) Use Salt Mine to maintain a live list of currently running\n    memcached instances in your web application config.\n\n    The following example assumes all web application servers have a hostname\n    that starts with \"web\".\n\n    1.  Configure your Pillar top file (``/srv/pillar/top.sls``)::\n\n            base:\n              'web*':\n                - application_server\n\n    2.  Configure Salt Mine in ``/srv/pillar/application_server.sls``::\n\n            mine_functions:\n              network.interfaces: [eth0]\n\n    3.  Add the IP addresses to your web application config.\n\n        Building on the Django example above, add the following states::\n\n            /var/www/mydjangoapp/config.py:\n              file:\n                - managed\n                - source: salt://mydjangoapp/config.py\n                - template: jinja\n                - require:\n                  - git: https://internal-repos/mydjangoapp.git\n\n        Edit the ``/srv/salt/mydjangoapp/config.py`` template to add the\n        memcached server addresses (only relevant portions of ``config.py`` are\n        shown)::\n\n            CACHES = {\n                'default': {\n                    'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',\n                    'LOCATION': [\n                        {% for server,ip in salt['mine.get']('web*', 'network.interfaces', ['eth0']).items() %}\n                        '{{ ip }}:11211`,\n                        {% endfor %}\n                    ]\n                }\n            }\n\n.. _`GitFS backend`: http://docs.saltstack.com/topics/tutorials/gitfs.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaltstack-formulas%2Fmemcached-formula","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaltstack-formulas%2Fmemcached-formula","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaltstack-formulas%2Fmemcached-formula/lists"}