{"id":14965322,"url":"https://github.com/komljen/ceph-salt","last_synced_at":"2025-10-25T11:31:19.975Z","repository":{"id":18608562,"uuid":"21813815","full_name":"komljen/ceph-salt","owner":"komljen","description":"Ceph cluster deployment with SaltStack","archived":false,"fork":false,"pushed_at":"2016-09-09T08:01:53.000Z","size":144,"stargazers_count":81,"open_issues_count":1,"forks_count":19,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-01-31T07:04:05.734Z","etag":null,"topics":["automation","ceph","ceph-salt","saltstack","storage"],"latest_commit_sha":null,"homepage":"","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/komljen.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}},"created_at":"2014-07-14T09:12:08.000Z","updated_at":"2024-12-14T15:59:00.000Z","dependencies_parsed_at":"2022-07-10T07:30:27.781Z","dependency_job_id":null,"html_url":"https://github.com/komljen/ceph-salt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komljen%2Fceph-salt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komljen%2Fceph-salt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komljen%2Fceph-salt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komljen%2Fceph-salt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/komljen","download_url":"https://codeload.github.com/komljen/ceph-salt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238128552,"owners_count":19421053,"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":["automation","ceph","ceph-salt","saltstack","storage"],"created_at":"2024-09-24T13:34:35.058Z","updated_at":"2025-10-25T11:31:14.694Z","avatar_url":"https://github.com/komljen.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ceph cluster deployment\n\nSalt states for Ceph cluster deployment.\n\nSupport for:\n\n * Ceph MON\n * Ceph OSD\n * Ceph MDS\n * Ceph Clients\n * Ceph REST API\n\nDetails:\n\n * Support for Ceph multi-environment deployment from one salt master node.\n * Deploy any number of MONs, OSDs or MDS services. Also, those states could be used to add new nodes after a cluster is created.\n * Support to select which disks are OSDs or Journals.\n * Support for cluster and public network.\n\nThose states are tested on Ubuntu 14.04 with Ceph Hammer release and Salt v2016.3.2.\n\n# Vagrant\n\nIf you want to test this deployment on your local machine inside VMs, the easiest way is to use Vagrant with VirtualBox provider. All you need is to go inside vagrant directory and run:\n\n```\ncd vagrant \u0026\u0026 vagrant up\n```\nThis will bring up 3 VMs, one master, and 3 minion nodes. Ceph will be deployed on all three nodes. Also, those VMs will have two additional network interfaces to emulate public and cluster network for Ceph and three additional drives attached to them. Two will be used for OSDs and one for a journal.\n\nTest the connectivity between master and minions:\n\n```\nvagrant ssh master\nsudo salt -G 'environment:VAGRANT' test.ping\n```\nIf everything is OK you can proceed with the Ceph deployment step: https://github.com/komljen/ceph-salt#deployment\n\n# Local environment\n\nFirst, you need Salt master and minions installed and running on all nodes and minions keys should be accepted. The easiest way to install SaltStack is using bootstrap script:\n\nMaster:\n\n```\ncurl -L https://bootstrap.saltstack.com | sudo sh -s -- -M -g https://github.com/saltstack/salt.git git v2016.3.2\n```\nMinions:\n\n```\ncurl -L https://bootstrap.saltstack.com | sudo sh -s -- -g https://github.com/saltstack/salt.git git v2016.3.2\n```\n\n### Master configuration\n\nOn the master node you need to include additional options. Edit master config file ```/etc/salt/master```. Replace ```\u003cUSER\u003e``` with username where this repository will be cloned:\n\n```\nfile_recv: True\nfile_roots:\n  base:\n    - /home/\u003cUSER\u003e/ceph-salt/salt\n    - /var/cache/salt/master/minions\npillar_roots:\n  base:\n    - /home/\u003cUSER\u003e/config\n    - /home/\u003cUSER\u003e/ceph-salt/pillar\nworker_threads: 10\nhash_type: sha256\njinja_trim_blocks: True\njinja_lstrip_blocks: True\n```\n\nNew options will make sure that minions can send files to the master and other minions to be able to get those files. Also here you can change where your salt states and config files are located. Salt master restart is required:\n\n```\nsudo service salt-master restart\n```\n\n### Minions configuration\n\nOn all minion nodes, you need to edit the configuration file. Edit minion config file ```/etc/salt/minion```. Replace ```\u003cENV_NAME\u003e``` and master IP address to match with your environment:\n\n```\nmaster: 192.168.33.10\nhash_type: sha256\ngrains:\n  environment: \u003cENV_NAME\u003e\n```\n\nSalt minion restart is required:\n\n```\nsudo service salt-minion restart\n```\n\n**NOTE:** To add new Ceph environment just install minions and choose new environment name!\n\n### Connection check\n\nOn master node accept all minions with:\n\n```\nsudo salt-key -A\n```\nNow all minions are connected and you should be able to send any command to a particular environment. Examples:\n\n```\nsudo salt -G 'environment:PROD' test.ping\nsudo salt -G 'environment:STAGE' test.ping\n```\nIf everything is fine clone this git repository on the master node. Use the same user you specified in master configuration file:\n\n```\ngit clone https://github.com/komljen/ceph-salt.git -b master\n```\nCopy configuration files for each environment except ```top.sls``` file:\n\n```\nmkdir -p ~/config\ncp ~/ceph-salt/pillar/environment-EXAMPLE.sls ~/config/environment-\u003cENV_NAME\u003e.sls\ncp ~/ceph-salt/pillar/ceph-EXAMPLE.sls ~/config/ceph-\u003cENV_NAME\u003e.sls\ncp ~/ceph-salt/pillar/top.sls ~/config/top.sls\n```\nEdit ```~/config/top.sls``` file and replace ENV_NAME with your environment:\n\n```\n  'environment:\u003cENV_NAME\u003e':\n    - match: grain\n    - environment-\u003cENV_NAME\u003e\n    - ceph-\u003cENV_NAME\u003e\n```\nIf you have more environments add it here. Example:\n\n```\n  'environment:PROD':\n    - match: grain\n    - environment-PROD\n    - ceph-PROD\n\n  'environment:STAGE':\n    - match: grain\n    - environment-STAGE\n    - ceph-STAGE\n```\n\n### Configuration options\n\nEdit ```~/config/environment-\u003cENV_NAME\u003e.sls``` file to match with your environment. For node names use hostnames (not FQDN):\n\n```\nnodes:\n  master:\n    roles:\n      - ceph-osd\n      - ceph-mon\n      - ceph-mds\n      - ceph-client\n      - ceph-rest-api\n    osds:\n      sdc:\n        journal: sdb\n      sdd:\n        journal: sdb\n  node01:\n    roles:\n      - ceph-osd\n      - ceph-mon\n      - ceph-mds\n    osds:\n      sdc:\n        journal: sdb\n      sdd:\n        journal: sdb\n  node02:\n    roles:\n      - ceph-osd\n      - ceph-mon\n      - ceph-mds\n    osds:\n      sdc:\n        journal: sdb\n      sdd:\n        journal: sdb\n```\nNow edit ```~/config/ceph-\u003cENV_NAME\u003e.sls``` if you want to make additional changes to ceph configuration. Take a look at those options to match with your machines:\n\n```\nceph:\n  version: hammer\n  cluster_name: ceph\n  rest_api:\n    port: 5000\n  global:\n    cluster_network: 192.168.36.0/24\n    fsid: 294bc494-81ba-4c3c-ac5d-af7b3442a2a5\n    public_network: 192.168.33.0/24\n  mon:\n    interface: eth1 # Should match public_network\n```\nProceed with deployment step after all changes are done.\n\n**NOTE:** Generate your FSID with ```uuidgen``` command!\n\n# Deployment\n\nFirst, you need to run high state to add roles to minions based on ```environment-\u003cENV_NAME\u003e.sls``` file. All roles for all environments will be applied:\n\n```\nsudo salt '*' state.highstate\n```\nTo start Ceph cluster deployment run orchestrate state:\n\n```\nsudo salt-run state.orchestrate deploy.ceph pillar='{environment: ENV_NAME}'\n```\nIt will take few minutes to complete. Then you can check ceph cluster status:\n\n```\nsudo ceph -s\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomljen%2Fceph-salt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkomljen%2Fceph-salt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomljen%2Fceph-salt/lists"}