{"action":"created","comment":{"url":"https://api.github.com/repos/blueboxgroup/ursula/pulls/comments/37940280","id":37940280,"diff_hunk":"@@ -0,0 +1,102 @@\n+---\n+# we're storing the monitor_secret in a file on the first monitor node\n+- name: check if mon_secrets file exists\n+  stat: path=/var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}\n+  run_once: true\n+  delegate_to: \"{{ groups['mons'][0] }}\"\n+  failed_when: false\n+  register: mon_file_check\n+\n+- name: create monitor initial keyring\n+  command: ceph-authtool /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }} --create-keyring --name=mon. --gen-key --cap mon 'allow *'\n+           creates=/var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}\n+  run_once: true\n+  delegate_to:  \"{{ groups['mons'][0] }}\"\n+  when: mon_file_check.stat.exists == false\n+\n+- name: fetch contents of mon_secret file\n+  slurp: path=/var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}\n+  run_once: true\n+  delegate_to: \"{{ groups['mons'][0] }}\"\n+  register: mon_secret_file\n+\n+- name: copy mon_secret to all hosts\n+  copy:\n+    dest: /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}\n+    content: \"{{ hostvars[groups['mons'][0]]['mon_secret_file']['content'] | b64decode }}\"\n+\n+- name: set initial monitor key permissions\n+  file: path=/var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}\n+        mode=0600\n+        owner=root\n+        group=root\n+\n+- name: create monitor directory\n+  file: path=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}\n+        state=directory\n+        owner=root\n+        group=root\n+        mode=0755\n+\n+- name: ceph monitor mkfs\n+  command: ceph-mon --mkfs -i {{ ansible_hostname }} --fsid {{ fsid_file.content | b64decode }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}\n+           creates=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/keyring\n+\n+- name: activate monitor with upstart\n+  file: path=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/{{ item }}\n+        state=touch\n+        owner=root\n+        group=root\n+        mode=0600\n+  with_items:\n+    - done\n+    - upstart\n+  changed_when: false\n+\n+- name: ensure ceph-mon service enabled and started\n+  service: name=ceph-mon\n+           state=started\n+           enabled=yes\n+           args=id={{ ansible_hostname }}\n+\n+# NOTE (leseb): wait for mon discovery and quorum resolution\n+# the admin key is not instantanely created so we have to wait a bit\n+- name: wait for client.admin key exists\n+  wait_for: path=/etc/ceph/ceph.client.admin.keyring\n+\n+- name: create openstack pool\n+  command: rados mkpool {{ item }}\n+  with_items:\n+    - \"{{ ceph_monitor.openstack_block_storage_pool }}\"\n+  failed_when: false\n+\n+- name: create openstack keys\n+  command: ceph auth get-or-create {{ item.name }} {{ item.value }} -o /etc/ceph/ceph.{{ item.name }}.keyring\n+           creates=/etc/ceph/ceph.{{ item.name }}.keyring\n+  with_items: ceph_monitor.openstack_keys\n+\n+- name: find ceph keys\n+  shell: ls -1 /etc/ceph/*.keyring","path":"roles/ceph-monitor/tasks/main.yml","position":68,"original_position":79,"commit_id":"2ee6a3091bb1e5bb198a72b18930d7e3b813d837","original_commit_id":"55b52e6067f31896879dc9dec50f8d9a432dd3bc","user":{"login":"msambol","id":3310356,"avatar_url":"https://avatars.githubusercontent.com/u/3310356?v=3","gravatar_id":"","url":"https://api.github.com/users/msambol","html_url":"https://github.com/msambol","followers_url":"https://api.github.com/users/msambol/followers","following_url":"https://api.github.com/users/msambol/following{/other_user}","gists_url":"https://api.github.com/users/msambol/gists{/gist_id}","starred_url":"https://api.github.com/users/msambol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msambol/subscriptions","organizations_url":"https://api.github.com/users/msambol/orgs","repos_url":"https://api.github.com/users/msambol/repos","events_url":"https://api.github.com/users/msambol/events{/privacy}","received_events_url":"https://api.github.com/users/msambol/received_events","type":"User","site_admin":false},"body":"We decided to use `shell` here..","created_at":"2015-08-26T01:59:34Z","updated_at":"2015-08-26T01:59:34Z","html_url":"https://github.com/blueboxgroup/ursula/pull/1107#discussion_r37940280","pull_request_url":"https://api.github.com/repos/blueboxgroup/ursula/pulls/1107","_links":{"self":{"href":"https://api.github.com/repos/blueboxgroup/ursula/pulls/comments/37940280"},"html":{"href":"https://github.com/blueboxgroup/ursula/pull/1107#discussion_r37940280"},"pull_request":{"href":"https://api.github.com/repos/blueboxgroup/ursula/pulls/1107"}}},"pull_request":{"url":"https://api.github.com/repos/blueboxgroup/ursula/pulls/1107","id":41279249,"html_url":"https://github.com/blueboxgroup/ursula/pull/1107","diff_url":"https://github.com/blueboxgroup/ursula/pull/1107.diff","patch_url":"https://github.com/blueboxgroup/ursula/pull/1107.patch","issue_url":"https://api.github.com/repos/blueboxgroup/ursula/issues/1107","number":1107,"state":"open","locked":false,"title":"Initial check-in for ceph-mon role.","user":{"login":"lyandrew","id":1498613,"avatar_url":"https://avatars.githubusercontent.com/u/1498613?v=3","gravatar_id":"","url":"https://api.github.com/users/lyandrew","html_url":"https://github.com/lyandrew","followers_url":"https://api.github.com/users/lyandrew/followers","following_url":"https://api.github.com/users/lyandrew/following{/other_user}","gists_url":"https://api.github.com/users/lyandrew/gists{/gist_id}","starred_url":"https://api.github.com/users/lyandrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lyandrew/subscriptions","organizations_url":"https://api.github.com/users/lyandrew/orgs","repos_url":"https://api.github.com/users/lyandrew/repos","events_url":"https://api.github.com/users/lyandrew/events{/privacy}","received_events_url":"https://api.github.com/users/lyandrew/received_events","type":"User","site_admin":false},"body":"Check in for ceph monitor role.","created_at":"2015-07-30T20:39:16Z","updated_at":"2015-08-26T01:59:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d62fea7fabe2549bbf3bd6f288691aa01319370","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/blueboxgroup/ursula/pulls/1107/commits","review_comments_url":"https://api.github.com/repos/blueboxgroup/ursula/pulls/1107/comments","review_comment_url":"https://api.github.com/repos/blueboxgroup/ursula/pulls/comments{/number}","comments_url":"https://api.github.com/repos/blueboxgroup/ursula/issues/1107/comments","statuses_url":"https://api.github.com/repos/blueboxgroup/ursula/statuses/2ee6a3091bb1e5bb198a72b18930d7e3b813d837","head":{"label":"lyandrew:ceph-mon","ref":"ceph-mon","sha":"2ee6a3091bb1e5bb198a72b18930d7e3b813d837","user":{"login":"lyandrew","id":1498613,"avatar_url":"https://avatars.githubusercontent.com/u/1498613?v=3","gravatar_id":"","url":"https://api.github.com/users/lyandrew","html_url":"https://github.com/lyandrew","followers_url":"https://api.github.com/users/lyandrew/followers","following_url":"https://api.github.com/users/lyandrew/following{/other_user}","gists_url":"https://api.github.com/users/lyandrew/gists{/gist_id}","starred_url":"https://api.github.com/users/lyandrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lyandrew/subscriptions","organizations_url":"https://api.github.com/users/lyandrew/orgs","repos_url":"https://api.github.com/users/lyandrew/repos","events_url":"https://api.github.com/users/lyandrew/events{/privacy}","received_events_url":"https://api.github.com/users/lyandrew/received_events","type":"User","site_admin":false},"repo":{"id":39970731,"name":"ursula","full_name":"lyandrew/ursula","owner":{"login":"lyandrew","id":1498613,"avatar_url":"https://avatars.githubusercontent.com/u/1498613?v=3","gravatar_id":"","url":"https://api.github.com/users/lyandrew","html_url":"https://github.com/lyandrew","followers_url":"https://api.github.com/users/lyandrew/followers","following_url":"https://api.github.com/users/lyandrew/following{/other_user}","gists_url":"https://api.github.com/users/lyandrew/gists{/gist_id}","starred_url":"https://api.github.com/users/lyandrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lyandrew/subscriptions","organizations_url":"https://api.github.com/users/lyandrew/orgs","repos_url":"https://api.github.com/users/lyandrew/repos","events_url":"https://api.github.com/users/lyandrew/events{/privacy}","received_events_url":"https://api.github.com/users/lyandrew/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lyandrew/ursula","description":"Ansible playbooks for operating OpenStack - Powers Blue Box Cloud.","fork":true,"url":"https://api.github.com/repos/lyandrew/ursula","forks_url":"https://api.github.com/repos/lyandrew/ursula/forks","keys_url":"https://api.github.com/repos/lyandrew/ursula/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lyandrew/ursula/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lyandrew/ursula/teams","hooks_url":"https://api.github.com/repos/lyandrew/ursula/hooks","issue_events_url":"https://api.github.com/repos/lyandrew/ursula/issues/events{/number}","events_url":"https://api.github.com/repos/lyandrew/ursula/events","assignees_url":"https://api.github.com/repos/lyandrew/ursula/assignees{/user}","branches_url":"https://api.github.com/repos/lyandrew/ursula/branches{/branch}","tags_url":"https://api.github.com/repos/lyandrew/ursula/tags","blobs_url":"https://api.github.com/repos/lyandrew/ursula/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lyandrew/ursula/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lyandrew/ursula/git/refs{/sha}","trees_url":"https://api.github.com/repos/lyandrew/ursula/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lyandrew/ursula/statuses/{sha}","languages_url":"https://api.github.com/repos/lyandrew/ursula/languages","stargazers_url":"https://api.github.com/repos/lyandrew/ursula/stargazers","contributors_url":"https://api.github.com/repos/lyandrew/ursula/contributors","subscribers_url":"https://api.github.com/repos/lyandrew/ursula/subscribers","subscription_url":"https://api.github.com/repos/lyandrew/ursula/subscription","commits_url":"https://api.github.com/repos/lyandrew/ursula/commits{/sha}","git_commits_url":"https://api.github.com/repos/lyandrew/ursula/git/commits{/sha}","comments_url":"https://api.github.com/repos/lyandrew/ursula/comments{/number}","issue_comment_url":"https://api.github.com/repos/lyandrew/ursula/issues/comments{/number}","contents_url":"https://api.github.com/repos/lyandrew/ursula/contents/{+path}","compare_url":"https://api.github.com/repos/lyandrew/ursula/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lyandrew/ursula/merges","archive_url":"https://api.github.com/repos/lyandrew/ursula/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lyandrew/ursula/downloads","issues_url":"https://api.github.com/repos/lyandrew/ursula/issues{/number}","pulls_url":"https://api.github.com/repos/lyandrew/ursula/pulls{/number}","milestones_url":"https://api.github.com/repos/lyandrew/ursula/milestones{/number}","notifications_url":"https://api.github.com/repos/lyandrew/ursula/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lyandrew/ursula/labels{/name}","releases_url":"https://api.github.com/repos/lyandrew/ursula/releases{/id}","created_at":"2015-07-30T20:23:10Z","updated_at":"2015-07-30T20:23:11Z","pushed_at":"2015-08-25T03:57:06Z","git_url":"git://github.com/lyandrew/ursula.git","ssh_url":"git@github.com:lyandrew/ursula.git","clone_url":"https://github.com/lyandrew/ursula.git","svn_url":"https://github.com/lyandrew/ursula","homepage":"https://www.blueboxcloud.com","size":3305,"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":"blueboxgroup:master","ref":"master","sha":"a805d2671612a11a2f156baee1f02e1f93db7c57","user":{"login":"blueboxgroup","id":458705,"avatar_url":"https://avatars.githubusercontent.com/u/458705?v=3","gravatar_id":"","url":"https://api.github.com/users/blueboxgroup","html_url":"https://github.com/blueboxgroup","followers_url":"https://api.github.com/users/blueboxgroup/followers","following_url":"https://api.github.com/users/blueboxgroup/following{/other_user}","gists_url":"https://api.github.com/users/blueboxgroup/gists{/gist_id}","starred_url":"https://api.github.com/users/blueboxgroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueboxgroup/subscriptions","organizations_url":"https://api.github.com/users/blueboxgroup/orgs","repos_url":"https://api.github.com/users/blueboxgroup/repos","events_url":"https://api.github.com/users/blueboxgroup/events{/privacy}","received_events_url":"https://api.github.com/users/blueboxgroup/received_events","type":"Organization","site_admin":false},"repo":{"id":11848896,"name":"ursula","full_name":"blueboxgroup/ursula","owner":{"login":"blueboxgroup","id":458705,"avatar_url":"https://avatars.githubusercontent.com/u/458705?v=3","gravatar_id":"","url":"https://api.github.com/users/blueboxgroup","html_url":"https://github.com/blueboxgroup","followers_url":"https://api.github.com/users/blueboxgroup/followers","following_url":"https://api.github.com/users/blueboxgroup/following{/other_user}","gists_url":"https://api.github.com/users/blueboxgroup/gists{/gist_id}","starred_url":"https://api.github.com/users/blueboxgroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueboxgroup/subscriptions","organizations_url":"https://api.github.com/users/blueboxgroup/orgs","repos_url":"https://api.github.com/users/blueboxgroup/repos","events_url":"https://api.github.com/users/blueboxgroup/events{/privacy}","received_events_url":"https://api.github.com/users/blueboxgroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/blueboxgroup/ursula","description":"Ansible playbooks for operating OpenStack - Powers Blue Box Cloud.","fork":false,"url":"https://api.github.com/repos/blueboxgroup/ursula","forks_url":"https://api.github.com/repos/blueboxgroup/ursula/forks","keys_url":"https://api.github.com/repos/blueboxgroup/ursula/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blueboxgroup/ursula/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blueboxgroup/ursula/teams","hooks_url":"https://api.github.com/repos/blueboxgroup/ursula/hooks","issue_events_url":"https://api.github.com/repos/blueboxgroup/ursula/issues/events{/number}","events_url":"https://api.github.com/repos/blueboxgroup/ursula/events","assignees_url":"https://api.github.com/repos/blueboxgroup/ursula/assignees{/user}","branches_url":"https://api.github.com/repos/blueboxgroup/ursula/branches{/branch}","tags_url":"https://api.github.com/repos/blueboxgroup/ursula/tags","blobs_url":"https://api.github.com/repos/blueboxgroup/ursula/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blueboxgroup/ursula/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blueboxgroup/ursula/git/refs{/sha}","trees_url":"https://api.github.com/repos/blueboxgroup/ursula/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blueboxgroup/ursula/statuses/{sha}","languages_url":"https://api.github.com/repos/blueboxgroup/ursula/languages","stargazers_url":"https://api.github.com/repos/blueboxgroup/ursula/stargazers","contributors_url":"https://api.github.com/repos/blueboxgroup/ursula/contributors","subscribers_url":"https://api.github.com/repos/blueboxgroup/ursula/subscribers","subscription_url":"https://api.github.com/repos/blueboxgroup/ursula/subscription","commits_url":"https://api.github.com/repos/blueboxgroup/ursula/commits{/sha}","git_commits_url":"https://api.github.com/repos/blueboxgroup/ursula/git/commits{/sha}","comments_url":"https://api.github.com/repos/blueboxgroup/ursula/comments{/number}","issue_comment_url":"https://api.github.com/repos/blueboxgroup/ursula/issues/comments{/number}","contents_url":"https://api.github.com/repos/blueboxgroup/ursula/contents/{+path}","compare_url":"https://api.github.com/repos/blueboxgroup/ursula/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blueboxgroup/ursula/merges","archive_url":"https://api.github.com/repos/blueboxgroup/ursula/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blueboxgroup/ursula/downloads","issues_url":"https://api.github.com/repos/blueboxgroup/ursula/issues{/number}","pulls_url":"https://api.github.com/repos/blueboxgroup/ursula/pulls{/number}","milestones_url":"https://api.github.com/repos/blueboxgroup/ursula/milestones{/number}","notifications_url":"https://api.github.com/repos/blueboxgroup/ursula/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blueboxgroup/ursula/labels{/name}","releases_url":"https://api.github.com/repos/blueboxgroup/ursula/releases{/id}","created_at":"2013-08-02T17:37:26Z","updated_at":"2015-08-21T22:43:39Z","pushed_at":"2015-08-26T00:15:55Z","git_url":"git://github.com/blueboxgroup/ursula.git","ssh_url":"git@github.com:blueboxgroup/ursula.git","clone_url":"https://github.com/blueboxgroup/ursula.git","svn_url":"https://github.com/blueboxgroup/ursula","homepage":"https://www.blueboxcloud.com","size":13386,"stargazers_count":95,"watchers_count":95,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":41,"forks":53,"open_issues":41,"watchers":95,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/blueboxgroup/ursula/pulls/1107"},"html":{"href":"https://github.com/blueboxgroup/ursula/pull/1107"},"issue":{"href":"https://api.github.com/repos/blueboxgroup/ursula/issues/1107"},"comments":{"href":"https://api.github.com/repos/blueboxgroup/ursula/issues/1107/comments"},"review_comments":{"href":"https://api.github.com/repos/blueboxgroup/ursula/pulls/1107/comments"},"review_comment":{"href":"https://api.github.com/repos/blueboxgroup/ursula/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/blueboxgroup/ursula/pulls/1107/commits"},"statuses":{"href":"https://api.github.com/repos/blueboxgroup/ursula/statuses/2ee6a3091bb1e5bb198a72b18930d7e3b813d837"}}}}