{"action":"created","comment":{"url":"https://api.github.com/repos/dimagi/commcarehq-ansible/pulls/comments/70375132","id":70375132,"diff_hunk":"@@ -0,0 +1,61 @@\n+---\n+# roles/pg_standby/tasks/main.yml\n+\n+- name: Create wal archive directory\n+  sudo: yes\n+  file:\n+    path: '{{ archive_dir }}'\n+    owner: postgres\n+    group: postgres\n+    mode: 0755\n+    state: directory\n+\n+- name: PostgreSQL recovery configuration\n+  sudo_user: postgres\n+  template: src=recovery.conf.j2 dest={{ postgresql_config_home }}/recovery.conf\n+  notify: Restart postgres\n+\n+- name: create backup directory\n+  sudo: yes\n+  file:\n+    path: '{{ postgresql_backup_dir }}'\n+    owner: postgres\n+    group: postgres\n+    mode: 0755\n+    state: directory\n+  when: backup_postgres\n+\n+- name: Copy postgres backup script\n+  sudo: yes\n+  template:\n+    src: \"create_postgres_dump.sh.j2\"\n+    dest: \"/etc/cron.d/create_postgres_dump.sh\"\n+    group: postgres\n+    owner: postgres\n+    mode: 0700\n+    backup: yes\n+  when: backup_postgres","path":"ansible/roles/pg_standby/tasks/main.yml","position":37,"original_position":37,"commit_id":"5858fd773a6026f3d681e3b5946d3a897b3c5c45","original_commit_id":"5858fd773a6026f3d681e3b5946d3a897b3c5c45","user":{"login":"benrudolph","id":918514,"avatar_url":"https://avatars.githubusercontent.com/u/918514?v=3","gravatar_id":"","url":"https://api.github.com/users/benrudolph","html_url":"https://github.com/benrudolph","followers_url":"https://api.github.com/users/benrudolph/followers","following_url":"https://api.github.com/users/benrudolph/following{/other_user}","gists_url":"https://api.github.com/users/benrudolph/gists{/gist_id}","starred_url":"https://api.github.com/users/benrudolph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benrudolph/subscriptions","organizations_url":"https://api.github.com/users/benrudolph/orgs","repos_url":"https://api.github.com/users/benrudolph/repos","events_url":"https://api.github.com/users/benrudolph/events{/privacy}","received_events_url":"https://api.github.com/users/benrudolph/received_events","type":"User","site_admin":false},"body":"ah i see that that module doesn't let you do templating and that you already found the cron module below","created_at":"2016-07-12T04:16:09Z","updated_at":"2016-07-12T04:16:09Z","html_url":"https://github.com/dimagi/commcarehq-ansible/pull/454#discussion_r70375132","pull_request_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/pulls/454","_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcarehq-ansible/pulls/comments/70375132"},"html":{"href":"https://github.com/dimagi/commcarehq-ansible/pull/454#discussion_r70375132"},"pull_request":{"href":"https://api.github.com/repos/dimagi/commcarehq-ansible/pulls/454"}}},"pull_request":{"url":"https://api.github.com/repos/dimagi/commcarehq-ansible/pulls/454","id":76889608,"html_url":"https://github.com/dimagi/commcarehq-ansible/pull/454","diff_url":"https://github.com/dimagi/commcarehq-ansible/pull/454.diff","patch_url":"https://github.com/dimagi/commcarehq-ansible/pull/454.patch","issue_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/issues/454","number":454,"state":"open","locked":false,"title":"Ce/pg standby","user":{"login":"calellowitz","id":6844721,"avatar_url":"https://avatars.githubusercontent.com/u/6844721?v=3","gravatar_id":"","url":"https://api.github.com/users/calellowitz","html_url":"https://github.com/calellowitz","followers_url":"https://api.github.com/users/calellowitz/followers","following_url":"https://api.github.com/users/calellowitz/following{/other_user}","gists_url":"https://api.github.com/users/calellowitz/gists{/gist_id}","starred_url":"https://api.github.com/users/calellowitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calellowitz/subscriptions","organizations_url":"https://api.github.com/users/calellowitz/orgs","repos_url":"https://api.github.com/users/calellowitz/repos","events_url":"https://api.github.com/users/calellowitz/events{/privacy}","received_events_url":"https://api.github.com/users/calellowitz/received_events","type":"User","site_admin":false},"body":"@benrudolph @czue @millerdev @snopoke \r\nHere is my first pass at a hot standby setup for postgres. Setting it all up still requires a few manual actions (setting up ssh between the db and standby machines, taking a filesystem backup of the main db and rsyncing it to the standby machine, moving the `recovery.conf` file to the data directory on the standby machine, and restarting postgres on the standby machine), but I wanted to get the deployment work reviewed as soon as possible, so we can get the standby up.","created_at":"2016-07-11T01:19:32Z","updated_at":"2016-07-12T04:16:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7366bf6b3752ced6ff58c0ea8aae88a3a4d81d51","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/pulls/454/commits","review_comments_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/pulls/454/comments","review_comment_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/issues/454/comments","statuses_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/statuses/5858fd773a6026f3d681e3b5946d3a897b3c5c45","head":{"label":"dimagi:ce/pg-standby","ref":"ce/pg-standby","sha":"5858fd773a6026f3d681e3b5946d3a897b3c5c45","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":22074543,"name":"commcarehq-ansible","full_name":"dimagi/commcarehq-ansible","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcarehq-ansible","description":"","fork":false,"url":"https://api.github.com/repos/dimagi/commcarehq-ansible","forks_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/forks","keys_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/teams","hooks_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/events","assignees_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/tags","blobs_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/subscription","commits_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/merges","archive_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/downloads","issues_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/releases{/id}","deployments_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/deployments","created_at":"2014-07-21T18:04:26Z","updated_at":"2016-01-19T13:00:50Z","pushed_at":"2016-07-12T03:33:18Z","git_url":"git://github.com/dimagi/commcarehq-ansible.git","ssh_url":"git@github.com:dimagi/commcarehq-ansible.git","clone_url":"https://github.com/dimagi/commcarehq-ansible.git","svn_url":"https://github.com/dimagi/commcarehq-ansible","homepage":null,"size":1373,"stargazers_count":2,"watchers_count":2,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":14,"forks":3,"open_issues":14,"watchers":2,"default_branch":"master"}},"base":{"label":"dimagi:master","ref":"master","sha":"33677a5624515864ac33d7d86e613cffb82decfe","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":22074543,"name":"commcarehq-ansible","full_name":"dimagi/commcarehq-ansible","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcarehq-ansible","description":"","fork":false,"url":"https://api.github.com/repos/dimagi/commcarehq-ansible","forks_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/forks","keys_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/teams","hooks_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/events","assignees_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/tags","blobs_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/subscription","commits_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/merges","archive_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/downloads","issues_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/releases{/id}","deployments_url":"https://api.github.com/repos/dimagi/commcarehq-ansible/deployments","created_at":"2014-07-21T18:04:26Z","updated_at":"2016-01-19T13:00:50Z","pushed_at":"2016-07-12T03:33:18Z","git_url":"git://github.com/dimagi/commcarehq-ansible.git","ssh_url":"git@github.com:dimagi/commcarehq-ansible.git","clone_url":"https://github.com/dimagi/commcarehq-ansible.git","svn_url":"https://github.com/dimagi/commcarehq-ansible","homepage":null,"size":1373,"stargazers_count":2,"watchers_count":2,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":14,"forks":3,"open_issues":14,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcarehq-ansible/pulls/454"},"html":{"href":"https://github.com/dimagi/commcarehq-ansible/pull/454"},"issue":{"href":"https://api.github.com/repos/dimagi/commcarehq-ansible/issues/454"},"comments":{"href":"https://api.github.com/repos/dimagi/commcarehq-ansible/issues/454/comments"},"review_comments":{"href":"https://api.github.com/repos/dimagi/commcarehq-ansible/pulls/454/comments"},"review_comment":{"href":"https://api.github.com/repos/dimagi/commcarehq-ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dimagi/commcarehq-ansible/pulls/454/commits"},"statuses":{"href":"https://api.github.com/repos/dimagi/commcarehq-ansible/statuses/5858fd773a6026f3d681e3b5946d3a897b3c5c45"}}}}
{"actor":{"display_login":"benrudolph"}}