{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph-ansible/pulls/comments/41550063","id":41550063,"diff_hunk":"@@ -5,7 +5,7 @@\n # As as a final word, I prefer to keep the partition check instead of running ceph-disk prepare with \"failed_when: false\"\n # I believe it's safer\n - name: check if the device is a partition or a disk\n-  shell: \"echo '{{ item }}' | egrep '/dev/(([a-z]{3,4}[0-9]$)|(cciss/c[0-9]{1}d[0-9]{1}p[0-9]$))'\"\n+  shell: \"echo '{{ item }}' | egrep '/dev/[sd[a-z]{1,2}|hd[a-z]{1,2}|cciss/c[0-9]d[0-9]p|nvme[0-9]n[0-9]p][0-9]{1,2}$'\"","path":"roles/ceph-osd/tasks/check_devices.yml","position":5,"original_position":5,"commit_id":"543e4cb2449ae72f3b1c8ecfd08b644a54db76e9","original_commit_id":"543e4cb2449ae72f3b1c8ecfd08b644a54db76e9","user":{"login":"bengland2","id":1717107,"avatar_url":"https://avatars.githubusercontent.com/u/1717107?v=3","gravatar_id":"","url":"https://api.github.com/users/bengland2","html_url":"https://github.com/bengland2","followers_url":"https://api.github.com/users/bengland2/followers","following_url":"https://api.github.com/users/bengland2/following{/other_user}","gists_url":"https://api.github.com/users/bengland2/gists{/gist_id}","starred_url":"https://api.github.com/users/bengland2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bengland2/subscriptions","organizations_url":"https://api.github.com/users/bengland2/orgs","repos_url":"https://api.github.com/users/bengland2/repos","events_url":"https://api.github.com/users/bengland2/events{/privacy}","received_events_url":"https://api.github.com/users/bengland2/received_events","type":"User","site_admin":false},"body":"Sebastien, you were right, the regex I specified is wrong, thanks for pointing it out.  Here's a correction to the regex syntax along with a quick method of testing it.\n\n# echo /dev/hdab99 | egrep '/dev/(sd[a-z]{1,2}|hd[a-z]{1,2}|cciss/c[0-9]d[0-9]{1,2}p|nvme[0-9]n[0-9]p)[0-9]{1,2}$' ; echo $?\n/dev/hdab99\n0\n\nSo I think this works, try running different device names through it and see if it works for you.  Again, the first part of the regex represents the different flavors of device names, and the last part is the partition number syntax.  Does this work for you?  I tried to limit to 99 disks/server, since Ceph is designed for scale-out, not to cram as many disks as possible into 1 server.    But I wanted to have option to have >= 10 partitions per device, since in the case of NVM SSDs we may need to get away with that sometimes.\n\nIf you agree with it I'll submit a new pull request with just this change.\n\n-ben\n","created_at":"2015-10-08T18:29:54Z","updated_at":"2015-10-08T18:29:54Z","html_url":"https://github.com/ceph/ceph-ansible/pull/412#discussion_r41550063","pull_request_url":"https://api.github.com/repos/ceph/ceph-ansible/pulls/412","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph-ansible/pulls/comments/41550063"},"html":{"href":"https://github.com/ceph/ceph-ansible/pull/412#discussion_r41550063"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph-ansible/pulls/412"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph-ansible/pulls/412","id":47045970,"html_url":"https://github.com/ceph/ceph-ansible/pull/412","diff_url":"https://github.com/ceph/ceph-ansible/pull/412.diff","patch_url":"https://github.com/ceph/ceph-ansible/pull/412.patch","issue_url":"https://api.github.com/repos/ceph/ceph-ansible/issues/412","number":412,"state":"open","locked":false,"title":"fix regex for partition names, enhance for NVM","user":{"login":"bengland2","id":1717107,"avatar_url":"https://avatars.githubusercontent.com/u/1717107?v=3","gravatar_id":"","url":"https://api.github.com/users/bengland2","html_url":"https://github.com/bengland2","followers_url":"https://api.github.com/users/bengland2/followers","following_url":"https://api.github.com/users/bengland2/following{/other_user}","gists_url":"https://api.github.com/users/bengland2/gists{/gist_id}","starred_url":"https://api.github.com/users/bengland2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bengland2/subscriptions","organizations_url":"https://api.github.com/users/bengland2/orgs","repos_url":"https://api.github.com/users/bengland2/repos","events_url":"https://api.github.com/users/bengland2/events{/privacy}","received_events_url":"https://api.github.com/users/bengland2/received_events","type":"User","site_admin":false},"body":"Improve regular expression for recognizing partition name.  Regex now uses \"or\" syntax to represent different families of devices - SCSI, IDE, CCISS, NVM, and it's easy to add others.  The partition number is factored out at the end.  Learned from previous version that we could control how many letters or digits to allow - I allow for 2 digits in partition number so poor folk like me can have >= 10 disks/SSD in their journal device.  \r\n\r\nIn the future, should we just ask Linux if it's a block device, and then look for a partition number on the end?  That would be a much simpler regex to maintain.","created_at":"2015-10-07T15:54:04Z","updated_at":"2015-10-08T18:29:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a37399758508a6b1731087ce95a4e95df838fe86","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph-ansible/pulls/412/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph-ansible/pulls/412/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph-ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph-ansible/issues/412/comments","statuses_url":"https://api.github.com/repos/ceph/ceph-ansible/statuses/543e4cb2449ae72f3b1c8ecfd08b644a54db76e9","head":{"label":"bengland2:partition_regex","ref":"partition_regex","sha":"543e4cb2449ae72f3b1c8ecfd08b644a54db76e9","user":{"login":"bengland2","id":1717107,"avatar_url":"https://avatars.githubusercontent.com/u/1717107?v=3","gravatar_id":"","url":"https://api.github.com/users/bengland2","html_url":"https://github.com/bengland2","followers_url":"https://api.github.com/users/bengland2/followers","following_url":"https://api.github.com/users/bengland2/following{/other_user}","gists_url":"https://api.github.com/users/bengland2/gists{/gist_id}","starred_url":"https://api.github.com/users/bengland2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bengland2/subscriptions","organizations_url":"https://api.github.com/users/bengland2/orgs","repos_url":"https://api.github.com/users/bengland2/repos","events_url":"https://api.github.com/users/bengland2/events{/privacy}","received_events_url":"https://api.github.com/users/bengland2/received_events","type":"User","site_admin":false},"repo":{"id":43825420,"name":"ceph-ansible","full_name":"bengland2/ceph-ansible","owner":{"login":"bengland2","id":1717107,"avatar_url":"https://avatars.githubusercontent.com/u/1717107?v=3","gravatar_id":"","url":"https://api.github.com/users/bengland2","html_url":"https://github.com/bengland2","followers_url":"https://api.github.com/users/bengland2/followers","following_url":"https://api.github.com/users/bengland2/following{/other_user}","gists_url":"https://api.github.com/users/bengland2/gists{/gist_id}","starred_url":"https://api.github.com/users/bengland2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bengland2/subscriptions","organizations_url":"https://api.github.com/users/bengland2/orgs","repos_url":"https://api.github.com/users/bengland2/repos","events_url":"https://api.github.com/users/bengland2/events{/privacy}","received_events_url":"https://api.github.com/users/bengland2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bengland2/ceph-ansible","description":"Ansible playbooks for Ceph","fork":true,"url":"https://api.github.com/repos/bengland2/ceph-ansible","forks_url":"https://api.github.com/repos/bengland2/ceph-ansible/forks","keys_url":"https://api.github.com/repos/bengland2/ceph-ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bengland2/ceph-ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bengland2/ceph-ansible/teams","hooks_url":"https://api.github.com/repos/bengland2/ceph-ansible/hooks","issue_events_url":"https://api.github.com/repos/bengland2/ceph-ansible/issues/events{/number}","events_url":"https://api.github.com/repos/bengland2/ceph-ansible/events","assignees_url":"https://api.github.com/repos/bengland2/ceph-ansible/assignees{/user}","branches_url":"https://api.github.com/repos/bengland2/ceph-ansible/branches{/branch}","tags_url":"https://api.github.com/repos/bengland2/ceph-ansible/tags","blobs_url":"https://api.github.com/repos/bengland2/ceph-ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bengland2/ceph-ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bengland2/ceph-ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/bengland2/ceph-ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bengland2/ceph-ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/bengland2/ceph-ansible/languages","stargazers_url":"https://api.github.com/repos/bengland2/ceph-ansible/stargazers","contributors_url":"https://api.github.com/repos/bengland2/ceph-ansible/contributors","subscribers_url":"https://api.github.com/repos/bengland2/ceph-ansible/subscribers","subscription_url":"https://api.github.com/repos/bengland2/ceph-ansible/subscription","commits_url":"https://api.github.com/repos/bengland2/ceph-ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/bengland2/ceph-ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/bengland2/ceph-ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/bengland2/ceph-ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/bengland2/ceph-ansible/contents/{+path}","compare_url":"https://api.github.com/repos/bengland2/ceph-ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bengland2/ceph-ansible/merges","archive_url":"https://api.github.com/repos/bengland2/ceph-ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bengland2/ceph-ansible/downloads","issues_url":"https://api.github.com/repos/bengland2/ceph-ansible/issues{/number}","pulls_url":"https://api.github.com/repos/bengland2/ceph-ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/bengland2/ceph-ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/bengland2/ceph-ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bengland2/ceph-ansible/labels{/name}","releases_url":"https://api.github.com/repos/bengland2/ceph-ansible/releases{/id}","created_at":"2015-10-07T15:26:56Z","updated_at":"2015-10-07T15:26:57Z","pushed_at":"2015-10-07T16:51:06Z","git_url":"git://github.com/bengland2/ceph-ansible.git","ssh_url":"git@github.com:bengland2/ceph-ansible.git","clone_url":"https://github.com/bengland2/ceph-ansible.git","svn_url":"https://github.com/bengland2/ceph-ansible","homepage":null,"size":24675,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ceph:master","ref":"master","sha":"2c01567a4f0016aa5a0762c871f479ff40689fcf","user":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"repo":{"id":17373313,"name":"ceph-ansible","full_name":"ceph/ceph-ansible","owner":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ceph/ceph-ansible","description":"Ansible playbooks for Ceph","fork":false,"url":"https://api.github.com/repos/ceph/ceph-ansible","forks_url":"https://api.github.com/repos/ceph/ceph-ansible/forks","keys_url":"https://api.github.com/repos/ceph/ceph-ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/ceph-ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/ceph-ansible/teams","hooks_url":"https://api.github.com/repos/ceph/ceph-ansible/hooks","issue_events_url":"https://api.github.com/repos/ceph/ceph-ansible/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/ceph-ansible/events","assignees_url":"https://api.github.com/repos/ceph/ceph-ansible/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/ceph-ansible/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/ceph-ansible/tags","blobs_url":"https://api.github.com/repos/ceph/ceph-ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/ceph-ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/ceph-ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/ceph-ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/ceph-ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/ceph-ansible/languages","stargazers_url":"https://api.github.com/repos/ceph/ceph-ansible/stargazers","contributors_url":"https://api.github.com/repos/ceph/ceph-ansible/contributors","subscribers_url":"https://api.github.com/repos/ceph/ceph-ansible/subscribers","subscription_url":"https://api.github.com/repos/ceph/ceph-ansible/subscription","commits_url":"https://api.github.com/repos/ceph/ceph-ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/ceph-ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/ceph-ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/ceph-ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceph/ceph-ansible/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/ceph-ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/ceph-ansible/merges","archive_url":"https://api.github.com/repos/ceph/ceph-ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/ceph-ansible/downloads","issues_url":"https://api.github.com/repos/ceph/ceph-ansible/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/ceph-ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/ceph-ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/ceph-ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/ceph-ansible/labels{/name}","releases_url":"https://api.github.com/repos/ceph/ceph-ansible/releases{/id}","created_at":"2014-03-03T17:12:09Z","updated_at":"2015-10-01T12:55:55Z","pushed_at":"2015-10-07T16:51:06Z","git_url":"git://github.com/ceph/ceph-ansible.git","ssh_url":"git@github.com:ceph/ceph-ansible.git","clone_url":"https://github.com/ceph/ceph-ansible.git","svn_url":"https://github.com/ceph/ceph-ansible","homepage":null,"size":24675,"stargazers_count":150,"watchers_count":150,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":97,"mirror_url":null,"open_issues_count":17,"forks":97,"open_issues":17,"watchers":150,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph-ansible/pulls/412"},"html":{"href":"https://github.com/ceph/ceph-ansible/pull/412"},"issue":{"href":"https://api.github.com/repos/ceph/ceph-ansible/issues/412"},"comments":{"href":"https://api.github.com/repos/ceph/ceph-ansible/issues/412/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph-ansible/pulls/412/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph-ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph-ansible/pulls/412/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph-ansible/statuses/543e4cb2449ae72f3b1c8ecfd08b644a54db76e9"}}}}