{"id":23738082,"url":"https://github.com/csmart/ansible-role-swift","last_synced_at":"2026-03-01T18:30:18.519Z","repository":{"id":41033455,"uuid":"426039199","full_name":"csmart/ansible-role-swift","owner":"csmart","description":"Ansible Role for deploying and managing OpenStack Swift cluster","archived":false,"fork":false,"pushed_at":"2022-09-26T22:09:59.000Z","size":106,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-31T08:52:33.821Z","etag":null,"topics":["ansible","openstack","role","swift"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csmart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-09T00:32:59.000Z","updated_at":"2021-12-14T10:40:51.000Z","dependencies_parsed_at":"2023-01-18T12:16:22.425Z","dependency_job_id":null,"html_url":"https://github.com/csmart/ansible-role-swift","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csmart%2Fansible-role-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csmart%2Fansible-role-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csmart%2Fansible-role-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csmart%2Fansible-role-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csmart","download_url":"https://codeload.github.com/csmart/ansible-role-swift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239879312,"owners_count":19712176,"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":["ansible","openstack","role","swift"],"created_at":"2024-12-31T08:52:41.290Z","updated_at":"2026-03-01T18:30:18.450Z","avatar_url":"https://github.com/csmart.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"Swift\n=====\n\nThis is a role for setting up and managing OpenStack Swift clusters.\nCurrently it supports PACO nodes running all Swift services; Proxy, Account, Container and Object.\n\nIt will:\n\n - Prepare Swift nodes, including setting SELinux and ensuring SSH access\n - Add repositories and install packages\n - Configure dependent services, such as logging, rsyncd and memcached\n - Configure keepalived for failover of proxy VIPs\n - Configure Swift PACO services\n - Create initial account, container and object rings\n - Prepare disks on each node, format and mount according to the rings\n - Build and distribute the rings\n - Configure dispersion\n - Simple operational tasks such as:\n   - Update and distribute the rings\n   - Re-configure PACO services\n   - Generate dispersion and replication reports\n\n\nRequirements\n------------\n\nAn inventory of pre-existing CentOS 8 Stream nodes with their networking configured.\nThe cluster requires an admin box (included in `swift_admin` group) from which all the Swift nodes are managed.\nThis can be one of your Swift nodes, if you don't have a separate admin host.\n\nIf building a virtual Swift cluster, consider using `csmart.virt_infra` Ansible role at https://github.com/csmart/ansible-role-virt-infra.\n\nSample inventory and playbooks can be found at https://github.com/csmart/virt-infra-swift for both `csmart.virt_infra` and `csmart.swift`.\n\n\nRole Variables\n--------------\n\nThis role has a number of default variables, which are broken out into individual files under `defaults/main/`.\nThese include common settings for a Swift cluster, as well as defaults for specific Swift services.\n\n - account-rings.yml\n - account.yml\n - container-rings.yml\n - container.yml\n - dispersion.yml\n - hash.yml\n - networks.yml\n - object-rings.yml\n - object.yml\n - packages.yml\n - proxy.yml\n - swift.yml\n - tempauth.yml\n\nRequired global variables that the user must define, include:\n\n - `swift_hash_suffix` - the hash suffix of the cluster, once set it should not be changed\n    - default is `07b4ef9c-2e01-4ea2-a109-5ffc5273225f`\n - `swift_hash_prefix` - the hash prefix of the cluster, once set it should not be changed\n    - default is `f9175259-ace0-48bb-af9d-e7ac505b89d2`\n - `swift_outward_subnet` - the routable CIDR subnet for external connections (for proxy nodes)\n   - default is `203.0.113.0/24`\n - `swift_cluster_subnet` - the cluster communication CIDR subnet\n   - default is `192.0.2.0/24`\n - `swift_replication_subnet` - replication CIDR subnet (can be the same as cluster)\n   - default is `198.51.100.0/24`\n\nRequired node specific variables that the user must define, include:\n\n - `swift_outward_ip` - IP on the outward network\n   - for example, `203.0.113.11`\n - `swift_cluster_ip` - IP on the cluster network\n   - for example, `192.0.2.11`\n - `swift_replication_ip` - IP on the replication network\n   - for example, `198.51.100.11`\n - `swift_vips` - list of proxy VIPs, 4th octet of IP\n\n    - Each proxy node should list the 4th octet of the VIP IP in order of preference. For example, based on default outward subnet of `203.0.113.0/24`, here's a node which wants VIPs `203.0.113.111`, `203.0.113.112` and `203.0.113.113`.\n\n        ```yaml\n        swift_vips:\n          - 111\n          - 112\n          - 113\n        ```\n\n - `swift_rings_disks` - list of dicts defining what disks to use for what ring\n    - Each node's disks should include the path and what weight it should have for a ring. For example, here's a SCSI disk to be used for objects and an NVMe to be used for both acount and container.\n\n        ```yaml\n        swift_rings_disks:\n          - disk:\n              device: sdb\n              rings:\n              - name: account\n                weight: 0\n              - name: container\n                weight: 0\n              - name: object\n                weight: 100\n          - disk:\n              device: nvme0n1\n              rings:\n              - name: account\n                weight: 100\n              - name: container\n                weight: 100\n              - name: object\n                weight: 0\n        ```\n\n\nDependencies\n------------\n\nNone.\n\nExample Playbook\n----------------\n\nThe `virt-infra-swift` repository at https://github.com/csmart/virt-infra-swift provides a set of example playbooks and sample inventory.\n\nYour inventory should include the following groups:\n\n - `swift` (or `all`)\n - `swift_admin`\n - `swift_proxy`\n - `swift_account`\n - `swift_container`\n - `swift_object`\n\nHere is an example inventory for a three node PACO Swift cluster with required groups.\n\n```yaml\nswift:\n  hosts:\n    swift-admin:\n    swift-[01:03]:\n  children:\n    swift_admin:\n      hosts:\n        swift-admin:\n    swift_proxy:\n      hosts:\n        swift-[01:03]:\n    swift_account:\n      hosts:\n        swift-[01:03]:\n    swift_container:\n      hosts:\n        swift-[01:03]:\n    swift_object:\n      hosts:\n        swift-[01:03]:\n```\n\nOnce you have a basic inventory, creating a basic playbook should be simple.\n\n```yaml\n---\n- hosts: swift\n  tasks:\n    - include_role:\n        name: csmart.swift\n```\n\nExecuting the playbook will run the whole role and default set of tasks, in order.\n\n```bash\nansible-playbook -i inventory/ site.yml\n```\n\nThe role also includes tags for each type of task, so you could create one or more playbooks for all or specific tags.\n\n```yaml\n---\n- hosts: swift\n  tasks:\n    - include_role:\n        name: csmart.swift\n      tags:\n        - account\n        - common\n        - config\n        - container\n        - disks\n        - dispersion\n        - hosts\n        - keepalived\n        - logging\n        - memcached\n        - object\n        - packages\n        - prep\n        - proxy\n        - rings\n        - rsyncd\n        - selinux\n        - services\n        - system\n        - update\n```\n\nThen run the playbook against specific tags, for example, to just re-configure account services.\n\n```bash\nansible-playbook -i inventory/ site.yml --tags account\n```\n\n\nLicense\n-------\n\nGPLv3+\n\nAuthor Information\n------------------\n\nChris Smart https://blog.christophersmart.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsmart%2Fansible-role-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsmart%2Fansible-role-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsmart%2Fansible-role-swift/lists"}