)]}'
{"defaults/main.yml":[{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"55eb5d148505de2f3e38fe7d9af8600a4d0e6498","unresolved":false,"context_lines":[{"line_number":213,"context_line":"#galera_mariadb_backups_enabled: true"},{"line_number":214,"context_line":"#galera_mariadb_backups_path: \"/srv/mariadb_backups\""},{"line_number":215,"context_line":"#galera_mariadb_backups_copies: 2"},{"line_number":216,"context_line":"#galera_mariadb_backups_full_OnCalendar:"},{"line_number":217,"context_line":"# - \"*-*-* 00:00:00\""},{"line_number":218,"context_line":"#galera_mariadb_backups_increment_OnCalendar:"},{"line_number":219,"context_line":"# - \"*-*-* 06:00:00\""}],"source_content_type":"text/x-yaml","patch_set":1,"id":"9f560f44_2269f4f7","line":216,"range":{"start_line":216,"start_character":1,"end_line":216,"end_character":40},"updated":"2020-09-30 12:30:14.000000000","message":"could do with a comment here about what the meaning of the fields is","commit_id":"98689362bc83c4782931094825b52e7b925e032b"},{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"3be37c5baa2a54ffe7a5d0fd71f15a2373ae73d3","unresolved":false,"context_lines":[{"line_number":213,"context_line":"galera_mariadb_backups_enabled: false"},{"line_number":214,"context_line":"#galera_mariadb_backups_path: \"/srv/mariadb_backups\""},{"line_number":215,"context_line":"#galera_mariadb_backups_copies: 2"},{"line_number":216,"context_line":"#galera_mariadb_backups_full_OnCalendar: \"*-*-* 00:00:00\""},{"line_number":217,"context_line":"#galera_mariadb_backups_increment_OnCalendar: \"*-*-* 12:00:00\""},{"line_number":218,"context_line":"#galera_mariadb_backups_user: galera_mariadb_backup"},{"line_number":219,"context_line":"#galera_mariadb_backups_password: SuperSecrete1"}],"source_content_type":"text/x-yaml","patch_set":2,"id":"9f560f44_2af68fd9","line":216,"range":{"start_line":216,"start_character":29,"end_line":216,"end_character":39},"updated":"2020-10-07 07:44:46.000000000","message":"we\u0027ve not really got much camelcase at all in OSA variables, for consistency should probably be _on_calendar","commit_id":"cbe5159bcebb9c8db3d82868690f76d797744de7"},{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"3be37c5baa2a54ffe7a5d0fd71f15a2373ae73d3","unresolved":false,"context_lines":[{"line_number":214,"context_line":"#galera_mariadb_backups_path: \"/srv/mariadb_backups\""},{"line_number":215,"context_line":"#galera_mariadb_backups_copies: 2"},{"line_number":216,"context_line":"#galera_mariadb_backups_full_OnCalendar: \"*-*-* 00:00:00\""},{"line_number":217,"context_line":"#galera_mariadb_backups_increment_OnCalendar: \"*-*-* 12:00:00\""},{"line_number":218,"context_line":"#galera_mariadb_backups_user: galera_mariadb_backup"},{"line_number":219,"context_line":"#galera_mariadb_backups_password: SuperSecrete1"},{"line_number":220,"context_line":"#galera_mariadb_backups_suffix: \"{{ inventory_hostname }}\""}],"source_content_type":"text/x-yaml","patch_set":2,"id":"9f560f44_0af3cbe8","line":217,"range":{"start_line":217,"start_character":34,"end_line":217,"end_character":44},"updated":"2020-10-07 07:44:46.000000000","message":"similar camelcase","commit_id":"cbe5159bcebb9c8db3d82868690f76d797744de7"},{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"708e922aa12bdff76956c435d7a39fd04db2a3c9","unresolved":false,"context_lines":[{"line_number":211,"context_line":"# copies is the number of full backups to be kept, the corresponding"},{"line_number":212,"context_line":"# incremental backups will also be kept. Uses systemd timer instead of cron."},{"line_number":213,"context_line":"galera_mariadb_backups_enabled: false"},{"line_number":214,"context_line":"#galera_mariadb_backups_path: \"/srv/mariadb_backups\""},{"line_number":215,"context_line":"#galera_mariadb_backups_copies: 2"},{"line_number":216,"context_line":"#galera_mariadb_backups_full_on_calendar: \"*-*-* 00:00:00\""},{"line_number":217,"context_line":"#galera_mariadb_backups_increment_on_calendar: \"*-*-* 12:00:00\""}],"source_content_type":"text/x-yaml","patch_set":3,"id":"5f681702_fdcfa954","line":214,"range":{"start_line":214,"start_character":31,"end_line":214,"end_character":51},"updated":"2020-10-19 10:34:00.000000000","message":"and let\u0027s use /var/backup as it\u0027s bind mounted inside lxc","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"708e922aa12bdff76956c435d7a39fd04db2a3c9","unresolved":false,"context_lines":[{"line_number":211,"context_line":"# copies is the number of full backups to be kept, the corresponding"},{"line_number":212,"context_line":"# incremental backups will also be kept. Uses systemd timer instead of cron."},{"line_number":213,"context_line":"galera_mariadb_backups_enabled: false"},{"line_number":214,"context_line":"#galera_mariadb_backups_path: \"/srv/mariadb_backups\""},{"line_number":215,"context_line":"#galera_mariadb_backups_copies: 2"},{"line_number":216,"context_line":"#galera_mariadb_backups_full_on_calendar: \"*-*-* 00:00:00\""},{"line_number":217,"context_line":"#galera_mariadb_backups_increment_on_calendar: \"*-*-* 12:00:00\""}],"source_content_type":"text/x-yaml","patch_set":3,"id":"5f681702_5de17dd0","line":214,"range":{"start_line":214,"start_character":1,"end_line":214,"end_character":28},"updated":"2020-10-19 10:34:00.000000000","message":"why we comment it out? we don\u0027t have any check or default value defined later.","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":29865,"name":"Georgina Shippey","email":"georgina.shippey@outlook.com","username":"gshippey"},"change_message_id":"1bba041c3bd2f036b01f6be72cb3146070b5c22b","unresolved":false,"context_lines":[{"line_number":211,"context_line":"# copies is the number of full backups to be kept, the corresponding"},{"line_number":212,"context_line":"# incremental backups will also be kept. Uses systemd timer instead of cron."},{"line_number":213,"context_line":"galera_mariadb_backups_enabled: false"},{"line_number":214,"context_line":"#galera_mariadb_backups_path: \"/srv/mariadb_backups\""},{"line_number":215,"context_line":"#galera_mariadb_backups_copies: 2"},{"line_number":216,"context_line":"#galera_mariadb_backups_full_on_calendar: \"*-*-* 00:00:00\""},{"line_number":217,"context_line":"#galera_mariadb_backups_increment_on_calendar: \"*-*-* 12:00:00\""}],"source_content_type":"text/x-yaml","patch_set":3,"id":"3f65232a_d423b1bd","line":214,"range":{"start_line":214,"start_character":1,"end_line":214,"end_character":28},"in_reply_to":"5f681702_5de17dd0","updated":"2020-10-21 21:52:46.000000000","message":"Done","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":29865,"name":"Georgina Shippey","email":"georgina.shippey@outlook.com","username":"gshippey"},"change_message_id":"1bba041c3bd2f036b01f6be72cb3146070b5c22b","unresolved":false,"context_lines":[{"line_number":211,"context_line":"# copies is the number of full backups to be kept, the corresponding"},{"line_number":212,"context_line":"# incremental backups will also be kept. Uses systemd timer instead of cron."},{"line_number":213,"context_line":"galera_mariadb_backups_enabled: false"},{"line_number":214,"context_line":"#galera_mariadb_backups_path: \"/srv/mariadb_backups\""},{"line_number":215,"context_line":"#galera_mariadb_backups_copies: 2"},{"line_number":216,"context_line":"#galera_mariadb_backups_full_on_calendar: \"*-*-* 00:00:00\""},{"line_number":217,"context_line":"#galera_mariadb_backups_increment_on_calendar: \"*-*-* 12:00:00\""}],"source_content_type":"text/x-yaml","patch_set":3,"id":"3f65232a_b420b5b2","line":214,"range":{"start_line":214,"start_character":31,"end_line":214,"end_character":51},"in_reply_to":"5f681702_fdcfa954","updated":"2020-10-21 21:52:46.000000000","message":"Done","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"708e922aa12bdff76956c435d7a39fd04db2a3c9","unresolved":false,"context_lines":[{"line_number":212,"context_line":"# incremental backups will also be kept. Uses systemd timer instead of cron."},{"line_number":213,"context_line":"galera_mariadb_backups_enabled: false"},{"line_number":214,"context_line":"#galera_mariadb_backups_path: \"/srv/mariadb_backups\""},{"line_number":215,"context_line":"#galera_mariadb_backups_copies: 2"},{"line_number":216,"context_line":"#galera_mariadb_backups_full_on_calendar: \"*-*-* 00:00:00\""},{"line_number":217,"context_line":"#galera_mariadb_backups_increment_on_calendar: \"*-*-* 12:00:00\""},{"line_number":218,"context_line":"#galera_mariadb_backups_user: galera_mariadb_backup"}],"source_content_type":"text/x-yaml","patch_set":3,"id":"5f681702_5735def6","line":215,"range":{"start_line":215,"start_character":1,"end_line":215,"end_character":30},"updated":"2020-10-19 10:34:00.000000000","message":"let\u0027s specify that it\u0027s full copies we\u0027re talking about here. While incremented are not limited in the meanwhile (well, limited by amount of times they\u0027re launched in between of of full copies)","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":29865,"name":"Georgina Shippey","email":"georgina.shippey@outlook.com","username":"gshippey"},"change_message_id":"1bba041c3bd2f036b01f6be72cb3146070b5c22b","unresolved":false,"context_lines":[{"line_number":212,"context_line":"# incremental backups will also be kept. Uses systemd timer instead of cron."},{"line_number":213,"context_line":"galera_mariadb_backups_enabled: false"},{"line_number":214,"context_line":"#galera_mariadb_backups_path: \"/srv/mariadb_backups\""},{"line_number":215,"context_line":"#galera_mariadb_backups_copies: 2"},{"line_number":216,"context_line":"#galera_mariadb_backups_full_on_calendar: \"*-*-* 00:00:00\""},{"line_number":217,"context_line":"#galera_mariadb_backups_increment_on_calendar: \"*-*-* 12:00:00\""},{"line_number":218,"context_line":"#galera_mariadb_backups_user: galera_mariadb_backup"}],"source_content_type":"text/x-yaml","patch_set":3,"id":"3f65232a_0f6076ce","line":215,"range":{"start_line":215,"start_character":1,"end_line":215,"end_character":30},"in_reply_to":"5f681702_5735def6","updated":"2020-10-21 21:52:46.000000000","message":"Done","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"708e922aa12bdff76956c435d7a39fd04db2a3c9","unresolved":false,"context_lines":[{"line_number":213,"context_line":"galera_mariadb_backups_enabled: false"},{"line_number":214,"context_line":"#galera_mariadb_backups_path: \"/srv/mariadb_backups\""},{"line_number":215,"context_line":"#galera_mariadb_backups_copies: 2"},{"line_number":216,"context_line":"#galera_mariadb_backups_full_on_calendar: \"*-*-* 00:00:00\""},{"line_number":217,"context_line":"#galera_mariadb_backups_increment_on_calendar: \"*-*-* 12:00:00\""},{"line_number":218,"context_line":"#galera_mariadb_backups_user: galera_mariadb_backup"},{"line_number":219,"context_line":"#galera_mariadb_backups_password: SuperSecrete1"},{"line_number":220,"context_line":"#galera_mariadb_backups_suffix: \"{{ inventory_hostname }}\""}],"source_content_type":"text/x-yaml","patch_set":3,"id":"5f681702_3ddac116","line":217,"range":{"start_line":216,"start_character":0,"end_line":217,"end_character":63},"updated":"2020-10-19 10:34:00.000000000","message":"let\u0027s set some reasonable defaults?","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":29865,"name":"Georgina Shippey","email":"georgina.shippey@outlook.com","username":"gshippey"},"change_message_id":"1bba041c3bd2f036b01f6be72cb3146070b5c22b","unresolved":false,"context_lines":[{"line_number":213,"context_line":"galera_mariadb_backups_enabled: false"},{"line_number":214,"context_line":"#galera_mariadb_backups_path: \"/srv/mariadb_backups\""},{"line_number":215,"context_line":"#galera_mariadb_backups_copies: 2"},{"line_number":216,"context_line":"#galera_mariadb_backups_full_on_calendar: \"*-*-* 00:00:00\""},{"line_number":217,"context_line":"#galera_mariadb_backups_increment_on_calendar: \"*-*-* 12:00:00\""},{"line_number":218,"context_line":"#galera_mariadb_backups_user: galera_mariadb_backup"},{"line_number":219,"context_line":"#galera_mariadb_backups_password: SuperSecrete1"},{"line_number":220,"context_line":"#galera_mariadb_backups_suffix: \"{{ inventory_hostname }}\""}],"source_content_type":"text/x-yaml","patch_set":3,"id":"3f65232a_cfccbe63","line":217,"range":{"start_line":216,"start_character":0,"end_line":217,"end_character":63},"in_reply_to":"5f681702_3ddac116","updated":"2020-10-21 21:52:46.000000000","message":"Not entirely sure what reasonable is here","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"708e922aa12bdff76956c435d7a39fd04db2a3c9","unresolved":false,"context_lines":[{"line_number":216,"context_line":"#galera_mariadb_backups_full_on_calendar: \"*-*-* 00:00:00\""},{"line_number":217,"context_line":"#galera_mariadb_backups_increment_on_calendar: \"*-*-* 12:00:00\""},{"line_number":218,"context_line":"#galera_mariadb_backups_user: galera_mariadb_backup"},{"line_number":219,"context_line":"#galera_mariadb_backups_password: SuperSecrete1"},{"line_number":220,"context_line":"#galera_mariadb_backups_suffix: \"{{ inventory_hostname }}\""},{"line_number":221,"context_line":"#galera_mariadb_backups_cnf_file: \"/etc/mysql/mariabackup.cnf\""}],"source_content_type":"text/x-yaml","patch_set":3,"id":"5f681702_f7234abd","line":219,"range":{"start_line":219,"start_character":1,"end_line":219,"end_character":32},"updated":"2020-10-19 10:34:00.000000000","message":"I think we should add this to user-secrets instead","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":29865,"name":"Georgina Shippey","email":"georgina.shippey@outlook.com","username":"gshippey"},"change_message_id":"1bba041c3bd2f036b01f6be72cb3146070b5c22b","unresolved":false,"context_lines":[{"line_number":216,"context_line":"#galera_mariadb_backups_full_on_calendar: \"*-*-* 00:00:00\""},{"line_number":217,"context_line":"#galera_mariadb_backups_increment_on_calendar: \"*-*-* 12:00:00\""},{"line_number":218,"context_line":"#galera_mariadb_backups_user: galera_mariadb_backup"},{"line_number":219,"context_line":"#galera_mariadb_backups_password: SuperSecrete1"},{"line_number":220,"context_line":"#galera_mariadb_backups_suffix: \"{{ inventory_hostname }}\""},{"line_number":221,"context_line":"#galera_mariadb_backups_cnf_file: \"/etc/mysql/mariabackup.cnf\""}],"source_content_type":"text/x-yaml","patch_set":3,"id":"3f65232a_298f2bcd","line":219,"range":{"start_line":219,"start_character":1,"end_line":219,"end_character":32},"in_reply_to":"5f681702_f7234abd","updated":"2020-10-21 21:52:46.000000000","message":"Done","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"dd84433739775e860407f1870e14c553ffe634d3","unresolved":false,"context_lines":[{"line_number":221,"context_line":"galera_mariadb_backups_user: galera_mariadb_backup"},{"line_number":222,"context_line":"galera_mariadb_backups_suffix: \"{{ inventory_hostname }}\""},{"line_number":223,"context_line":"galera_mariadb_backups_cnf_file: \"/etc/mysql/mariabackup.cnf\""},{"line_number":224,"context_line":"galera_mariadb_backups_nodes: \"{{ galera_server_bootstrap_node }}\""}],"source_content_type":"text/x-yaml","patch_set":4,"id":"3f65232a_a0d508bc","line":224,"range":{"start_line":224,"start_character":0,"end_line":224,"end_character":66},"updated":"2020-10-22 08:37:56.000000000","message":"this seems to duplicate galera_mariadb_backups_enabled, wouldn\u0027t we just set that true/false in host/group_vars as needed to select which nodes run a backup?","commit_id":"60c050351b10cbb2bceb0c65ecb556c5c1606624"},{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"8b370f4288a19bedf530ea04f04894c6265e0325","unresolved":false,"context_lines":[{"line_number":221,"context_line":"galera_mariadb_backups_user: galera_mariadb_backup"},{"line_number":222,"context_line":"galera_mariadb_backups_suffix: \"{{ inventory_hostname }}\""},{"line_number":223,"context_line":"galera_mariadb_backups_cnf_file: \"/etc/mysql/mariabackup.cnf\""},{"line_number":224,"context_line":"galera_mariadb_backups_nodes: \"{{ galera_server_bootstrap_node }}\""}],"source_content_type":"text/x-yaml","patch_set":4,"id":"3f65232a_bc608c34","line":224,"range":{"start_line":224,"start_character":0,"end_line":224,"end_character":66},"in_reply_to":"3f65232a_a0d508bc","updated":"2020-10-22 16:16:59.000000000","message":"not sure what you mean. why we need to move that to group_vars to make it run on the first host only? I see pretty close to no scenario when you will need to run backup more then on single container.\n\nand I think we need kind of both - galera_mariadb_backups_enabled to set if backups should be done at all (i think default false is ok?) and galera_mariadb_backups_nodes (which defaults to first host in galera group) on which container backup will run. also we don\u0027t have any override for galera_server_bootstrap_node in group_vars.\n\nWe can move it ofc, just I think I\u0027ve missed smth or not got you straight.","commit_id":"60c050351b10cbb2bceb0c65ecb556c5c1606624"},{"author":{"_account_id":29865,"name":"Georgina Shippey","email":"georgina.shippey@outlook.com","username":"gshippey"},"change_message_id":"2e92ce2c4e865655259f11965ec867ea40a81137","unresolved":false,"context_lines":[{"line_number":221,"context_line":"galera_mariadb_backups_user: galera_mariadb_backup"},{"line_number":222,"context_line":"galera_mariadb_backups_suffix: \"{{ inventory_hostname }}\""},{"line_number":223,"context_line":"galera_mariadb_backups_cnf_file: \"/etc/mysql/mariabackup.cnf\""},{"line_number":224,"context_line":"galera_mariadb_backups_nodes: \"{{ galera_server_bootstrap_node }}\""}],"source_content_type":"text/x-yaml","patch_set":4,"id":"1f621f24_db52393b","line":224,"range":{"start_line":224,"start_character":0,"end_line":224,"end_character":66},"in_reply_to":"3f65232a_bc608c34","updated":"2020-11-09 12:56:25.000000000","message":"Jon and I have discussed and we are happy to have both galera_mariadb_backups_enabled and galera_mariadb_backups_nodes, so all good on this front. Let me know anymore thoughts!","commit_id":"60c050351b10cbb2bceb0c65ecb556c5c1606624"},{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"403a37fe13cdc0a6f951f1e7ae7e66b2f36c191f","unresolved":false,"context_lines":[{"line_number":221,"context_line":"galera_mariadb_backups_user: galera_mariadb_backup"},{"line_number":222,"context_line":"galera_mariadb_backups_suffix: \"{{ inventory_hostname }}\""},{"line_number":223,"context_line":"galera_mariadb_backups_cnf_file: \"/etc/mysql/mariabackup.cnf\""},{"line_number":224,"context_line":"galera_mariadb_backups_nodes: [\"{{ galera_cluster_members[0] }}\"]"}],"source_content_type":"text/x-yaml","patch_set":5,"id":"1f621f24_5e3f37b3","line":224,"range":{"start_line":224,"start_character":35,"end_line":224,"end_character":60},"updated":"2020-11-09 13:10:10.000000000","message":"galera_server_bootstrap_node looked more logic here, but whatever:)","commit_id":"9a8ee0293b2053938365cff6fd8b04e2c66d5aeb"}],"tasks/galera_server_backups.yml":[{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"708e922aa12bdff76956c435d7a39fd04db2a3c9","unresolved":false,"context_lines":[{"line_number":18,"context_line":"  template:"},{"line_number":19,"context_line":"    src: \"mariabackup.cnf.j2\""},{"line_number":20,"context_line":"    dest: \"{{ galera_mariadb_backups_cnf_file }}\""},{"line_number":21,"context_line":"    mode: \"0755\""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"- name: Create service and timer for full backups"},{"line_number":24,"context_line":"  import_role:"}],"source_content_type":"text/x-yaml","patch_set":3,"id":"5f681702_fdf8497d","line":21,"range":{"start_line":21,"start_character":11,"end_line":21,"end_character":15},"updated":"2020-10-19 10:34:00.000000000","message":"why do we need +x for conf file?","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"3e0f76b4e6ec3c13cf373be50604785b398cac6a","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        timer:"},{"line_number":38,"context_line":"          state: \"started\""},{"line_number":39,"context_line":"          options:"},{"line_number":40,"context_line":"            OnCalendar: \"{{ galera_mariadb_backups_full_on_calendar }}\""},{"line_number":41,"context_line":"            Persistent: true"},{"line_number":42,"context_line":"            Unit: \"mariabackup-full.service\""},{"line_number":43,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":3,"id":"9f560f44_240cb637","line":40,"range":{"start_line":40,"start_character":28,"end_line":40,"end_character":67},"updated":"2020-10-12 19:01:30.000000000","message":"can you test using a set here for multiple entries with the same key\n\ngalera_mariadb_backups_full_on_calendar:\n  ? \u003cfirst\u003e \n  ? \u003csecond\u003e\n  ...","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"708e922aa12bdff76956c435d7a39fd04db2a3c9","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    ansible_python_interpreter: \"{{ openstack_db_setup_python_interpreter |"},{"line_number":71,"context_line":"                                 default((galera_db_setup_host \u003d\u003d \u0027localhost\u0027) |"},{"line_number":72,"context_line":"                                 ternary(ansible_playbook_python, ansible_python[\u0027executable\u0027])) }}\""},{"line_number":73,"context_line":"  mysql_user:"},{"line_number":74,"context_line":"    name: \"{{ galera_mariadb_backups_user }}\""},{"line_number":75,"context_line":"    password: \"{{ galera_mariadb_backups_password }}\""},{"line_number":76,"context_line":"    host: \"%\""}],"source_content_type":"text/x-yaml","patch_set":3,"id":"5f681702_3df3e1a0","line":73,"range":{"start_line":73,"start_character":2,"end_line":73,"end_character":12},"updated":"2020-10-19 10:34:00.000000000","message":"let\u0027s explicitly use collection? ie community.mysql.mysql_user","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"708e922aa12bdff76956c435d7a39fd04db2a3c9","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    login_host: \"{{ galera_address }}\""},{"line_number":80,"context_line":"    login_port: 3306"},{"line_number":81,"context_line":"  no_log: true"},{"line_number":82,"context_line":"  run_once: true"}],"source_content_type":"text/x-yaml","patch_set":3,"id":"5f681702_57995e1d","line":82,"range":{"start_line":82,"start_character":2,"end_line":82,"end_character":16},"updated":"2020-10-19 10:34:00.000000000","message":"then we won\u0027t need this as well","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"}],"tasks/galera_server_backups_services.yml":[{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"311926ee2c53abb0bcc10f59211051e4ff6221b9","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"- name: Template out {{ item }} mariadb backup service"},{"line_number":3,"context_line":"  template:"},{"line_number":4,"context_line":"    src: \"mariabackup.service.j2\""},{"line_number":5,"context_line":"    dest: \"/etc/systemd/system/mariabackup_{{ item }}.service\""},{"line_number":6,"context_line":"    mode: \"0755\""},{"line_number":7,"context_line":""},{"line_number":8,"context_line":"- name: Template out {{ item }} mariadb backup timer"},{"line_number":9,"context_line":"  template:"},{"line_number":10,"context_line":"    src: \"mariabackup.timer.j2\""},{"line_number":11,"context_line":"    dest: \"/etc/systemd/system/mariabackup_{{ item }}.timer\""},{"line_number":12,"context_line":"    mode: \"0755\""},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"- name: Enable {{ item }} mariadb backup timer"},{"line_number":15,"context_line":"  systemd:"},{"line_number":16,"context_line":"    name: mariabackup_{{ item }}.timer"},{"line_number":17,"context_line":"    enabled: yes"},{"line_number":18,"context_line":"    state: \"started\""},{"line_number":19,"context_line":"    daemon_reload: yes"}],"source_content_type":"text/x-yaml","patch_set":1,"id":"9f560f44_42dfc837","line":19,"range":{"start_line":1,"start_character":0,"end_line":19,"end_character":22},"updated":"2020-09-30 12:06:30.000000000","message":"can we use systemd role? like we do here [1]\n\n[1] https://opendev.org/openstack/openstack-ansible-os_cinder/src/branch/master/tasks/main.yml#L110-L128","commit_id":"98689362bc83c4782931094825b52e7b925e032b"}],"tasks/galera_server_main.yml":[{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"708e922aa12bdff76956c435d7a39fd04db2a3c9","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    - galera_server-config"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"- include_tasks: galera_server_backups.yml"},{"line_number":96,"context_line":"  when: galera_mariadb_backups_enabled | bool"},{"line_number":97,"context_line":"  tags:"},{"line_number":98,"context_line":"    - galera_server-backups"}],"source_content_type":"text/x-yaml","patch_set":3,"id":"5f681702_f7022a3e","line":96,"updated":"2020-10-19 10:34:00.000000000","message":"I think it\u0027s worth adding one morecondition, like inventory_hostname \u003d\u003d galera_server_backup_node, where galera_server_backup_node set by default to galera_server_bootstrap_node.\nAs we don\u0027t actually need to separatelly backup each galera member- it\u0027s kind of waste of resources.","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":29865,"name":"Georgina Shippey","email":"georgina.shippey@outlook.com","username":"gshippey"},"change_message_id":"1bba041c3bd2f036b01f6be72cb3146070b5c22b","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    - galera_server-config"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"- include_tasks: galera_server_backups.yml"},{"line_number":96,"context_line":"  when: galera_mariadb_backups_enabled | bool"},{"line_number":97,"context_line":"  tags:"},{"line_number":98,"context_line":"    - galera_server-backups"}],"source_content_type":"text/x-yaml","patch_set":3,"id":"3f65232a_e97253e3","line":96,"in_reply_to":"5f681702_f7022a3e","updated":"2020-10-21 21:52:46.000000000","message":"Done - but i\u0027ve allowed it to be a list of nodes just in case. Might be a waste of resources - but if the bootstrap_node fails someone might be in trouble.","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"8b370f4288a19bedf530ea04f04894c6265e0325","unresolved":false,"context_lines":[{"line_number":95,"context_line":"- include_tasks: galera_server_backups.yml"},{"line_number":96,"context_line":"  when:"},{"line_number":97,"context_line":"    - galera_mariadb_backups_enabled | bool"},{"line_number":98,"context_line":"    - inventory_hostname in galera_mariadb_backups_nodes"},{"line_number":99,"context_line":"  tags:"},{"line_number":100,"context_line":"    - galera_server-backups"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"3f65232a_b7d0a552","line":98,"range":{"start_line":98,"start_character":25,"end_line":98,"end_character":27},"updated":"2020-10-22 16:16:59.000000000","message":"btw, I think that galera_mariadb_backups_nodes is currently not a list","commit_id":"60c050351b10cbb2bceb0c65ecb556c5c1606624"},{"author":{"_account_id":29865,"name":"Georgina Shippey","email":"georgina.shippey@outlook.com","username":"gshippey"},"change_message_id":"2e92ce2c4e865655259f11965ec867ea40a81137","unresolved":false,"context_lines":[{"line_number":95,"context_line":"- include_tasks: galera_server_backups.yml"},{"line_number":96,"context_line":"  when:"},{"line_number":97,"context_line":"    - galera_mariadb_backups_enabled | bool"},{"line_number":98,"context_line":"    - inventory_hostname in galera_mariadb_backups_nodes"},{"line_number":99,"context_line":"  tags:"},{"line_number":100,"context_line":"    - galera_server-backups"}],"source_content_type":"text/x-yaml","patch_set":4,"id":"1f621f24_5b7589ca","line":98,"range":{"start_line":98,"start_character":25,"end_line":98,"end_character":27},"in_reply_to":"3f65232a_b7d0a552","updated":"2020-11-09 12:56:25.000000000","message":"I have changed galera_mariadb_backups_nodes to a list explicitly now, though this does seem to evaluate correctly whether it is a list or not.\nI know you say there is little need to be able to provide a list here to take back ups from multiple nodes but I think it would be useful in some cases where we repurpose this role for other things (perhaps this is a bit cheeky).","commit_id":"60c050351b10cbb2bceb0c65ecb556c5c1606624"}],"templates/mariabackup_script.py.j2":[{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"bed392119f27fc573175114a58c7dc08478d24e3","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# {{ ansible_managed }}"},{"line_number":2,"context_line":"#!/usr/bin/python"},{"line_number":3,"context_line":"from subprocess import Popen, PIPE"},{"line_number":4,"context_line":"from optparse import OptionParser"},{"line_number":5,"context_line":"from shutil import rmtree"}],"source_content_type":"text/x-jinja2","patch_set":1,"id":"9f560f44_c8ff77fe","line":2,"range":{"start_line":2,"start_character":0,"end_line":2,"end_character":17},"updated":"2020-09-30 13:06:46.000000000","message":"if we want it to be shebang, it should be the first line? And probably it should be python3 then?","commit_id":"98689362bc83c4782931094825b52e7b925e032b"},{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"bed392119f27fc573175114a58c7dc08478d24e3","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# {{ ansible_managed }}"},{"line_number":2,"context_line":"#!/usr/bin/python"},{"line_number":3,"context_line":"from subprocess import Popen, PIPE"},{"line_number":4,"context_line":"from optparse import OptionParser"},{"line_number":5,"context_line":"from shutil import rmtree"},{"line_number":6,"context_line":"from time import strftime, mktime, sleep"},{"line_number":7,"context_line":"from datetime import datetime, timedelta"}],"source_content_type":"text/x-jinja2","patch_set":1,"id":"9f560f44_281ef35e","line":4,"range":{"start_line":4,"start_character":0,"end_line":4,"end_character":33},"updated":"2020-09-30 13:06:46.000000000","message":"I\u0027m not sure if option parser is valid for py3, I guess it should be replaced with ArgumentParser. I can help out with that.","commit_id":"98689362bc83c4782931094825b52e7b925e032b"},{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"55eb5d148505de2f3e38fe7d9af8600a4d0e6498","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        print(e)"},{"line_number":113,"context_line":"    finally:"},{"line_number":114,"context_line":"        os.unlink(\"/var/run/db_backup.pid\")"},{"line_number":115,"context_line":"    "},{"line_number":116,"context_line":"def create_increment_backup(mariadb, dest, curtime):"},{"line_number":117,"context_line":"    timer \u003d 0"},{"line_number":118,"context_line":"    while os.path.isfile(\"/var/run/db_backup.pid\"):"}],"source_content_type":"text/x-jinja2","patch_set":1,"id":"9f560f44_c2be3863","line":115,"range":{"start_line":115,"start_character":0,"end_line":115,"end_character":4},"updated":"2020-09-30 12:30:14.000000000","message":"whitespace","commit_id":"98689362bc83c4782931094825b52e7b925e032b"},{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"55eb5d148505de2f3e38fe7d9af8600a4d0e6498","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        basedir \u003d max([ os.path.normpath(dest+\u0027/\u0027+f) for f in os.listdir(dest) if f.startswith(\u0027mariabackup-\u0027)], key\u003dos.path.getmtime)"},{"line_number":126,"context_line":"    except(OSError):"},{"line_number":127,"context_line":"        basedir\u003d\"./\""},{"line_number":128,"context_line":"    "},{"line_number":129,"context_line":"    try:"},{"line_number":130,"context_line":"        err \u003d open(os.path.normpath(dest+\"/increment.err\"), \"w\")"},{"line_number":131,"context_line":"        #Creating incremental backup"}],"source_content_type":"text/x-jinja2","patch_set":1,"id":"9f560f44_22b45482","line":128,"range":{"start_line":128,"start_character":0,"end_line":128,"end_character":4},"updated":"2020-09-30 12:30:14.000000000","message":"whitespace","commit_id":"98689362bc83c4782931094825b52e7b925e032b"},{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"b9fd987e858645a9eecb830b5b634504525bb540","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        print(e)"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":"def rotate_backups(dest, copies):"},{"line_number":146,"context_line":"    full_list \u003d [os.path.normpath(dest+\u0027/\u0027+f) for f in os.listdir(dest) if f.startswith(\u0027mariabackup-full-{{ inventory_hostname }}_\u0027)]"},{"line_number":147,"context_line":"    increment_list \u003d [ os.path.normpath(dest+\u0027/\u0027+f) for f in os.listdir(dest) if f.startswith(\u0027mariabackup-increment-{{ inventory_hostname }}_\u0027)]"},{"line_number":148,"context_line":"    if len(full_list) \u003e copies:"},{"line_number":149,"context_line":"        full_list.sort()"}],"source_content_type":"text/x-jinja2","patch_set":1,"id":"9f560f44_e8719bad","line":146,"range":{"start_line":146,"start_character":106,"end_line":146,"end_character":130},"updated":"2020-09-30 13:07:48.000000000","message":"rather than template this script should suffix for the backup name be an extra parameter to the script?","commit_id":"98689362bc83c4782931094825b52e7b925e032b"},{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"619122120d167dc81c06eb989e2cb74f1e29ec43","unresolved":false,"context_lines":[{"line_number":166,"context_line":"curtime \u003d strftime(\"%Y%m%d-%H%M%S\")"},{"line_number":167,"context_line":"if opts.fullbackup_flag or opts.increment_flag:"},{"line_number":168,"context_line":"    #mariadb_config \u003d open(\u0027/etc/mysql/debian.cnf\u0027, \u0027r\u0027)"},{"line_number":169,"context_line":"    #mariadb_credentials \u003d [line.strip() for line in mariadb_config.read().split(\u0027\\n\u0027) if \u0027user\u0027 in line or \u0027password\u0027 in line]"},{"line_number":170,"context_line":"    #mariadb_config.close()"},{"line_number":171,"context_line":"    #mariadb_cred \u003d []"},{"line_number":172,"context_line":"    #Template out these?"},{"line_number":173,"context_line":"    #for cred in mariadb_credentials:"},{"line_number":174,"context_line":"    #    if \"password\" in cred:"},{"line_number":175,"context_line":"    #        mariadb_cred.insert(1, cred.split(\u0027\u003d\u0027)[1])"},{"line_number":176,"context_line":"    #    elif \"user\" in cred:"},{"line_number":177,"context_line":"    #        mariadb_cred.insert(0, cred.split(\u0027\u003d\u0027)[1].lstrip(\u0027 \u0027))"},{"line_number":178,"context_line":"    mariadb_cred \u003d [\"{{ galera_root_user }}\", \"{{ galera_root_password }}\"]"},{"line_number":179,"context_line":"if opts.destdir_flag:"},{"line_number":180,"context_line":"    dest_dir\u003dopts.destdir_flag"}],"source_content_type":"text/x-jinja2","patch_set":1,"id":"9f560f44_28b27307","line":177,"range":{"start_line":169,"start_character":0,"end_line":177,"end_character":67},"updated":"2020-09-30 13:26:07.000000000","message":"We can use ConfigParser for that, and I suppose we should have /root/.my.cnf created with client part, just not to pass with argument (but template is also an option probably)","commit_id":"98689362bc83c4782931094825b52e7b925e032b"},{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"55eb5d148505de2f3e38fe7d9af8600a4d0e6498","unresolved":false,"context_lines":[{"line_number":165,"context_line":"opts, args \u003d get_opts()"},{"line_number":166,"context_line":"curtime \u003d strftime(\"%Y%m%d-%H%M%S\")"},{"line_number":167,"context_line":"if opts.fullbackup_flag or opts.increment_flag:"},{"line_number":168,"context_line":"    #mariadb_config \u003d open(\u0027/etc/mysql/debian.cnf\u0027, \u0027r\u0027)"},{"line_number":169,"context_line":"    #mariadb_credentials \u003d [line.strip() for line in mariadb_config.read().split(\u0027\\n\u0027) if \u0027user\u0027 in line or \u0027password\u0027 in line]"},{"line_number":170,"context_line":"    #mariadb_config.close()"},{"line_number":171,"context_line":"    #mariadb_cred \u003d []"},{"line_number":172,"context_line":"    #Template out these?"},{"line_number":173,"context_line":"    #for cred in mariadb_credentials:"},{"line_number":174,"context_line":"    #    if \"password\" in cred:"},{"line_number":175,"context_line":"    #        mariadb_cred.insert(1, cred.split(\u0027\u003d\u0027)[1])"},{"line_number":176,"context_line":"    #    elif \"user\" in cred:"},{"line_number":177,"context_line":"    #        mariadb_cred.insert(0, cred.split(\u0027\u003d\u0027)[1].lstrip(\u0027 \u0027))"},{"line_number":178,"context_line":"    mariadb_cred \u003d [\"{{ galera_root_user }}\", \"{{ galera_root_password }}\"]"},{"line_number":179,"context_line":"if opts.destdir_flag:"},{"line_number":180,"context_line":"    dest_dir\u003dopts.destdir_flag"}],"source_content_type":"text/x-jinja2","patch_set":1,"id":"9f560f44_02b95078","line":177,"range":{"start_line":168,"start_character":0,"end_line":177,"end_character":67},"updated":"2020-09-30 12:30:14.000000000","message":"is this intentional?","commit_id":"98689362bc83c4782931094825b52e7b925e032b"},{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"55eb5d148505de2f3e38fe7d9af8600a4d0e6498","unresolved":false,"context_lines":[{"line_number":190,"context_line":"    except ValueError:"},{"line_number":191,"context_line":"        raise ValueError(\"--copies MUST be integer\")"},{"line_number":192,"context_line":"if opts.fullbackup_flag and opts.increment_flag:"},{"line_number":193,"context_line":"    raise NameError(\"Only one flag can be specified per operation\") "},{"line_number":194,"context_line":"elif opts.fullbackup_flag:"},{"line_number":195,"context_line":"    create_full_backup(mariadb_cred, dest_dir, curtime)"},{"line_number":196,"context_line":"    rotate_backups(dest_dir, copies)"}],"source_content_type":"text/x-jinja2","patch_set":1,"id":"9f560f44_62adac31","line":193,"range":{"start_line":193,"start_character":67,"end_line":193,"end_character":68},"updated":"2020-09-30 12:30:14.000000000","message":"whitespace","commit_id":"98689362bc83c4782931094825b52e7b925e032b"},{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"3be37c5baa2a54ffe7a5d0fd71f15a2373ae73d3","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    try:"},{"line_number":79,"context_line":"        last_mariabackup_full \u003d datetime.strptime(max([os.path.normpath(dest+\u0027/\u0027+f) for f in os.listdir(dest) if f.startswith(full_backup_filename)], key\u003dos.path.getmtime).split(full_backup_filename)[1], \u0027%Y%m%d-%H%M%S\u0027)"},{"line_number":80,"context_line":"    except ValueError:"},{"line_number":81,"context_line":"        print(\"No files found, you may need to check your destination directory or add a suffix.\") "},{"line_number":82,"context_line":"        raise SystemExit()"},{"line_number":83,"context_line":"    warning_time \u003d datetime.today() - timedelta(days\u003dwarning)"},{"line_number":84,"context_line":"    critical_time \u003d datetime.today() - timedelta(days\u003dcritical)"}],"source_content_type":"text/x-jinja2","patch_set":2,"id":"9f560f44_eaec9729","line":81,"range":{"start_line":81,"start_character":98,"end_line":81,"end_character":99},"updated":"2020-10-07 07:44:46.000000000","message":"whitespace error","commit_id":"cbe5159bcebb9c8db3d82868690f76d797744de7"},{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"3be37c5baa2a54ffe7a5d0fd71f15a2373ae73d3","unresolved":false,"context_lines":[{"line_number":95,"context_line":""},{"line_number":96,"context_line":"def create_full_backup(mariadb, dest, curtime, full_backup_filename):"},{"line_number":97,"context_line":"    try:"},{"line_number":98,"context_line":"        pid \u003d open(\u0027/var/run/db_backup.pid\u0027, \u0027w\u0027)"},{"line_number":99,"context_line":"        pid.write(str(os.getpid()))"},{"line_number":100,"context_line":"        pid.close()"},{"line_number":101,"context_line":"        #Creating full backup"}],"source_content_type":"text/x-jinja2","patch_set":2,"id":"9f560f44_ea3ad794","line":98,"range":{"start_line":98,"start_character":8,"end_line":98,"end_character":49},"updated":"2020-10-07 07:44:46.000000000","message":"what if this already exists? like bad configuration of the systemd timer that makes the backup processes run too frequently and overlap?","commit_id":"cbe5159bcebb9c8db3d82868690f76d797744de7"},{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"3be37c5baa2a54ffe7a5d0fd71f15a2373ae73d3","unresolved":false,"context_lines":[{"line_number":127,"context_line":""},{"line_number":128,"context_line":"def create_increment_backup(mariadb, dest, curtime, increment_backup_filename):"},{"line_number":129,"context_line":"    timer \u003d 0"},{"line_number":130,"context_line":"    while os.path.isfile(\"/var/run/db_backup.pid\"):"},{"line_number":131,"context_line":"        sleep(60)"},{"line_number":132,"context_line":"        timer +\u003d 1"},{"line_number":133,"context_line":"        if timer \u003d\u003d 120:"},{"line_number":134,"context_line":"            print(\"timeout of waiting another process is reached\")"},{"line_number":135,"context_line":"            raise SystemExit(1)"},{"line_number":136,"context_line":"    try:"},{"line_number":137,"context_line":"        basedir \u003d max([ os.path.normpath(dest+\u0027/\u0027+f) for f in os.listdir(dest) if f.startswith(\u0027mariabackup-\u0027)], key\u003dos.path.getmtime)"},{"line_number":138,"context_line":"    except(OSError):"}],"source_content_type":"text/x-jinja2","patch_set":2,"id":"9f560f44_8a623bac","line":135,"range":{"start_line":130,"start_character":1,"end_line":135,"end_character":31},"updated":"2020-10-07 07:44:46.000000000","message":"the incremental backup function will wait for some time until this lock file is not present, does the full backup function need to do the same?","commit_id":"cbe5159bcebb9c8db3d82868690f76d797744de7"},{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"3be37c5baa2a54ffe7a5d0fd71f15a2373ae73d3","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        err \u003d open(os.path.normpath(dest+\"/increment.err\"), \"w\")"},{"line_number":142,"context_line":"        #Creating incremental backup"},{"line_number":143,"context_line":"        mariabackup_run \u003d Popen("},{"line_number":144,"context_line":"        [\"/usr/bin/mariabackup\", \"--user\u003d\"+ mariadb[0], \"--password\u003d\"+ mariadb[1], \"--backup\", \"--target-dir\u003d\"+os.path.normpath(dest+\"/\"+increment_backup_filename+curtime), \"--incremental-basedir\u003d\"+basedir], stdout\u003dNone, stderr\u003derr"},{"line_number":145,"context_line":"        )"},{"line_number":146,"context_line":"        mariabackup_run.wait()"},{"line_number":147,"context_line":"        mariabackup_res \u003d mariabackup_run.communicate()"}],"source_content_type":"text/x-jinja2","patch_set":2,"id":"9f560f44_4a88236a","line":144,"range":{"start_line":144,"start_character":34,"end_line":144,"end_character":92},"updated":"2020-10-07 07:44:46.000000000","message":"this means that the username/password will be visible with ps which is not great, is it possible to instead make reference to a my.cnf file with credentials in it?","commit_id":"cbe5159bcebb9c8db3d82868690f76d797744de7"},{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"3be37c5baa2a54ffe7a5d0fd71f15a2373ae73d3","unresolved":false,"context_lines":[{"line_number":153,"context_line":"    except Exception as e:"},{"line_number":154,"context_line":"        print(e)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"def rotate_backups(dest, copies, full_backup_filename, increment_backup_filename):"},{"line_number":157,"context_line":"    full_list \u003d [os.path.normpath(dest+\u0027/\u0027+f) for f in os.listdir(dest) if f.startswith(full_backup_filename)]"},{"line_number":158,"context_line":"    increment_list \u003d [ os.path.normpath(dest+\u0027/\u0027+f) for f in os.listdir(dest) if f.startswith(increment_backup_filename)]"},{"line_number":159,"context_line":"    if len(full_list) \u003e copies:"},{"line_number":160,"context_line":"        full_list.sort()"},{"line_number":161,"context_line":"        left \u003d parsedate(full_list[0].split(full_backup_filename)[1])"},{"line_number":162,"context_line":"        right \u003d parsedate(full_list[1].split(full_backup_filename)[1])"},{"line_number":163,"context_line":"        for files in increment_list:"},{"line_number":164,"context_line":"            stamp \u003d parsedate(files.split(increment_backup_filename)[1])"},{"line_number":165,"context_line":"            if stamp \u003e left and stamp \u003c right:"},{"line_number":166,"context_line":"                rmtree(files)"},{"line_number":167,"context_line":"        while len(full_list) \u003e copies:"},{"line_number":168,"context_line":"            folder \u003d min(full_list, key\u003dos.path.getmtime)"},{"line_number":169,"context_line":"            full_list.remove(folder)"},{"line_number":170,"context_line":"            rmtree(folder)"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"def parsedate(s):"},{"line_number":173,"context_line":"    return mktime(datetime.strptime(s, \u0027%Y%m%d-%H%M%S\u0027).timetuple())"}],"source_content_type":"text/x-jinja2","patch_set":2,"id":"9f560f44_aa029fb8","line":170,"range":{"start_line":156,"start_character":0,"end_line":170,"end_character":26},"updated":"2020-10-07 07:44:46.000000000","message":"the lock file is deleted while the backup rotation is happening, is this correct?","commit_id":"cbe5159bcebb9c8db3d82868690f76d797744de7"},{"author":{"_account_id":25023,"name":"Jonathan Rosser","email":"jonathan.rosser@rd.bbc.co.uk","username":"jrosser"},"change_message_id":"3be37c5baa2a54ffe7a5d0fd71f15a2373ae73d3","unresolved":false,"context_lines":[{"line_number":176,"context_line":"opts \u003d get_opts()"},{"line_number":177,"context_line":"curtime \u003d strftime(\"%Y%m%d-%H%M%S\")"},{"line_number":178,"context_line":"if opts.fullbackup_flag or opts.increment_flag:"},{"line_number":179,"context_line":"    mariadb_cred \u003d [\"{{ galera_mariadb_backups_user }}\", \"{{ galera_mariadb_backups_password }}\"]"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"if not opts.copies_flag and opts.fullbackup_flag:"},{"line_number":182,"context_line":"    raise NameError(\"--copies flag is required for running full backup.\")"}],"source_content_type":"text/x-jinja2","patch_set":2,"id":"9f560f44_8aeb5b10","line":179,"range":{"start_line":179,"start_character":4,"end_line":179,"end_character":97},"updated":"2020-10-07 07:44:46.000000000","message":"similar to above can yo look if it is possible to use a my.cnf?","commit_id":"cbe5159bcebb9c8db3d82868690f76d797744de7"},{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"708e922aa12bdff76956c435d7a39fd04db2a3c9","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        )"},{"line_number":80,"context_line":"    opts \u003d parser.parse_args()"},{"line_number":81,"context_line":"    return opts"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"def check_backups(dest, warning, critical, full_backup_filename):"},{"line_number":84,"context_line":"    try:"},{"line_number":85,"context_line":"        last_mariabackup_full \u003d datetime.strptime(max([os.path.normpath(dest+\u0027/\u0027+f) for f in os.listdir(dest) if f.startswith(full_backup_filename)], key\u003dos.path.getmtime).split(full_backup_filename)[1], \u0027%Y%m%d-%H%M%S\u0027)"}],"source_content_type":"text/x-jinja2","patch_set":3,"id":"5f681702_3d4801cb","line":82,"updated":"2020-10-19 10:34:00.000000000","message":"I believe pep8 says we should have 2 new lines between functions (and 1 new line between method classes which is not the case here)\n\n[1] https://www.python.org/dev/peps/pep-0008/#blank-lines","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":29865,"name":"Georgina Shippey","email":"georgina.shippey@outlook.com","username":"gshippey"},"change_message_id":"1bba041c3bd2f036b01f6be72cb3146070b5c22b","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        )"},{"line_number":80,"context_line":"    opts \u003d parser.parse_args()"},{"line_number":81,"context_line":"    return opts"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"def check_backups(dest, warning, critical, full_backup_filename):"},{"line_number":84,"context_line":"    try:"},{"line_number":85,"context_line":"        last_mariabackup_full \u003d datetime.strptime(max([os.path.normpath(dest+\u0027/\u0027+f) for f in os.listdir(dest) if f.startswith(full_backup_filename)], key\u003dos.path.getmtime).split(full_backup_filename)[1], \u0027%Y%m%d-%H%M%S\u0027)"}],"source_content_type":"text/x-jinja2","patch_set":3,"id":"3f65232a_cac78c45","line":82,"in_reply_to":"5f681702_3d4801cb","updated":"2020-10-21 21:52:46.000000000","message":"Done","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":28619,"name":"Dmitriy Rabotyagov","email":"noonedeadpunk@gmail.com","username":"noonedeadpunk"},"change_message_id":"708e922aa12bdff76956c435d7a39fd04db2a3c9","unresolved":false,"context_lines":[{"line_number":194,"context_line":"    except Exception as e:"},{"line_number":195,"context_line":"        print(e)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"##Program starts"},{"line_number":198,"context_line":"opts \u003d get_opts()"},{"line_number":199,"context_line":"curtime \u003d strftime(\"%Y%m%d-%H%M%S\")"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"if not opts.copies_flag and opts.fullbackup_flag:"},{"line_number":202,"context_line":"    raise NameError(\"--copies flag is required for running full backup.\")"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"full_backup_filename \u003d \"mariabackup-full_\""},{"line_number":205,"context_line":"increment_backup_filename \u003d \"mariabackup-increment_\""},{"line_number":206,"context_line":"if opts.suffix:"},{"line_number":207,"context_line":"    full_backup_filename \u003d (\"mariabackup-full-\" + opts.suffix + \"_\")"},{"line_number":208,"context_line":"    increment_backup_filename \u003d (\"mariabackup-increment-\" + opts.suffix + \"_\")"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"extra_mariabackup_args \u003d []"},{"line_number":211,"context_line":"# --defaults-file must be specified straight after the process"},{"line_number":212,"context_line":"if opts.defaults_file:"},{"line_number":213,"context_line":"    extra_mariabackup_args \u003d [\"--defaults-file\u003d\" + opts.defaults_file] + extra_mariabackup_args"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"if opts.fullbackup_flag and opts.increment_flag:"},{"line_number":216,"context_line":"    raise NameError(\"Only one flag can be specified per operation\")"},{"line_number":217,"context_line":"elif opts.fullbackup_flag:"},{"line_number":218,"context_line":"    create_full_backup(opts.destdir, curtime, full_backup_filename, extra_mariabackup_args)"},{"line_number":219,"context_line":"    rotate_backups(opts.destdir, opts.copies_flag, full_backup_filename, increment_backup_filename)"},{"line_number":220,"context_line":"    raise SystemExit()"},{"line_number":221,"context_line":"elif opts.increment_flag:"},{"line_number":222,"context_line":"    create_increment_backup(opts.destdir, curtime, increment_backup_filename, extra_mariabackup_args)"},{"line_number":223,"context_line":"    raise SystemExit()"},{"line_number":224,"context_line":"elif opts.check_flag:"},{"line_number":225,"context_line":"    pass"},{"line_number":226,"context_line":"else:"},{"line_number":227,"context_line":"    raise NameError(\"either --increment or --full-backup flag is required\")"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"if opts.check_flag and (opts.warning_value and opts.critical_value):"},{"line_number":230,"context_line":"    check_backups(warning \u003d opts.warning_value, critical \u003d opts.critical_value, dest \u003d opts.destdir, full_backup_filename \u003d full_backup_filename)"},{"line_number":231,"context_line":"else:"},{"line_number":232,"context_line":"    raise NameError(\"--warning and --critical thresholds should be specified for check\")"}],"source_content_type":"text/x-jinja2","patch_set":3,"id":"5f681702_dd3aad32","line":232,"range":{"start_line":197,"start_character":0,"end_line":232,"end_character":88},"updated":"2020-10-19 10:34:00.000000000","message":"placing that inside\ndef main():\nwould make me super happy, as well as adding\nif __name__ \u003d\u003d \"__main__\":\n    main()","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"},{"author":{"_account_id":29865,"name":"Georgina Shippey","email":"georgina.shippey@outlook.com","username":"gshippey"},"change_message_id":"1bba041c3bd2f036b01f6be72cb3146070b5c22b","unresolved":false,"context_lines":[{"line_number":194,"context_line":"    except Exception as e:"},{"line_number":195,"context_line":"        print(e)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"##Program starts"},{"line_number":198,"context_line":"opts \u003d get_opts()"},{"line_number":199,"context_line":"curtime \u003d strftime(\"%Y%m%d-%H%M%S\")"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"if not opts.copies_flag and opts.fullbackup_flag:"},{"line_number":202,"context_line":"    raise NameError(\"--copies flag is required for running full backup.\")"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"full_backup_filename \u003d \"mariabackup-full_\""},{"line_number":205,"context_line":"increment_backup_filename \u003d \"mariabackup-increment_\""},{"line_number":206,"context_line":"if opts.suffix:"},{"line_number":207,"context_line":"    full_backup_filename \u003d (\"mariabackup-full-\" + opts.suffix + \"_\")"},{"line_number":208,"context_line":"    increment_backup_filename \u003d (\"mariabackup-increment-\" + opts.suffix + \"_\")"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"extra_mariabackup_args \u003d []"},{"line_number":211,"context_line":"# --defaults-file must be specified straight after the process"},{"line_number":212,"context_line":"if opts.defaults_file:"},{"line_number":213,"context_line":"    extra_mariabackup_args \u003d [\"--defaults-file\u003d\" + opts.defaults_file] + extra_mariabackup_args"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"if opts.fullbackup_flag and opts.increment_flag:"},{"line_number":216,"context_line":"    raise NameError(\"Only one flag can be specified per operation\")"},{"line_number":217,"context_line":"elif opts.fullbackup_flag:"},{"line_number":218,"context_line":"    create_full_backup(opts.destdir, curtime, full_backup_filename, extra_mariabackup_args)"},{"line_number":219,"context_line":"    rotate_backups(opts.destdir, opts.copies_flag, full_backup_filename, increment_backup_filename)"},{"line_number":220,"context_line":"    raise SystemExit()"},{"line_number":221,"context_line":"elif opts.increment_flag:"},{"line_number":222,"context_line":"    create_increment_backup(opts.destdir, curtime, increment_backup_filename, extra_mariabackup_args)"},{"line_number":223,"context_line":"    raise SystemExit()"},{"line_number":224,"context_line":"elif opts.check_flag:"},{"line_number":225,"context_line":"    pass"},{"line_number":226,"context_line":"else:"},{"line_number":227,"context_line":"    raise NameError(\"either --increment or --full-backup flag is required\")"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"if opts.check_flag and (opts.warning_value and opts.critical_value):"},{"line_number":230,"context_line":"    check_backups(warning \u003d opts.warning_value, critical \u003d opts.critical_value, dest \u003d opts.destdir, full_backup_filename \u003d full_backup_filename)"},{"line_number":231,"context_line":"else:"},{"line_number":232,"context_line":"    raise NameError(\"--warning and --critical thresholds should be specified for check\")"}],"source_content_type":"text/x-jinja2","patch_set":3,"id":"3f65232a_a9bcdb69","line":232,"range":{"start_line":197,"start_character":0,"end_line":232,"end_character":88},"in_reply_to":"5f681702_dd3aad32","updated":"2020-10-21 21:52:46.000000000","message":"Done","commit_id":"e906fc88a183721b579a5c242fee930a17284f4b"}]}
