diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..5dc78e7 Binary files /dev/null and b/.DS_Store differ diff --git a/playbooks/.DS_Store b/playbooks/.DS_Store new file mode 100644 index 0000000..a14ba6d Binary files /dev/null and b/playbooks/.DS_Store differ diff --git a/playbooks/dbaas-ansible-collection/.DS_Store b/playbooks/dbaas-ansible-collection/.DS_Store new file mode 100644 index 0000000..ec8b15b Binary files /dev/null and b/playbooks/dbaas-ansible-collection/.DS_Store differ diff --git a/playbooks/dbaas-ansible-collection/.vscode/settings.json b/playbooks/dbaas-ansible-collection/.vscode/settings.json new file mode 100644 index 0000000..3a9326b --- /dev/null +++ b/playbooks/dbaas-ansible-collection/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "ansible.python.interpreterPath": "/usr/bin/python3" +} \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/CHANGELOG.rst b/playbooks/dbaas-ansible-collection/CHANGELOG.rst new file mode 100644 index 0000000..be890f2 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/CHANGELOG.rst @@ -0,0 +1,6 @@ +This should be updated by antsibull-changelog. Do not edit this manually! + +See https://github.com/ansible-community/antsibull-changelog/blob/main/docs/changelogs.rst for +information on how to use antsibull-changelog. + +Check out ``changelogs/config.yaml`` for its configuration. You need to change at least the ``title`` field in there. diff --git a/playbooks/dbaas-ansible-collection/CODE_OF_CONDUCT.md b/playbooks/dbaas-ansible-collection/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..0164155 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/CODE_OF_CONDUCT.md @@ -0,0 +1,3 @@ +# Community Code of Conduct + +Please see the official [Ansible Community Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html). diff --git a/playbooks/dbaas-ansible-collection/CONTRIBUTING b/playbooks/dbaas-ansible-collection/CONTRIBUTING new file mode 100644 index 0000000..7612a85 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/CONTRIBUTING @@ -0,0 +1,3 @@ +# Contributing + +Refer to the [Ansible community guide](https://docs.ansible.com/ansible/devel/community/index.html). diff --git a/playbooks/dbaas-ansible-collection/FILES.json b/playbooks/dbaas-ansible-collection/FILES.json new file mode 100644 index 0000000..0dadb1a --- /dev/null +++ b/playbooks/dbaas-ansible-collection/FILES.json @@ -0,0 +1,4471 @@ +{ + "files": [ + { + "name": ".", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "CODE_OF_CONDUCT.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "14ec928234a7ed52bf8b458d31e4862335111e477e4dbe7fb543686c24115140", + "format": 1 + }, + { + "name": "tools", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tools/ansible", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tools/ansible/install_ansible.sh", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d6e269a074897fd17a7637804056c97a654ca507ffca9ff4f98a61efd7d2194d", + "format": 1 + }, + { + "name": "tools/dev", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tools/dev/requirements_doctor.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0452fbd612398e915ec2f258841596c1c80ec319cca31598ec7c187ca7a1d0ee", + "format": 1 + }, + { + "name": "tools/dev/install_dev.sh", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "aa53ad11bbbaf8acba36dc8a1067a743a08181b007119b850684c19b38b3c547", + "format": 1 + }, + { + "name": "tools/dev/install_collection.sh", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e490df45dbf5f56dd3f999ba721870b628a2a2c9a98487846cafab89a45e30bb", + "format": 1 + }, + { + "name": "tools/dev/requirements_antsibull.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b264e2624741f64d93e421ee33c8db7835189c041563d60ee1f795747b0c05f9", + "format": 1 + }, + { + "name": "tools/dev/requirements_dev.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d95490dd1c3ebda329268455a3c5ea03b11fb4d4d930420dc14311dbf93dd892", + "format": 1 + }, + { + "name": ".DS_Store", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5560bcf6b2ca9a148dbb873e7700f825326eb957cd61ae438fb7446bb1343245", + "format": 1 + }, + { + "name": "LICENSE", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986", + "format": 1 + }, + { + "name": "requirements.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2c2928a0524ecd3db232827903dc750f6037265fdf3b5f2c85f1eacf0c184d1e", + "format": 1 + }, + { + "name": "plugins", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "plugins/.DS_Store", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a8b64b3ee7c39a4a86d80b2619e40284071e657c92d7bd241917e3c50bcbe4bb", + "format": 1 + }, + { + "name": "plugins/cache", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "plugins/cache/__init__.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "plugins/sub_plugins", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "plugins/sub_plugins/__init__.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "plugins/test", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "plugins/test/__init__.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "plugins/action", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "plugins/action/__init__.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "plugins/plugin_utils", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "plugins/plugin_utils/__init__.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "plugins/inventory", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "plugins/inventory/__init__.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "plugins/module_utils", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "plugins/module_utils/__init__.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "plugins/filter", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "plugins/filter/hello_world.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8fabdc80a9df6070c4cd73376a1b8056725659577c5a5104c33b97048b8e5d82", + "format": 1 + }, + { + "name": "plugins/filter/__init__.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "plugins/modules", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "plugins/modules/__init__.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "plugins/modules/oracle_sqlplus_module.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ad740ae97d928706803b2fe66381f1778058f2b3347adb79e42c47f9709dddb1", + "format": 1 + }, + { + "name": "test-requirements.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "41aa2b70cd0888dc99ec975ee5fa0c2f92a5dd7440952808d049ec1d5abdc641", + "format": 1 + }, + { + "name": "CONTRIBUTING", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5cd1484b61e0b841de061b6a4a3f50ccef73bd9e9cc160a55c428b070f7dcb16", + "format": 1 + }, + { + "name": "pyproject.toml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "992bdb3a39552acbd2a66181676c7f8c6fd53189b19b275300a789254d515ad3", + "format": 1 + }, + { + "name": "tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/unit", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/unit/test_basic.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "85c5e935131222ea8f6dfe6adc6d3522c339b24d2ca330b21d7bf23f7534163f", + "format": 1 + }, + { + "name": "tests/unit/__init__.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "tests/unit/.keep", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "tests/integration", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/hello_world", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/hello_world/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "tests/integration/targets/hello_world/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "99dc9479bfdcb8dec0012e3b7841efcbbf22019866dc32b0a1880e9e82704fe8", + "format": 1 + }, + { + "name": "tests/integration/__init__.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "tests/integration/test_integration.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "89a7a740283ede6bc92661fdd4c7a11f0713f61abc3dc62f6715abd20c615e9b", + "format": 1 + }, + { + "name": "tests/.gitignore", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b5726d3ec9335a09c124469eca039523847a6b0f08a083efaefd002b83326600", + "format": 1 + }, + { + "name": "devfile.yaml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ba291c92f3e8535ae21a1924cebbdba872fe7d5e34b5115a146c59041528b3e8", + "format": 1 + }, + { + "name": "meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "meta/runtime.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cec2a5e51d50837a928483bad0c0c5491f5210d331a0f097a42ac1807aabe724", + "format": 1 + }, + { + "name": "roles", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fb512337088e6efc0153969ee5ac38d2f32589be2ceaab3711512738e851669a", + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/tasks/deployment_directories_create.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "dd2a77d589828795a729294073707027a90bac7c4054d31b5e3e9e0c4d7f2576", + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/tasks/acfs_repl_init.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e8803647c48b07ee1dd97f0dacbd291ef72f51d2a1fd77659d35ba4687d64646", + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/tasks/acfs_config_action_scripts.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2c0e8c2de034f9495550875149bb060f9973eb47adfa3ffe3899266bd04d3519", + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "dd09be790589a007ca2d16269fd649d6bc09d5cdfb087fedf71daca3a658b395", + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8b73e12f597fac0a9a49235e0ba444b863e2b8e8c5c54998b77738f7429ddd61", + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e02233819b1a09844410549191813f7cc7ba360f21298578f4ba1727a27d87fc", + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "be89ea925e9a0e9734350c8b9302dc2f3b258971daacc2dfae1c2e8b129ee9da", + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cc751d75266f757a38189f15d54e548dc87706f14a39756995c27b49eaca8a07", + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bb4886293ef4349cfb716fe3fad8221eca8cfe93c771184b674a985130e371b8", + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/files", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/files/acfs_primary.scr", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a3dd8359763fda78adec63eb3659601667cbfb1cccb05e96520d8878ed769aba", + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/files/acfs_standby.scr", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "048986b61c92906b63d5aafd4f3c2327aed45cd5ac03a10cf0930ab2125486b7", + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_acfs_config_repl/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "157be2840d3ebbe0cd8e3a3c7b7b977194200f163198355192a73bfb6c8bc639", + "format": 1 + }, + { + "name": "roles/gghub_maa_ha", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "66f29332180aa15f472c90acf0b08d35d259b3bd93d14c4f527658e32b276b62", + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/tasks/resync_acfs.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d4a550bf9c5e22c0f7f43326bead788ed17b09979a39ecb886ad0aba65149328", + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/tasks/post_actions.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2c1cc943ffe77a797fdf440ee6c74979c884d2277b240c7b5d81992f06663830", + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/tasks/check_status.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f87017a13beab2a44cfe69bc49ee2efc5987814969b966cb598aadb12b1555d3", + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/tasks/actions.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2d84a86571f8b121dd4b67410e0c9648c8e71c718f26a765d96b243a2986d7b9", + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bb1d2178aaab81eef689b78b75f5fef277c47fade83675bbb122a4097aad206b", + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fa47d35bee10b2e03153fe6fef22cb4cf4c849979d6e1c9fcddcc3ac4ab9a8a0", + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e02233819b1a09844410549191813f7cc7ba360f21298578f4ba1727a27d87fc", + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9d56a5593dda8a7ca29398ba25c8ebca162c1227f56ad5120f3656f5a58fa6aa", + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cc751d75266f757a38189f15d54e548dc87706f14a39756995c27b49eaca8a07", + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1e9f16f735d2dc55c5c1e6d56a9049044fc272c225636528c54a83d52ecde36f", + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_maa_ha/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6a500665992eefaab0bc6568a374d764966e88e34b7ad032ea19f9f29c519748", + "format": 1 + }, + { + "name": "roles/framework_post_tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_post_tasks/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_post_tasks/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7145df0f361fb2c5eff4c10391dfd42ab6fb3ff730981472ac11752a159a4406", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_post_tasks/tasks/update_report.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fb11910554e0139d5e23ba878642f48741a2e05589053ab6fb137f33eb79e830", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/tasks/clean_up.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cf46b09ad0ab37a31bc71249491684ad6983e45aa61f4f2abbb2394e9c55727a", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/tasks/get_gg_lag.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a2048bc4a1e53d29b4aa18fdd64366d2d46bdfa2830cca7495c2d44bda1bfa9f", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/tasks/job_report.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "319dd4c1f891dc29efb44a4408a509eb4538bdaed59954a74e18967f6a2f5ca1", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/tasks/update_db_info.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a70c0898d56eb71393891d6a622527950b87bf5447e2073532cb74941832777e", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/tasks/run_plotly.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "595e461fc9cefc12f4ab8a0d38cb03e93b9fb1d0909f1b7046ba5b96ffad2413", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/tasks/publish_report.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "14b053efd380283f2d562905d4f49d589eae440b85897358f18b27d578042c28", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/tasks/delete_parse_results.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7d781399fe12a596f9e5b1423a6cf361794b3dacf287fc02adb5561267545959", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/tasks/delete_get_dbserver_facts.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "42c916268243c52ea4095c3d292b34d62133ce060ed571ef9795c08ced313cf4", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e70c7cf316a541ba0b452083262e7de6df0da82ecf29f15eba9de610fd0caa87", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_post_tasks/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0aaefe716443e0fc043b0cd267fd5e82b87f34acd21d45fc0b772b1917ff774e", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e02233819b1a09844410549191813f7cc7ba360f21298578f4ba1727a27d87fc", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_post_tasks/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4a4e5dee93518028a73456681899af5240cbb424a6082574e0361f9d644e8a36", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cc751d75266f757a38189f15d54e548dc87706f14a39756995c27b49eaca8a07", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_post_tasks/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c1982eb121f5b034d4934e8111feb58f4cbed3107f826fab2bd55c282c44e6df", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/files", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_post_tasks/files/plotly.result_histogram.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ad75f21c0bdb7182483cd92a932bbd19056e29f48499654abb0ef74ecafabbed", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/files/plotly.sla_aggregate.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fdecb984c13e007644846224e18fd960790b55f02a6f1ea575320656b686869c", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/files/plotly.timeline.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e50e26ab446e5fb7c00d69415c7b93d9a59b4b3bcc8996f36b956b4e45dc7d6e", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/files/plotly.ucpsess.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e9e5353e2dcf5ddced31384305330ad5341c1c069b59ef7848e98fa08758b75b", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/files/plotly.sla_tracking.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0e8dab89d78752f687d1ffced5fea8f09811a6b77a6cc28d74907d5029d1c094", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/files/plotly.sla_agg.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b43f51138cd5566daff2eaf6a2a43148e9c76693842dc29846e598babb0544be", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/files/main.html", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "04847797004e270fc095f93febb5d86153e12b5a65fc15056be240add1ba1f68", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/files/oswbba9013.jar", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ae39dba57aafc6f81c87aac86e32cc9fad8a203847ac965ec961ab002850a50f", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/files/plotly.gg_heartbeat.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bcb91289e5a9a254e5109554da8a90ce1047c57e60f1884acb9886c2120ac8e3", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/files/plotly.dg_lag.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0bd22c252eeb470ed4746e761588a1788ee3130fdde9d2e72b14578030fb7070", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram8.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "be0eeee2728a658e3380009c20068b5c8b0bfdc62c516eab769de94f95ac11c6", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram4.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6ed90ab9574727897c0edd81e044c3973e97ad420f4bac69606d3035f63ef1ed", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_17.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bae6eb07ffc25920bd68da27a2963a1d62b75b2b2fe789d998021dbd18ad1bd3", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram10.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "27b749863078098b35bf38df2c7926c14de301618d0dd91d34cbe260566d7630", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/ahf_events2.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a525b549a67f93187e7cc929b2eac7ffea8ee94eccbfd49aa4d5692845264708", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_2.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "04c211d6f4bd212fcb54428eeda5457170bc9e94405fad6c707edbaee0fa7b78", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "681d012fa8b9da8a4b312630bdbc45d9b2156e8a024361fd3bd5019c2c48e2b7", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_15.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "24752f2ddacf2985854764bfbfe770ea3507a9b86ea7fed063d0b40ccc3df5e0", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram6.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "166ed26426c4f40e8baf54412eb17183eb7faea9914ff84230e5ca183251e25b", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram12.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0e5973f6d717c892beb9cc5e9205f8d12a05af1e16679bb7d5ed3960483040e5", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_19.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9ce9e3c8d872dcb05bd80cbf3c43159c291ccd4220447c584cc140f3441c78a4", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/stylesheet.css.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b8dc297b7718d17732cd986b63ec16faea67011ecfd6c498f63d2343e53665a6", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_6.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a51a3a134bf4d39a91384aa10bdcae79904a8438294c7a61bf26183f88a0cbde", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram20.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e784dc8998974408eaecc26f53cbc65bd86c8890e8d232e91c6bf0464ce5630f", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram16.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e8863d8733f77b13412cca5c57574b8ee92f52ad820fbf31a5d9bb7c94478912", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_11.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "501c8564dc64688e8b3fc970a0f06cb4893cdc0df62e7aa50a77c784e9287f5f", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram2.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "394ad3c80f8905132438d8d6c36a1a658ba5e07b9a79edeec7a463dafee0e03c", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/ahf_events.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b0196f5be89c0065c9402fadeade190889f2f5141fd7c25f899f55e5fe46123d", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/job_report_database_unique.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "07b6fb2ee323774f7b1f951180526fa804398839f209620b6ca1d3fc545971e7", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram14.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "807590e43471371ec48e8ea51c2b287212a13feb82044118dfcc41a1dc5c3278", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_13.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1b7c683cd0fd5d923b899645c6231e8f093ed8a244f6a5a04fa15de515b079af", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram18.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7b3a1e26c90213a2638c04f619c6d9708dd8270b219010448534859c56a7eb04", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_8.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d6c6f25c46d56cf5819d03e38a71d438b1f73ff6b4f8452e485927052fb21977", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_4.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3cd42f173997efd1eb6d528bb6e57aa2d04ee3266accfb5e82c26ec39dc9a196", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_1.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "273140e648b5ecf34c62179e695948144717e17f9888c016f08c045b5292d305", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_20.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4331dd42ec323b033d4be38b806b6ed5585d7f3b642086e161e8dbf67017a316", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram9.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "297e0fac4a3f18253e501eec6401c0889b107ad669b9e87849a08c379b9ccf7c", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram11.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "63a5c8b40dad1a95795502f8fda73cdb38c0618ee1d5ce6cb40684429cc5442b", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram5.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "30dfabf8711b825fb0188bcb649f777c0fa3a8db2e6b65e3da05da27755e18f3", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_16.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bf8a2d2eddfc902ff016653651a7e024fc5db50754386a93df561deac69bf541", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram13.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "85a1df897e78e5053ae0e6a1400b4d0d09a12b3608681bf542614e84628b22c3", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_14.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "beb63fa9a31db340e8541d2787df88f02a5c1f64062e33f032bd14651b248cb4", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram7.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4217572de469363bb90aed9e87a26c24652f7ac181d5d7af5e87ccf6f47c8f40", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_18.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e1e809c23eae4a8a81eab82869614f8a776a83d42c1d3e986bfb350e09550919", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/job_report_database.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b7b93f41862f27a50a11811afb2a196f2944bb534b3ee3c0c5b5c0f6cf5d88d0", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/DatabaseWaitEvent.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "65fbd4468d8e43483fe6fd77133bc971b0486944b5c287f057ad46e65d769006", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_3.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "415f9f03a58927c29ed7fddb2b624e706521e20208b122f34f633dce78faaa37", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/job_report_master.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1099bccbf5b17c042baaa63e335a1e135f6cf11ad155b0f6d48bfa2b7827f075", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_10.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ce1eb8bb084f6ab748229111dee3d2e7bdc0cde2147b09437a97bb8cd28405fc", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram3.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6db1d1fb30b1830f9c5df87b27c614809a3de575d3395f72f192995445439d8d", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram17.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "27f262911181730669ad01aae7df139bf8aaa970cc153c9c3802a232f084677a", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/job_report_host.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0ede4be4b79bcdae295c9d7c640b826d5852926427103a85fd6952d0fe6d23db", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_7.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "deb96309ef395a364e465470fe9bf553bc2334a342f43eddc975fcbb95012329", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_9.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "21313ff662b0b22adc381c5820840f7b05b6eab75c687e4d3a5d077232324897", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_5.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "eb2c4a8746c49ad980c353ee5aa790671b7d33151b3db3ca0fcc9b737d8b33a2", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/delete_sla_tracking.txt.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "48b1afb6f3336da1c84a954c6c459d795eea2078de2e404c92f5c33ba5db387b", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram1.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5721fb50166f9a5ddda8aef9b4ceaec6768c5e62faf81392a4697b581a878983", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/sla_tracking_12.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "11dba7bb5f52d32aab148c81daee2087a7e78a9729a3e79478827de0e2ab8806", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram15.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "73dd0de7be212eda82aa5d0f81ba90905c70f72a564975e199caa187196889e8", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e15d0967c3dceaca0c2e5c5c3e5bc7b00371bd6fa6e080dd7223b1945ce64242", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/templates/result_histogram19.csv.j2", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "98f0737f00f6e26d9fc6807e609b76468ab7e171b3d237f24e7f866ab1ee0e86", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_post_tasks/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b8527593fa224c9f47b7ce17681895cd2f608fd013aeee22b61091ef17ad59e7", + "format": 1 + }, + { + "name": "roles/framework_post_tasks/reports", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_post_tasks/reports/job_report_example.html", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8686f8bd91c1b4e5bfa173b85381b2fe970f837a961980d7e12e45591e70c314", + "format": 1 + }, + { + "name": "roles/.DS_Store", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1d096d630e1deac03534a2dd975f1d6a877c746cf0ff7962743ebf313e10d2a4", + "format": 1 + }, + { + "name": "roles/gghub_remove", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_remove/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_remove/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "98ee5ea6acaea7125c9e01ddf72eb52fefa3fe2f6729839a333d7b8f6252c3ae", + "format": 1 + }, + { + "name": "roles/gghub_remove/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_remove/tasks/remove.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d84f2dc6c69c77fe70b8c8f504570aa60ee8dcffb92e189be5d078c7b1308d19", + "format": 1 + }, + { + "name": "roles/gghub_remove/tasks/deinstall.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "492236bf31c285596bd91d5a220292e67cbac9219a798c83ad1aaceb8f6aa295", + "format": 1 + }, + { + "name": "roles/gghub_remove/tasks/stop.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f933de466c867972e2bd1e6ad018f14e9474115b0f3bc20537d2fd743d0eae8a", + "format": 1 + }, + { + "name": "roles/gghub_remove/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f8aa5ef1bfa2659823cd28a3d5c191d6347e839390298d683ef07d594f2306b1", + "format": 1 + }, + { + "name": "roles/gghub_remove/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_remove/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7ce8e0f10f7f548623b5e2dd528ee8d2f3b8a0e224951c9e29d8a462dec2363b", + "format": 1 + }, + { + "name": "roles/gghub_remove/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0ff94a2f3ae5fa1b8dd2993ebf452fc0aa234e3b1e8260479e436ec456310557", + "format": 1 + }, + { + "name": "roles/gghub_remove/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_remove/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7f5623f4486c92b9c385af71494a729d0144cb56473bc8a5e3680728156021f4", + "format": 1 + }, + { + "name": "roles/gghub_remove/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cc751d75266f757a38189f15d54e548dc87706f14a39756995c27b49eaca8a07", + "format": 1 + }, + { + "name": "roles/gghub_remove/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_remove/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9ecc701096cef68edfee4d3a25f8c4b3eae5afad47276c0e640b95ef110de2f5", + "format": 1 + }, + { + "name": "roles/gghub_remove/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_remove/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7b868678c63ec0ad156f75b2e04c3ddaf7e2aa090d1eaaf241cb53fe5224ba60", + "format": 1 + }, + { + "name": "roles/batch_workload", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/batch_workload/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/batch_workload/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "85634c17aef12660240c68a9877095e0e79aa2fee06d2e4a4297439bd901d7e3", + "format": 1 + }, + { + "name": "roles/batch_workload/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/batch_workload/tasks/create_lineitemXT_maa.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a7a1f7df43dd494aeedfc89603f27cbe8e4d57f326544c8b7ee0b97c40ed364a", + "format": 1 + }, + { + "name": "roles/batch_workload/tasks/setup_etl.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fc1fc8a03117298068080fe732477410357865599a30570cd8eb27d780c6de8d", + "format": 1 + }, + { + "name": "roles/batch_workload/tasks/clone_pdb.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "69c568478a266ed4b1e2cba0eb83784cb0aa4c7e3155fcd3480716de6aa4c315", + "format": 1 + }, + { + "name": "roles/batch_workload/tasks/create_lineitem.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e56f812a56800d199fe4def6a2490a35b3e9db9eb7ce51c9b0d4b62131401749", + "format": 1 + }, + { + "name": "roles/batch_workload/tasks/create_redorate.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "71037496a7ac3a59747871dc514c2adadb2be89da2cfc95bd9b82aeb3e2655d9", + "format": 1 + }, + { + "name": "roles/batch_workload/tasks/load_lineitem.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1c2c9b44f9189fc1172c2c82b59948ce33c2ddcaa1c1b0d5b1648728f99b1341", + "format": 1 + }, + { + "name": "roles/batch_workload/tasks/configure_database.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b61af75c956442aa765631067507e1708b1ae2cccc8f07c7c9f1d10bf5cc55d3", + "format": 1 + }, + { + "name": "roles/batch_workload/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d070cd3f6afe3234bdf747c5e597e446ace95fafe24cc8661741fc5b8aa9c5e6", + "format": 1 + }, + { + "name": "roles/batch_workload/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/batch_workload/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2e0a3d82166f3cf795fb633186b76be08c607a6cb3f1346eaaf3a9d2beef790d", + "format": 1 + }, + { + "name": "roles/batch_workload/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0ff94a2f3ae5fa1b8dd2993ebf452fc0aa234e3b1e8260479e436ec456310557", + "format": 1 + }, + { + "name": "roles/batch_workload/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/batch_workload/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4a4e5dee93518028a73456681899af5240cbb424a6082574e0361f9d644e8a36", + "format": 1 + }, + { + "name": "roles/batch_workload/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1ae02898f079c885122b7fa83f3efc421b8e4dd4eb81684be7e155ca7e8c0d2e", + "format": 1 + }, + { + "name": "roles/batch_workload/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/batch_workload/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "29755c4cc014750a05a5949af8a34e88cbdb5095f59e9a912c83fb00aa6e457c", + "format": 1 + }, + { + "name": "roles/batch_workload/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/batch_workload/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e01138c438be04f4118b89acd389ed066125cf502da23b1e9282190392ea3da1", + "format": 1 + }, + { + "name": "roles/oracle_facts", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/oracle_facts/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/oracle_facts/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "dcb069aefc99bf32cf55afb6907fdc83f8e097893cac293b3d25b0cc22a3b892", + "format": 1 + }, + { + "name": "roles/oracle_facts/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/oracle_facts/tasks/dbaasca_grid_getDetails.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "72b71f7ba23ccda19cae350235ccfa85674f996bca90aade333cf0c967511f66", + "format": 1 + }, + { + "name": "roles/oracle_facts/tasks/dbaascli_grid_getDetails.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4418ef05f38788bf5f66ecd44aaa1e182d2f28420209d857a20d42a9cc4db124", + "format": 1 + }, + { + "name": "roles/oracle_facts/tasks/dbaasca_database_getDetails.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5d7331e16f26fb761749abc83df27356c15431822e0fde9d4031423452b6a19b", + "format": 1 + }, + { + "name": "roles/oracle_facts/tasks/dbaascli_database_getDetails.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a4772702fed06f7ddb276d7c6059c7eb7f81ce41224e8fe3dbec7ec490e81722", + "format": 1 + }, + { + "name": "roles/oracle_facts/tasks/oracle_home.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4b0a716f04a20f9ca716444222447b74765e19c0733178b0c04486d2f9102cbe", + "format": 1 + }, + { + "name": "roles/oracle_facts/tasks/sbservers.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3e1a15098c66322a980da43360a3d4f4685f76a3af2e3ade18df7bceeea04739", + "format": 1 + }, + { + "name": "roles/oracle_facts/tasks/grid.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3bb51eb0116644b1ce19b201af413598d6640d79947f6976b323379536d06fd0", + "format": 1 + }, + { + "name": "roles/oracle_facts/tasks/system.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3356e449a1ab7a2a2e35212fe467905127a537e8dee18e1ad3dff61e14618a16", + "format": 1 + }, + { + "name": "roles/oracle_facts/tasks/gghservers.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b51d4c3e56b360c78712128ab87350b8ce06929a8308ee707ff72371e0d93f6e", + "format": 1 + }, + { + "name": "roles/oracle_facts/tasks/server.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d7193bafeb6c5de3db41c303aabdca98b2c7f9327ded20a75c5c2b37a5cb8a93", + "format": 1 + }, + { + "name": "roles/oracle_facts/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1285c4084a912bc67d8e8e5d0d78de8e913b1e3fbb4f822ff82e71e74033abee", + "format": 1 + }, + { + "name": "roles/oracle_facts/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/oracle_facts/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0a3a30f36bca75fe5468282a8bdabf6bfaead0cdb55011295562a6d58ab95ce0", + "format": 1 + }, + { + "name": "roles/oracle_facts/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0ff94a2f3ae5fa1b8dd2993ebf452fc0aa234e3b1e8260479e436ec456310557", + "format": 1 + }, + { + "name": "roles/oracle_facts/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/oracle_facts/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c634f57bef3cdabfe72db8ec4bae93d1e639aa4fa215be7506ba451989f87b65", + "format": 1 + }, + { + "name": "roles/oracle_facts/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cc751d75266f757a38189f15d54e548dc87706f14a39756995c27b49eaca8a07", + "format": 1 + }, + { + "name": "roles/oracle_facts/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/oracle_facts/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "01c39f2ef1af93a7ca7c490102930eb5f5964e70c74b23011eca63c4d5de62ba", + "format": 1 + }, + { + "name": "roles/oracle_facts/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/oracle_facts/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "683dba60fa4e8402cfe42c1bf871b02f1f6168ca386242fd08237b375f3e2b79", + "format": 1 + }, + { + "name": "roles/framework_start", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_start/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_start/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3e7b37ed51bf39be76bdee22f09b6eae79b66a180d691083bbe8905811b80984", + "format": 1 + }, + { + "name": "roles/framework_start/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_start/tasks/start_check_jobs.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f0173a11c9f0a5a2b820e570a37269cb7872d2c52a0e94ce7d9da12e064c1039", + "format": 1 + }, + { + "name": "roles/framework_start/tasks/start_stats_pack_snap.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "00ff0feb114d1d2c6a9ac8f18c0580cdca5a86f6a76748d854d3fea2f4d1e7dc", + "format": 1 + }, + { + "name": "roles/framework_start/tasks/start_swingbench.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "03ce2e03c35569503dd65f22a2c8c0ded93383be720dcb6d1803d0e1fee844e1", + "format": 1 + }, + { + "name": "roles/framework_start/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "84b3456d959ae88233dcecae855efdddc3fc2901a51d422b68ffe12e1a2f69dc", + "format": 1 + }, + { + "name": "roles/framework_start/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_start/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e8733f341a74ee1feb7611d4fb3ef3395174a29e29e3bec3ee2daef858283d2c", + "format": 1 + }, + { + "name": "roles/framework_start/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e02233819b1a09844410549191813f7cc7ba360f21298578f4ba1727a27d87fc", + "format": 1 + }, + { + "name": "roles/framework_start/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_start/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4a4e5dee93518028a73456681899af5240cbb424a6082574e0361f9d644e8a36", + "format": 1 + }, + { + "name": "roles/framework_start/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cc751d75266f757a38189f15d54e548dc87706f14a39756995c27b49eaca8a07", + "format": 1 + }, + { + "name": "roles/framework_start/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_start/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2410a68ebdb4058317904bbf1d44e64d248a750c90deb36241b721eb0cdd55a0", + "format": 1 + }, + { + "name": "roles/framework_start/files", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_start/files/fanWatcher.java", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1c2d9abef6eb2d6268fcd0aaf4b646bd3118a3392d338af52610e2d0c276b38c", + "format": 1 + }, + { + "name": "roles/framework_start/files/check_ucpsess.sh.bkp", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fcd48e55d16c70dde5d02709fe6a832dc0ba4e7227eb02482f2598bfcbfd2874", + "format": 1 + }, + { + "name": "roles/framework_start/files/onsWatcher.sh", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ea0dc8a53092cc00be4c3bf7a8848068aaa0f9f2f18bc45e597afd54ed1486cc", + "format": 1 + }, + { + "name": "roles/framework_start/files/check_dg_lag.sh", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9cbf61dcd8873442ddb16dfca710f43d5b2ba9b023600ebb4d453ee52da6d6fb", + "format": 1 + }, + { + "name": "roles/framework_start/files/pm_framework.sh", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "16d5626d0407757c18e78a468d5af50451f4d396fbb6d48343c539215e334cc2", + "format": 1 + }, + { + "name": "roles/framework_start/files/check_fanWatcher.sh", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "438b32f367647c7d5005caedbff9bde94fc435fe056d3f0debb9f4567cef6554", + "format": 1 + }, + { + "name": "roles/framework_start/files/fanWatcher.class", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "de337a74b90f49af5f0361ffd69ff5c8161790a7ce4e2375f61ae0d25a288925", + "format": 1 + }, + { + "name": "roles/framework_start/files/check_ucpsess.sh", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7b5d30e0ac4afc9c4f811ea6a43fbf41acc442296ac64eef0b93e6f57cc7c590", + "format": 1 + }, + { + "name": "roles/framework_start/files/fanWatcher.sh", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "12f1437caebfbae6fc5d47f401adba108268c1f41950934359a02cc48972a569", + "format": 1 + }, + { + "name": "roles/framework_start/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_start/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "53d95f171a02c85e2a8638079264806ba13897ee301cd9cf14ed3d4fe85ee401", + "format": 1 + }, + { + "name": "roles/framework_onboarding", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_onboarding/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_onboarding/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6e7339888bcf686244345fb9fc4cb6de2956202ce33f31db586fbeda41d1f5dd", + "format": 1 + }, + { + "name": "roles/framework_onboarding/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_onboarding/tasks/swingbench_configure.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8cf8ac6e20a74c5c6de57603dad4e476a87a8da9c5280dccd6a54a42d01ca259", + "format": 1 + }, + { + "name": "roles/framework_onboarding/tasks/pdb_create.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c02d7d93564a814b455b38b485ad784e9d83dc623da0f638d25a9557a25d0e24", + "format": 1 + }, + { + "name": "roles/framework_onboarding/tasks/ahf_configure.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "07b25cc5996dbbf829263f45c635bbcdf9411cd6c38c4c65d130d5fd6a306fbf", + "format": 1 + }, + { + "name": "roles/framework_onboarding/tasks/onprem_security_configure.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c7d3fdd2a3f102c4e3ef77dd0e83a86916271bb0a51b902bce339f8759ec8f4c", + "format": 1 + }, + { + "name": "roles/framework_onboarding/tasks/pdb_clone.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "99d11435be24ea8b2720c8093503eac9a8930dc25a7ac1458fb873083df88f0c", + "format": 1 + }, + { + "name": "roles/framework_onboarding/tasks/swingbench_install.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ca06d92b564ba838ad16937d8ba718b78a467aefd738b6d43aa3e4f2e5d94c2e", + "format": 1 + }, + { + "name": "roles/framework_onboarding/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "86c906256d2c3af2d9d06b5d1fd5851dc807a093daf86b1c91111fa7a6c658d7", + "format": 1 + }, + { + "name": "roles/framework_onboarding/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_onboarding/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "36e03482b01cddb58298e9f33f1d3d0fd622e5bb4c604e5750051b0e23b1022b", + "format": 1 + }, + { + "name": "roles/framework_onboarding/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0ff94a2f3ae5fa1b8dd2993ebf452fc0aa234e3b1e8260479e436ec456310557", + "format": 1 + }, + { + "name": "roles/framework_onboarding/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_onboarding/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2b411ef4bf05d0d513c0198c5b8176b2279f924f9da57f689171bd343e908f77", + "format": 1 + }, + { + "name": "roles/framework_onboarding/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "806cc3ead3a36b237df605f610283d85df9856be386b4901f6936bdae2cf2cd1", + "format": 1 + }, + { + "name": "roles/framework_onboarding/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_onboarding/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a26574aef273e4a76e38d7fef14dc2181fcabd47dd08e4d212cbe5070b4bdab1", + "format": 1 + }, + { + "name": "roles/framework_onboarding/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_onboarding/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d26571b3188fd09c798151c9dd49c42333eeb5287d7d391e2abb48e463854ac8", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5933ac9bc486ff5294e7255fe2349c8fae74a38eb1075557a93e88d953bbab7a", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/tasks/nginx_distribute_config_file.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fed57af76e61fb14c244ad220430059bb0e58b56ac14d40b67f7eb93338c1277", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/tasks/config_iptables.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a2b1949f1e475dcb911bcc79394a9f8baf73168f59cc921a200290166f925d6d", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/tasks/gg_hardening.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2d140e24ffa887e7a82a88a28f5c6e86b8d76053f2ade0739532d45c1a64dce1", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/tasks/create_env_file.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "01462982ac14b27ee3b73a875b108b632b5471801f0fb1cf64704d2f2bee1584", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/tasks/crs_add_resource_nginx.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4fd54ec975d543db5e5735c1e2ddd20d45832901344c69a27bd276f68e908237", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/tasks/oggca_add_gg_deployment.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5575ece223f84f1df5acf80436bf491506711bb05369b8a3c45a8b2d54d48885", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/tasks/nginx_config_proxy.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e2155b896543fe0a721d3814e53f0bbb53bdc6cd58fb5e89796d837635509046", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/tasks/xag_add_gg.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "73a60616787723e1c30e892382ad2f9d5b6c40a84f097280569c26726bf87d93", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/tasks/openssl_self_signed_cert.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b278cd6357ac5b33c6b659fad353b0424548cb088738fe66f351f2f77bf8c5a4", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "082d550b31f08668c6bc7efe7ad85dbe550db65aad4216a1ab65069a00a392f9", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a630752ebb7e96a7b52b6d8badbb65d7533ae389844f9f906f62f75f1fa676a1", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e02233819b1a09844410549191813f7cc7ba360f21298578f4ba1727a27d87fc", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0265eb23e4eaf81913ef271379c3091ec57a86833d1de1ea1507b8ead9a47a17", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cc751d75266f757a38189f15d54e548dc87706f14a39756995c27b49eaca8a07", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8af7d40192538a48d90d60da582524fece3a76bf5dd55ca8bfa188652b24913e", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/files", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/files/secureServices.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7dfa6c0e6b2bf68253db289e61243a68d0858dd4e99a4177b44d8d350b7a28ad", + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_goldengate_deploy/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "25c39c896374aad42af36afa4336c36de40b60e5be03cca58a867f57ddc27b81", + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f52d711103d50a437830c6fbcd04fb4bab49a0f82f6d26d1c791c6e8488dd090", + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/tasks/crs_add_sshd_restart.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8dec3599d4ec556d8dba36394afbd1d26fc2b124f580e072c52652e679eb7e0f", + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/tasks/asm_vol_create.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a719fb35d7508299a7f4950c93294b48bc8dcf6111cc71e0938b25d945b55519", + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/tasks/appvipcfg_create.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "dc4693cbfd97ab405b149acdcf66c4dab5ff72e58f74a6b83cb73b09394410b1", + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7c22e9df0b598006a393191d2d910cb0041b6e346182a008a87b051ffc8625c3", + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/tasks/crs_modify_res_appvip.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fdb2612be22a6410c0cc372e45d26e2b09ae908b3675a6412efdedcd8efbe1b4", + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8cda40794ed7ec26a6464ea049b98492b448f3fac3bc62a51fb80e0d4d35b65f", + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e02233819b1a09844410549191813f7cc7ba360f21298578f4ba1727a27d87fc", + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a7cb7d6211cf9a42781f5e85a5609f1a003c89e1b4f16412355c4713ef7ac0fd", + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cc751d75266f757a38189f15d54e548dc87706f14a39756995c27b49eaca8a07", + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f160f8658a52f84584ff30ca5974b810101a46b5cdeab37349aa0acd99056e69", + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/files", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/files/sshd_restart.scr", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ea480efa897614b864b145f6da1177d1bbaea27c746b6f5a42c2c7726b42f221", + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_vip_asm_config/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0bae75e1350163418f05ada73b81683e7b0916b7883feb0889a3c377ecac5b9c", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5fae1ff51f630c7c06567e39454cdf4d8d84972bf9d7e5498ed9f0450ffa7ea7", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/tasks/initialize.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "357dffcf072652731f83b4621b680e6bce8869a209d18db038a5faa723798fce", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/tasks/srvctl_add_pdb_service.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "55c87b811ed8521ce638aa7ea11b99042dcb1b6c7dfce0ca8e12056a4dafec9b", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/tasks/sla_tracking_thresholds_config.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "90a6899af3d4ad0bb452ae4458850775ececda84544fb2dbaceb8dade79ef742", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/tasks/prechecks_gsm.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "83a341d0e03195149500d31b75b48619d762d7a761c35dbaf595840d06136bb8", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/tasks/host_status.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "327e105af7d612d136bbe45c775ef36d8783b2bb47ef136b3d08e7beeb79adc8", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/tasks/soe_copy_config_file.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d89b00b88848da0db9954ad1f79ace2e3126a2707ee76a23c30a3c8bdb109684", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/tasks/soe_create_config_files.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "613cd32aac261d2da8d8be6334cd9680093dfca00e922b4b17dd194c0b37ef85", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/tasks/prechecks_db.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cb057f273cee0340c3e467e9eff1b6c27425c202836db32578cdaeaa0c93a1f4", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/tasks/prechecks.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c2ae26a0aa0a5b066c211f94d5f58d61ce33065106a8f7042c22028ebed0df88", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/tasks/soe_create_config_template.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5dbc3134fa7fd14bc4e1c108609e907413dbdf93398460e8333849e375d427e6", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/tasks/remove_install_swingbench.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "82e8abe6a183fd18cf6a75c4eac2a07d5857c03ba5870f6112839fac9ecd7b18", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "dac312813d05e4a126a41de3c099d2ca635361a962a70b7d3b54716fbebf6ebd", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "79d06ccb2efbfe3ce9458255f2f4135c12863f2212bf49a14070cdbb7bca45f5", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e02233819b1a09844410549191813f7cc7ba360f21298578f4ba1727a27d87fc", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ebc7f47c5b5e885d890b926e8cf9977eca92723177e8178fcbf802ff16963993", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cc751d75266f757a38189f15d54e548dc87706f14a39756995c27b49eaca8a07", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a52bee4b8f75b0d1f1b73ed7593c45178dd819711e32d611367f5adf186135ac", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/SOE_Client_Side.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fbce9d7169f73491b5f7363fd48ffc10d1ee1ff4dd256e04bdcd2e6e4588aa84", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/scas09vm01-scan7.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2eea0091edd546eb95cfa46d11dbc50427ce58b61692cbb28eff8e5439aca9a6", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/create_epoch_to_timestamp.sql", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b910b592ec628e079adc321f841fe95a4e9e2c1d15ec48bd0dc7daf68781f454", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/swingbench_oltpmix_template.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "13f504acad23c78c92aef665d07885637e74eaf39a383537578d348a6daae527", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/swingbench_dss_template.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "843876540705f48ab2f53dc891d172001e102f7f8d7442527aff4941db3c059a", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/swingbench_oltphighredo_template.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "eebd34693c332316ea4ab8136d2644853c8ddad7bd3923dd9dfe87275f364216", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/SOE_Client_JDBC_Sharded copy.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "73ebea9148c552202baf19cb18dfc17fbd515d961cecb7e9bbe3eb0854a91456", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/swingbench_dss_one_template.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5b40de95002e7d66aa93cde3f551e03e793fe91d679726a4a50703cd9f487726", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/swingbench_oltp_template.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2487243f59be151982ed52a78a55f27fb527b23aec94cab87fa0ffc24b575d4a", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/swingbench_vecai_template.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "66aed5c455273316b97c50308bce99d7c88da98868901090dbcf9d0d48fb33d7", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/swingbench_ixmaint_noredo_template.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "aa198b2fed875bd40af644bee7ba766e461fbe09b6734a435c3ca5f797d15dcb", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/SOE_Client_JDBC_Sharded.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5afa367f9892dc700f2771908bc91b49196b6782b449913e4f5226ef6dd87cd0", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/swingbench_ixmaint_template.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ef6966b4848d167ebd5383e574ce3dc062b798e8185876c3cc07820359177ac4", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/SOE_Client_Side_AC.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7cdfde315af07660e96c7d5817886e7c127ab74a2a776c4ae5b49447e55a0ea6", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/SOE_Client_Side copy.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cb3d39af515a2d50dec3b1912e69b9efdd3dce7dd1f195b0e5773a4c404a759a", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/swingbench_oltpmixro_template.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "31676217685be7b1725909b261f06296ea322e6a0fc2a4f5d16cd14cda4bd23f", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/SOE_Client_Side_AC_BUO.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2b44dc1f80971929f2f7fdbc24dd6ee658359c3f06ad3aca8b60f99ac6129b24", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/files/SOE_Client_Side_AC_ro.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3e9877543800c26dca594688b894710e37c3fcd57b777e6a440554dd2ebcac1c", + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_pre_tasks/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "07c750e32f4e6b26e01649f1fd7040b2d25341f2c442dc1a82cf6f26fb435aa8", + "format": 1 + }, + { + "name": "roles/common", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/common/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/common/tasks/oracle_sqlplus_run.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e782e5751a0926b371b8ad12d1c59aa8d7890acc7c7ab3cd7e3b1202abfcd226", + "format": 1 + }, + { + "name": "roles/get_host_facts", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/get_host_facts/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/get_host_facts/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "18a0cf59b30134f3a91eb314a131ac754b4537dd97cbfa1fb43e937c09f59e0d", + "format": 1 + }, + { + "name": "roles/get_host_facts/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/get_host_facts/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "69364323fd7a4bc3c6cbac57f9413b87548232ba4260b1934ba69733c37d50e7", + "format": 1 + }, + { + "name": "roles/get_host_facts/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/get_host_facts/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b96676d8270c55ab801572daf49716498dc56ac1399913da9858bb1e65680f4c", + "format": 1 + }, + { + "name": "roles/get_host_facts/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0ff94a2f3ae5fa1b8dd2993ebf452fc0aa234e3b1e8260479e436ec456310557", + "format": 1 + }, + { + "name": "roles/get_host_facts/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/get_host_facts/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4a4e5dee93518028a73456681899af5240cbb424a6082574e0361f9d644e8a36", + "format": 1 + }, + { + "name": "roles/get_host_facts/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cc751d75266f757a38189f15d54e548dc87706f14a39756995c27b49eaca8a07", + "format": 1 + }, + { + "name": "roles/get_host_facts/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/get_host_facts/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a4ed3b143d6016744b879b1d3c9b2b44f5736255fb0926d25ccb3f191d917e2e", + "format": 1 + }, + { + "name": "roles/get_host_facts/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/get_host_facts/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e72d951035c598cbbcf0473b10f26c957416316ce1106ad75dce064ec3fd3920", + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7555e62b46cd2571a08189cc5b163eae5d1f652453b521cafcd225bd181cde11", + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure/tasks/configureStandby.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9b2b6272317c569143695b2ff76bbbff398c2ee7b847302fcbb5731920886833", + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure/tasks/prepareForStandby.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1f940d8d4bc0fa77e96a511e2449d6834e0c7702cc83d72e63a2637c468f6c6b", + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure/tasks/prereqs.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ddb6250fe63c362c070dbabf912b8ba26f00390dbbb0c4edbbcff5dcc67617af", + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4777f91d3a078c74fc91b3a72e105cb50c310dfc9e91b9cfff3e6d0f24bca6cd", + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cbab24f38c0b63264bdc920f18842a6de706ef583a78928edf73aad49737e701", + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e02233819b1a09844410549191813f7cc7ba360f21298578f4ba1727a27d87fc", + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4a4e5dee93518028a73456681899af5240cbb424a6082574e0361f9d644e8a36", + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d9cc41b3180364033be6dd1dac77cb40f4e6bd09c8a4b75bc45a000dc6fc401f", + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "edd1cd2ee5e0162e7a6d9ac181e51ba24f8a78856be83bd4bd01a98c22bc82db", + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/dbaas_dataguard_configure/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "113dcd5b3ace03d8a2bf7a4cddd7565597e8a27474889551ad1559e6dca7aab6", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "44a6abcda49b04836c551be55f3c792b8f2ebb335e3cf3e74a60d86a9a60f4cc", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/tasks/nginx_install.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8c412a2165a10328f5c3e9ace29c8979f749293a8cb8e333fa7adfa75a6052ae", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/tasks/prereqs.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9793cd0b49c79cc0a91ab064700cd7b4eb095105f70a91a875a8495a5c312111", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/tasks/software_setup.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fb2eaa10a950a196ca78b330d6e23b902921fbfc2ea1ef0e7e6fcfb0fc843732", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/tasks/ssh_config_equivalences.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1e91665e0136b9cfa8723286668bc33656e2ea2c563967eaf90cdfc5d9069903", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/tasks/openssl_self_signed_cert.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f1acd3d59ec8c84273f89df7dfd988d05eb87cb88ab749da6e357862bbd12b30", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/tasks/goldengate_install.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0b210d9009bc69f3903530dd897ae9be43de3603156832364c88672ffc7994b5", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e346b8d9fb8e73acce2efe18189e1406298d8ce05e189f13265c5ac96cd3e249", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/tasks/xag_install.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1a02ae0c07a16c456e9159d95d0fc8dcdb8243892d4077dbf58ce2db42f97695", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "18c1ef7cf55a04e8789014cd5ce6335875d7af175c166e72848fe92c7cb58f5f", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e02233819b1a09844410549191813f7cc7ba360f21298578f4ba1727a27d87fc", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5215a462fee42d0fe31f98e76380643e1ab07d18b12acad27ab261a837d7c7c6", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cc751d75266f757a38189f15d54e548dc87706f14a39756995c27b49eaca8a07", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b747f474e7ec4493ae2e5993e43f2fe136ca595376f96a641421290b743146a9", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/files", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/files/config", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d9149263fb67f3934177b96e38464a2fb2ad301fb793ab07a864e8433a212839", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/files/id_rsa", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "447c0e26e4d8bc9aa56c48e8db47f55fa6204ebb7bd012e752a62ff9305eb46d", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/files/id_rsa.pub", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3c0cc2c2154e5d4642463cd4f1c83a89bc4c17eaa2683a9c5bd5ed3fd2c3e799", + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/gghub_software_deploy/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b0a8eea7c59b8d8a287e2efeff822b6c0c6ac7ee063a27c7c018604acce189b7", + "format": 1 + }, + { + "name": "roles/get_oracle_facts", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/get_oracle_facts/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/get_oracle_facts/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d6fd8cbaa8d82afe293bc8d68e6ec407b34ed8bc55db5d83f8fb83d41bcfc8da", + "format": 1 + }, + { + "name": "roles/get_oracle_facts/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/get_oracle_facts/tasks/dbaasca.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c5aae28e0efb0caeb9d8c27dde6ab9afdec2c2104cc75288d3429e33e535f1ba", + "format": 1 + }, + { + "name": "roles/get_oracle_facts/tasks/dbaascli.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1ca3f7a5bec8f6855168fed14afeed243a74cf0f4427d690a7fff98bc5bcad8f", + "format": 1 + }, + { + "name": "roles/get_oracle_facts/tasks/system_facts.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1e39f0dc58f6b77eb5429463c7d6c492689108aace25727b16fc725c8b4ff2cf", + "format": 1 + }, + { + "name": "roles/get_oracle_facts/tasks/print_database_facts.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "470b87830c526813a13d4381fcc6067ef9b61ec55604ebfe8795933b038a6409", + "format": 1 + }, + { + "name": "roles/get_oracle_facts/tasks/print_home_facts.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c60885f94e536632331e1c9f31c001cffe2a4327ea4db37f85e5690f658e8b43", + "format": 1 + }, + { + "name": "roles/get_oracle_facts/tasks/grid_facts.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "85414e4a0c68ee714d7366635b733cb56052c32af920b7691f26f3c0391c81ab", + "format": 1 + }, + { + "name": "roles/get_oracle_facts/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "519441b13f1badcd9cba827b80b918b537a9b99c76c2095cd8cc1d7770d8e1b5", + "format": 1 + }, + { + "name": "roles/get_oracle_facts/.DS_Store", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4864ab3f988037ec4601fcb8499d512525cbb3388ff3f36f82c66b45d3d2eb3d", + "format": 1 + }, + { + "name": "roles/get_oracle_facts/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/get_oracle_facts/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "61d8965aa56579bd7718ff0cebe620c3861d2b957d273757b89a6d8117748734", + "format": 1 + }, + { + "name": "roles/get_oracle_facts/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e02233819b1a09844410549191813f7cc7ba360f21298578f4ba1727a27d87fc", + "format": 1 + }, + { + "name": "roles/get_oracle_facts/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/get_oracle_facts/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4a4e5dee93518028a73456681899af5240cbb424a6082574e0361f9d644e8a36", + "format": 1 + }, + { + "name": "roles/get_oracle_facts/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cc751d75266f757a38189f15d54e548dc87706f14a39756995c27b49eaca8a07", + "format": 1 + }, + { + "name": "roles/get_oracle_facts/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/get_oracle_facts/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3b9588cb4071b0576af30325d79a8e9aa8d8e07a2482947dd83fd57bf413ba9c", + "format": 1 + }, + { + "name": "roles/get_oracle_facts/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/get_oracle_facts/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e0dc837927edefe7e2f8ef2f5d68a8ce3abde1cb069233ba27f8abdf70eb3a28", + "format": 1 + }, + { + "name": "roles/dbaas", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/dbaas/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/dbaas/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "93e53c621bf2da3e17d8a1ba66e0fb9d003ba32a462500c47ae6a811781b141e", + "format": 1 + }, + { + "name": "roles/dbaas/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/dbaas/tasks/awr_snapshot_create.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "45b5d59af5c477bb2fc7e8b30fd35b4f92ffb6bc331df288791b873baddeb5af", + "format": 1 + }, + { + "name": "roles/dbaas/tasks/dbaascli_gridhome_create.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "df27259c92291917c20e68327373576605ae1d5f74c9bbfb5655d1273c9f6807", + "format": 1 + }, + { + "name": "roles/dbaas/tasks/ahf_configure.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8c2f2a469e8b037d74b7c162ea8774268d3d478e68d7b2d5f9d95f8416a152c3", + "format": 1 + }, + { + "name": "roles/dbaas/tasks/dbaascli_dbhome_create.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d595813a989e2af406158ed8c4eebacc6c64550aaa925c86f1bdc9cc9e435bff", + "format": 1 + }, + { + "name": "roles/dbaas/tasks/dbaascli_command_run.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "768d48e9422f51a697ec8122f384c79823becfb3611c1675ff2600bb3d96c3d7", + "format": 1 + }, + { + "name": "roles/dbaas/tasks/dbaasca_database_delete.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6260301a5f299068dde91d930e8060e8bd586da58d8647db73e65a30446e5186", + "format": 1 + }, + { + "name": "roles/dbaas/tasks/dbaascli_database_delete.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c0c85f96b9b98aee99e668179b63d22a04b1749af1f2b652f192b1e0aa64fd8a", + "format": 1 + }, + { + "name": "roles/dbaas/tasks/timeline_log_write.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a12584dc72abcf2b0041c9a820f3d634fde39e6c67889febd623f84ea7b513ce", + "format": 1 + }, + { + "name": "roles/dbaas/tasks/dbaascli_gridhome_upgrade.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "01be3a657e62fea408c6d8bb50ae091d2351e0e5cc8e70a0e90e15ae9545fa6e", + "format": 1 + }, + { + "name": "roles/dbaas/tasks/dbaascli_log_analyze.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8f66d126bd854edfd121a39aec3af8dc06e4a33f335c119d677127d1481ef6a3", + "format": 1 + }, + { + "name": "roles/dbaas/tasks/dbaasca_database_create.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "353837b232c8099a1ca33996c9323ee3eef1ca66933f1f60d44b2c03fee129eb", + "format": 1 + }, + { + "name": "roles/dbaas/tasks/dbaascli_database_create.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "03b1ffcc43f5082c9218f59760c195e95e9742c9e3959dec4047710ff283b614", + "format": 1 + }, + { + "name": "roles/dbaas/tasks/dbaascli_database_move.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "18697dadb45ea269972fbabc6e52ce3928fc33a3066249baca71162202f821ae", + "format": 1 + }, + { + "name": "roles/dbaas/tasks/dbaascli_command_flags.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "06b57f1061ee89e16eafef2e72752af4a09110496b7617501797016aca8ec585", + "format": 1 + }, + { + "name": "roles/dbaas/tasks/dbaasca_dbhome_create.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "86cccafb0f2f1cc30e1da3a350c989f0cd471ebaaf9a6b7b2bd1f3a06576d154", + "format": 1 + }, + { + "name": "roles/dbaas/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c48cc8e23f08d96595039741474239542fce7b18306985e8a0b8d961fa2c2182", + "format": 1 + }, + { + "name": "roles/dbaas/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/dbaas/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8428201923475670066e501e06c9842e7c2507c6edf96dbf3f27ee5053f74a4a", + "format": 1 + }, + { + "name": "roles/dbaas/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0ff94a2f3ae5fa1b8dd2993ebf452fc0aa234e3b1e8260479e436ec456310557", + "format": 1 + }, + { + "name": "roles/dbaas/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/dbaas/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d0bf8fa5a8f5e8da62d427af771f4d126b257a9b86b1fc65e890cda43db4ffe5", + "format": 1 + }, + { + "name": "roles/dbaas/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "84fcda9df8d9cb2f6c5b1bf6d9a5c2c4eac1a8ab447a9d88d02f574609b32bff", + "format": 1 + }, + { + "name": "roles/dbaas/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/dbaas/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1629caa5a94fd578f29cdd997e3038919511a143af3e435fb4154c7ddedcb165", + "format": 1 + }, + { + "name": "roles/dbaas/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/dbaas/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "130e9b8fe5a9c6dd9a682b4439715cabae2ced6d09f9d208bbe6ccac4f5bd818", + "format": 1 + }, + { + "name": "roles/swingbench_configure", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/swingbench_configure/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/swingbench_configure/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4c10b4e2cb49870b0a218d1059ebb7f450d7d45a0899ae351a571789293ce90e", + "format": 1 + }, + { + "name": "roles/swingbench_configure/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/swingbench_configure/tasks/create_soe_config_file.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9338333bb95b9c483f5f6c0d9efdc0f43c7d32cddbe6e3d8529aaab30488daf8", + "format": 1 + }, + { + "name": "roles/swingbench_configure/tasks/clone_pdb.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0a8e3d12c83063a7a370c3cbbdeb56c7040f0083473146a5d36e14d471664dfc", + "format": 1 + }, + { + "name": "roles/swingbench_configure/tasks/remove_create_pdb_service.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1a0afba6bd6b9242792d8635272b27bb78ac5f9bb71bd037593091b228f823ba", + "format": 1 + }, + { + "name": "roles/swingbench_configure/tasks/swingbench_install.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "bf6904836844b1ad3343b0f2583dbbcdf506ee21e88549721dea9ec5fdb86179", + "format": 1 + }, + { + "name": "roles/swingbench_configure/tasks/create_soe_schema.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cc23239e7e67682d480e28721e05d77bfd0db47d94eebb66b0f223532d0c3cdd", + "format": 1 + }, + { + "name": "roles/swingbench_configure/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7d45df7c0f49b1c4c088b0b7b366a987bb1730943000d5e54d912d1cf952ef41", + "format": 1 + }, + { + "name": "roles/swingbench_configure/.DS_Store", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4864ab3f988037ec4601fcb8499d512525cbb3388ff3f36f82c66b45d3d2eb3d", + "format": 1 + }, + { + "name": "roles/swingbench_configure/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/swingbench_configure/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5a04d687156080ea71e7830d01852e40abb7d65f9066825bd607ee9c3a46a631", + "format": 1 + }, + { + "name": "roles/swingbench_configure/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e02233819b1a09844410549191813f7cc7ba360f21298578f4ba1727a27d87fc", + "format": 1 + }, + { + "name": "roles/swingbench_configure/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/swingbench_configure/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4a4e5dee93518028a73456681899af5240cbb424a6082574e0361f9d644e8a36", + "format": 1 + }, + { + "name": "roles/swingbench_configure/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "20f0a738e3cb532919ce84454ef75e55f4cee508b143f2ef6b689958c895cc2a", + "format": 1 + }, + { + "name": "roles/swingbench_configure/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/swingbench_configure/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1d9d2ad1dfae724d7bdf23840f52de14831bf2457541391b7b66c386c4218dde", + "format": 1 + }, + { + "name": "roles/swingbench_configure/files", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/swingbench_configure/files/SOE_Client_Side.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e0ae3509e5f79b200f9c296996d4e286fbfe9a87e8bd91a2477db1b1787eccd9", + "format": 1 + }, + { + "name": "roles/swingbench_configure/files/SOE_Server_Side_V2.xml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f3d9295da3b926afcbbe72270c4d49a1d2047435f3af547a25ebf7b774f2fbdf", + "format": 1 + }, + { + "name": "roles/swingbench_configure/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/swingbench_configure/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b287ee5dc8edb955bdc62269172775d56df1c4111383910288334047b9804637", + "format": 1 + }, + { + "name": "roles/oracle_meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/oracle_meta/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/oracle_meta/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "059517d3bdd407c16a9d268736a96ffb36e595f6eca1c418c550cc84ce0a703f", + "format": 1 + }, + { + "name": "roles/oracle_meta/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/oracle_meta/tasks/gghub.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "336379a13522c5971f04bcfb91edfd1d39ba41dba5eb60f133ea362755b47779", + "format": 1 + }, + { + "name": "roles/oracle_meta/tasks/database.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1d940c0bb56ef5f6f0090e7961ec480b65e53f0d50b166c53b1f52787481fdae", + "format": 1 + }, + { + "name": "roles/oracle_meta/tasks/sbservers.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f84bde910a5f0386287ad3fe87a356c38aacd82521069d319fdf3cb28c29d0c6", + "format": 1 + }, + { + "name": "roles/oracle_meta/tasks/grid.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8c38495efdcfe4a3a72679a1e38b17b26808d6edea668352ea8abe64317d51fa", + "format": 1 + }, + { + "name": "roles/oracle_meta/tasks/system.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "827beed44e744a9974ca29c06fedfdb5fa60e579e9306a8128a92ea254b0d8da", + "format": 1 + }, + { + "name": "roles/oracle_meta/tasks/server.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "07374cf30d4f6d785e4cf84e48bce12aa4ec1f3cf3a67a25d9b4ff0164775733", + "format": 1 + }, + { + "name": "roles/oracle_meta/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "dcbb3f81012c14fe499ed7dcc0e1f13f934c6e159a0728f4882db39f70277e1c", + "format": 1 + }, + { + "name": "roles/oracle_meta/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/oracle_meta/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e8cab26dbeb3e9796a4b6e8c3379db88421cbb1d0a4ae281358661ddbc010c01", + "format": 1 + }, + { + "name": "roles/oracle_meta/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0ff94a2f3ae5fa1b8dd2993ebf452fc0aa234e3b1e8260479e436ec456310557", + "format": 1 + }, + { + "name": "roles/oracle_meta/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/oracle_meta/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c585c5b1e90d4522441bd428ed10091dded2d9629d12c98d45d4ab6b2d8d7fbe", + "format": 1 + }, + { + "name": "roles/oracle_meta/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cc751d75266f757a38189f15d54e548dc87706f14a39756995c27b49eaca8a07", + "format": 1 + }, + { + "name": "roles/oracle_meta/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/oracle_meta/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "53801b8ea52bda892fb58aa02c8f3841917f2ebe199d90315535453a800b4d98", + "format": 1 + }, + { + "name": "roles/oracle_meta/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/oracle_meta/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d58e8d7543dc45fdf821e7c5ebe91b3d6f5b6fdae32b07e60cccc9aae88410e5", + "format": 1 + }, + { + "name": "roles/framework_stop", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_stop/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_stop/vars/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7145df0f361fb2c5eff4c10391dfd42ab6fb3ff730981472ac11752a159a4406", + "format": 1 + }, + { + "name": "roles/framework_stop/tasks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_stop/tasks/get_ahf_insights.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d3912cfca0336861fbecfccde3c12c6112c8e865db29f26a599df45383d288c8", + "format": 1 + }, + { + "name": "roles/framework_stop/tasks/get_oracle_facts.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "60aaa278c0bebde361eb7c1b71bc9d9bd511e099fd9c7e7733b887e93234027f", + "format": 1 + }, + { + "name": "roles/framework_stop/tasks/run_tfactl_diagcollect.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0a30a8cf07df54ed1fe8079fb90989ae1679edf302baf91ac6a554267e9a020a", + "format": 1 + }, + { + "name": "roles/framework_stop/tasks/get_ashrpt.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6e5b4681e0a6ed26a8ecde6efbc9b76ac069c128309c3a56a6f650cca930843b", + "format": 1 + }, + { + "name": "roles/framework_stop/tasks/run_database_postchecks.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e41502a7828874ac2bd57a5f7db9a7d5e84eeadeddd1a2ad523d498342fc53b4", + "format": 1 + }, + { + "name": "roles/framework_stop/tasks/run_tfactl.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8800dc6a9b7756510a987b78c9aba8c20768ef0edb0452688e5240b2b5b2fd95", + "format": 1 + }, + { + "name": "roles/framework_stop/tasks/get_swingbench.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "80e529c15e25a54b703409db32dfb83d2a785ec881211be7929af3525997c618", + "format": 1 + }, + { + "name": "roles/framework_stop/tasks/get_stats_pack_report.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f4540947c764dfcc2bd089cf1e94aee9f8de2c2418d2e0580e6f8fd3f401242a", + "format": 1 + }, + { + "name": "roles/framework_stop/tasks/get_ExaWatcher_for_node.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "466eb0de5251fff11e56c8d93a84a734f0d6929d6d3288718d49865ee9af8ef9", + "format": 1 + }, + { + "name": "roles/framework_stop/tasks/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "241383fefbeba19004a063af945c48a4b72adc811126fad139e7274328eb822c", + "format": 1 + }, + { + "name": "roles/framework_stop/tests", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_stop/tests/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0aaefe716443e0fc043b0cd267fd5e82b87f34acd21d45fc0b772b1917ff774e", + "format": 1 + }, + { + "name": "roles/framework_stop/tests/inventory", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e02233819b1a09844410549191813f7cc7ba360f21298578f4ba1727a27d87fc", + "format": 1 + }, + { + "name": "roles/framework_stop/meta", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_stop/meta/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4a4e5dee93518028a73456681899af5240cbb424a6082574e0361f9d644e8a36", + "format": 1 + }, + { + "name": "roles/framework_stop/README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cc751d75266f757a38189f15d54e548dc87706f14a39756995c27b49eaca8a07", + "format": 1 + }, + { + "name": "roles/framework_stop/defaults", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_stop/defaults/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c1982eb121f5b034d4934e8111feb58f4cbed3107f826fab2bd55c282c44e6df", + "format": 1 + }, + { + "name": "roles/framework_stop/files", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_stop/files/plotly.result_histogram.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ad75f21c0bdb7182483cd92a932bbd19056e29f48499654abb0ef74ecafabbed", + "format": 1 + }, + { + "name": "roles/framework_stop/files/plotly.sla_aggregate.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f545c337be337e89a2fc1a666d87fd037b68f5baf1a33295c8d41d437ec6e254", + "format": 1 + }, + { + "name": "roles/framework_stop/files/plotly.timeline.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "96fdd7a40beca9cd30ac6eced643911371dafb8e579119d64e5ea3653d36d195", + "format": 1 + }, + { + "name": "roles/framework_stop/files/fanWatcher.java", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "1c2d9abef6eb2d6268fcd0aaf4b646bd3118a3392d338af52610e2d0c276b38c", + "format": 1 + }, + { + "name": "roles/framework_stop/files/blackouts_and_brownouts.sh.new", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b86cc749538967a0d2fe3842d49f2697c7bed05cee9c56fe3f9faafa806e32b2", + "format": 1 + }, + { + "name": "roles/framework_stop/files/plotly.ucpsess.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e9e5353e2dcf5ddced31384305330ad5341c1c069b59ef7848e98fa08758b75b", + "format": 1 + }, + { + "name": "roles/framework_stop/files/plotly.ucpsess copy.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e4d72a5178e2b7fd5c4153c5b0b9fa3d7cab96376c1aea4500f13664c44bb69b", + "format": 1 + }, + { + "name": "roles/framework_stop/files/plotly.sla_tracking.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "92fbcd6198bb2bf6e007de992979ab7cd95962352eae53c27dcef261f35a6ef9", + "format": 1 + }, + { + "name": "roles/framework_stop/files/blackout_brownout_timeline.sh.new", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "af4e471dbb8e77fb34f4eab33b1e62c1cc384360b29c98974c2846e198b7f875", + "format": 1 + }, + { + "name": "roles/framework_stop/files/blackouts_and_brownouts.sh", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "eeb3d9eec09078c7e88aad5a32e7e148145357a1b8c26e774f0f0832df0bc450", + "format": 1 + }, + { + "name": "roles/framework_stop/files/plotly.sla_agg.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b43f51138cd5566daff2eaf6a2a43148e9c76693842dc29846e598babb0544be", + "format": 1 + }, + { + "name": "roles/framework_stop/files/plotly.sla_tracking copy.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "917a585830a0e97dadb4fd061da8a4436d7a701b20392b0464e02938a8c09890", + "format": 1 + }, + { + "name": "roles/framework_stop/files/main.html", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "04847797004e270fc095f93febb5d86153e12b5a65fc15056be240add1ba1f68", + "format": 1 + }, + { + "name": "roles/framework_stop/files/oswbba9013.jar", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ae39dba57aafc6f81c87aac86e32cc9fad8a203847ac965ec961ab002850a50f", + "format": 1 + }, + { + "name": "roles/framework_stop/files/blackout_brownout_timeline.sh", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0d330b6b67f7b95c158e85f96cdb66e11e95e316ff87a95b4d661bcc8ec9692b", + "format": 1 + }, + { + "name": "roles/framework_stop/files/plotly.gg_heartbeat.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "dee0122ee7c43b0e6a754b3615082237bb2ee131dd9e0858fa76e241c9a0aefd", + "format": 1 + }, + { + "name": "roles/framework_stop/files/fanWatcher.class", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "de337a74b90f49af5f0361ffd69ff5c8161790a7ce4e2375f61ae0d25a288925", + "format": 1 + }, + { + "name": "roles/framework_stop/handlers", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_stop/handlers/main.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "b8527593fa224c9f47b7ce17681895cd2f608fd013aeee22b61091ef17ad59e7", + "format": 1 + }, + { + "name": "roles/framework_stop/reports", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "roles/framework_stop/reports/job_report_example.html", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8686f8bd91c1b4e5bfa173b85381b2fe970f837a961980d7e12e45591e70c314", + "format": 1 + }, + { + "name": "playbooks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "playbooks/dbaas.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "fd3d05dd4d47dfd348608e37e78f77ca09b74f79711fefab5d2dc9d2c318556e", + "format": 1 + }, + { + "name": "playbooks/framework.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "0f6928dfe6e6151d1f97d34328415ddf4c45e06b41f2f14312c27d88888e035a", + "format": 1 + }, + { + "name": "playbooks/group_vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "playbooks/group_vars/all", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c893b0ef93eca53d4d7fac2ace521f6f3bd656de0323c834f1baa9f2da3cbeeb", + "format": 1 + }, + { + "name": "playbooks/group_vars/gghservers", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d396222a15dbd5bf72536a2a3bdc2da921c83d02f2d14db7dd68ebf5c3f3e57b", + "format": 1 + }, + { + "name": "playbooks/group_vars/dbservers", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6b953b2cb4b751e381ea5d9bedddf4391740e8bd27c7b21a96e38b5e14d2c850", + "format": 1 + }, + { + "name": "playbooks/group_vars/webservers", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "playbooks/group_vars/sbservers", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3ecea8a2b124fae2681e43cfe2c174bf0d15819c78280ee9061d21c641851bff", + "format": 1 + }, + { + "name": "playbooks/gghub_deploy.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "f4be706b7871894222189f763eeb2dc4ffc48ed92c4f80f57788790d1711a4ba", + "format": 1 + }, + { + "name": "playbooks/test.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "7a22a63ccd1ed4bc4032c7aa4463b3ab08af9b977b382528dbf9ae561cb4ec75", + "format": 1 + }, + { + "name": "playbooks/onboarding.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4cc405234c6a7a1bdb44de8ad8ea5cb17303876f78aeff66c52d0fb96cd782f4", + "format": 1 + }, + { + "name": "playbooks/dbaas_dataguard_configure.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c26ac13d3ca411fd763223c884a228cffac86c8c3f63fa83e3526643bb93fa75", + "format": 1 + }, + { + "name": "playbooks/batch_workload.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9ee9e0b8419d396ffbb752eb00d37cb863a08f53f1db04085be1a219367c68b2", + "format": 1 + }, + { + "name": "playbooks/host_vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "playbooks/gghub_remove.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "33ac3c068bad9423736c3d8e3bc8493eae78ce39651bd982c3fb8b3aba90f05e", + "format": 1 + }, + { + "name": "playbooks/framework_debug.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6adf291eddabf1c93206da08b7e14f2b0cb7b4f912656825e6f2bd2634bd3fc1", + "format": 1 + }, + { + "name": "playbooks/gghub_maa_ha.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "8d3095755d36597e348e88950078359073d28491d58bcea595488e0d0624c900", + "format": 1 + }, + { + "name": "docs", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "docs/.keep", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "docs/docsite", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "docs/docsite/links.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "a4b56c65b6b6d13f7eee1831f7cd52aca7f106360efbf3826b0fcf728173255b", + "format": 1 + }, + { + "name": "MAINTAINERS", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "format": 1 + }, + { + "name": "extensions", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "extensions/eda", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "extensions/eda/rulebooks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "extensions/eda/rulebooks/rulebook.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d3cb7a07af84d8945e1241b026335f0be1704491badd59ee92a34f45f13849e3", + "format": 1 + }, + { + "name": "extensions/molecule", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "extensions/molecule/integration_hello_world", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "extensions/molecule/integration_hello_world/molecule.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e9b6d6c0ec21169208d6df85a0a68adeae39e6a95826a1ef304a12710d617a90", + "format": 1 + }, + { + "name": "extensions/molecule/utils", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "extensions/molecule/utils/vars", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "extensions/molecule/utils/vars/vars.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "001274fbeeea10bc5d2ef7107c395db5c331852c4077987bc6d6711491c60004", + "format": 1 + }, + { + "name": "extensions/molecule/utils/playbooks", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "extensions/molecule/utils/playbooks/noop.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "51116b667ce7190574f19d2fc91c5a80f079955d9b7a05383014c7d58189360d", + "format": 1 + }, + { + "name": "extensions/molecule/utils/playbooks/converge.yml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "67f3b20cd925df4995f4c1a5f6ab97c88df15bd7fc658f0f82a5eb86dca10491", + "format": 1 + }, + { + "name": "changelogs", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": "changelogs/config.yaml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5fa87d90361337514693b4c739d0ee6f9813b8fb976eeb32298c046e2466a9ac", + "format": 1 + }, + { + "name": "README.md", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5da3a81aa94b7aae566307f57e354cbb32a6e940ad87992c785a0a016ecb9369", + "format": 1 + }, + { + "name": "ansible.cfg", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d469f0a7f4fe86f86893f62f60b1aa2267677a5b341f5c102c89754a27b0a9b8", + "format": 1 + }, + { + "name": "tox-ansible.ini", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "da802bfc2dc2671ca7caba028e8a635b459b131874041d119b698717333a7a49", + "format": 1 + }, + { + "name": "CHANGELOG.rst", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "3196c46e0def53bb6d5d49b2521e1c444c2697a228c43324113d08caed889d33", + "format": 1 + }, + { + "name": "maaass", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + } + ], + "format": 1 +} \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/LICENSE b/playbooks/dbaas-ansible-collection/LICENSE new file mode 100644 index 0000000..a118f3e --- /dev/null +++ b/playbooks/dbaas-ansible-collection/LICENSE @@ -0,0 +1,35 @@ +Copyright (c) 2022 Oracle and/or its affiliates. + +The Universal Permissive License (UPL), Version 1.0 + +Subject to the condition set forth below, permission is hereby granted to any +person obtaining a copy of this software, associated documentation and/or data +(collectively the "Software"), free of charge and under any and all copyright +rights in the Software, and any and all patent rights owned or freely +licensable by each licensor hereunder covering either (i) the unmodified +Software as contributed to or provided by such licensor, or (ii) the Larger +Works (as defined below), to deal in both + +(a) the Software, and +(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +one is included with the Software (each a "Larger Work" to which the Software +is contributed by such licensors), + +without restriction, including without limitation the rights to copy, create +derivative works of, display, perform, and distribute the Software and make, +use, sell, offer for sale, import, export, have made, and have sold the +Software and the Larger Work(s), and to sublicense the foregoing rights on +either these or other terms. + +This license is subject to the following condition: +The above copyright notice and either this complete permission notice or at +a minimum a reference to the UPL must be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/MAINTAINERS b/playbooks/dbaas-ansible-collection/MAINTAINERS new file mode 100644 index 0000000..e69de29 diff --git a/playbooks/dbaas-ansible-collection/MANIFEST.json b/playbooks/dbaas-ansible-collection/MANIFEST.json new file mode 100644 index 0000000..656bd66 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/MANIFEST.json @@ -0,0 +1,37 @@ +{ + "collection_info": { + "namespace": "oracle", + "name": "dbaas", + "version": "1.0.0", + "authors": [ + "salasino" + ], + "readme": "README.md", + "tags": [ + "oracle", + "ansible", + "oci", + "oci_ansible", + "dbaas", + "DBaaSCLI", + "DBaaSCA", + "MAA" + ], + "description": "Oracle DBaaS modules provides an easy way to create and provision resources.", + "license": [], + "license_file": "GPL-3.0-or-later, Apache-2.0", + "dependencies": {}, + "repository": "http://example.com/repository", + "documentation": "http://docs.example.com", + "homepage": "http://example.com", + "issues": "http://example.com/issue/tracker" + }, + "file_manifest_file": { + "name": "FILES.json", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "41dd73a1fe95de63e96126ad95230c79a7900a613ce1f9a43eba24421f114d14", + "format": 1 + }, + "format": 1 +} \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/README.md b/playbooks/dbaas-ansible-collection/README.md new file mode 100644 index 0000000..4b1e79a --- /dev/null +++ b/playbooks/dbaas-ansible-collection/README.md @@ -0,0 +1,239 @@ +# Oracle DBaaS Collection + +Oracle dbaas `oracle.dbaas` Ansible Collection provides an easy way to provision and manage resources in Oracle Cloud and on-premises using Ansible. + + + + +## Installation + +### Create a new Python virtual environment + +Ansible is based on Python and leverages many Python modules and plugins. When you test something new, it could require you to update a module that your Ansible installation depends on. Upgrading a component that your production environment depends on defeats the purpose of testing. Still, you can have different versions of Ansible and other important Python modules in a dedicated test directory with a virtual environment. + +Follow one of the following two options: + +* Set up and use Python virtual environments for Ansible (requires a python version >=3.10) +* Install Miniconda + +#### Set up and use Python virtual environments for Ansible + +1) First, verify the installed Python version and path + +```bash +$ python3 -V +``` + +Check Python version + +```bash +Python 3.13.2 +``` + +If python version <3.10, skip this section and move to section 'Install Miniconda'. + +2) Create a directory for the virtual environment + +```bash +mkdir python-venv +cd !$ +``` + +3) Set up Python virtual environments for Ansible + +```bash +pip3 install virtualenv +python3 -m venv dbaas +source dbaas/bin/activate +python3 -m pip install --upgrade pip +``` + +NOTE: See 'How to set up and use Python virtual environments for Ansible' for further information https://www.redhat.com/en/blog/python-venv-ansible + +#### Installing Miniconda: + +1) Run the following four commands to download and install the latest Linux installer for your chosen chip architecture. + +Line by line, these commands: + +* create a new directory named “miniconda3” in your home directory. +* download the Linux Miniconda installation script for your chosen chip architecture and save the script as miniconda.sh in the miniconda3 directory. +* run the miniconda.sh installation script in silent mode using bash. +* remove the miniconda.sh installation script file after installation is complete. + +```bash +mkdir -p ~/miniconda3 +wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh +bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 +rm ~/miniconda3/miniconda.sh +``` + +2) After installing, close and reopen your terminal application or refresh it by running the following command: + +```bash +source ~/miniconda3/bin/activate +``` + +3) Then, initialize conda on all available shells by running the following command: + +```bash +conda init --all +``` + +NOTE: See 'Installing Miniconda' for further information https://www.anaconda.com/docs/getting-started/miniconda/install#linux-terminal-installer + +#### Install dbaas-ansible-collection + +1) Download and extact the zip file with the software + +```bash +unzip dbaas-ansible.zip +``` + +2) Run dbaas_config.sh + +```bash +sh dbaas-ansible-collection/dbaas_config.sh +``` + +Validate the output: + +```bash +Copying ansible.cfg file +Installing dbaas requirements +Installing the ansible dbaas collection +Listing the ansible dbaas collection + +# /scratch/salasino/ansible/collections/ansible_collections +Collection Version +------------ ------- +oracle.dbaas 1.0.0 +``` + +### Included content + + +Playbooks: + 1) oracle.dbaas.onboarding + 2) oracle.dbaas.database + 3) oracle.dbaas.dataguard + 4) oracle.dbaas.framework + + + +Roles: + 1) oracle_facts + 2) database + 3) dataguard + + +## DBaaS Deployment + +### Onboarding + +Set the environment variable DBAAS_ENV to the desired name. + +```bash +export DBAAS_ENV=ocidbs +``` + +Execute the Ansible playbook oracle.dbaas.onboarding and provide the password for Ansible Vault: + +```bash +ansible-playbook oracle.dbaas.onboarding -i collections/ansible_collections/oracle/dbaas/inventory/localhost.yml +``` + +Edit the key file, if required: + +```bash +ansible-vault edit inventory/$DBAAS_ENV.key --ask-vault-password +``` + +Edit the inventory file, if required: + +```bash +vi inventory/$DBAAS_ENV.yml +``` + +Test the inventory file configuration: + +```bash +ansible -i inventory/$DBAAS_ENV.yml all -m setup -a "filter=architecture" +``` + +TIP: + +```bash +export VAULT_PASSWORD=; history -d $(history 1) +ansible-playbook oracle.dbaas.database -i inventory/$DBAAS_ENV.yml -e @inventory/$DBAAS_ENV.ini -e @inventory/$DBAAS_ENV.key --limit $DBAAS_ENV --vault-password-file=./inventory/vault_pass --tags onboarding +``` + +### DBaaS - Create database + +Execute oracle.dbaas.dbaas to create a database: + +```bash +ansible-playbook oracle.dbaas.database -i inventory/$DBAAS_ENV.yml -e @inventory/$DBAAS_ENV.key -e "version=19.25" --limit dbservers --vault-password-file=./inventory/vault_pass --tags database_create,prereqs +``` + +### DBaaS - Create standby database + +Execute oracle.dbaas.dataguard_configure to create a standby database: + +```bash +ansible-playbook oracle.dbaas.dataguard -i inventory/$DBAAS_ENV.yml -e @inventory/$DBAAS_ENV.key --limit dbservers --vault-password-file=./inventory/vault_pass --tags configure,prereqs +``` + +### DBaaS - Delete database + +Execute oracle.dbaas.dbaas to delete a standby database: + +```bash +ansible-playbook oracle.dbaas.database -i inventory/$DBAAS_ENV.yml -e @inventory/$DBAAS_ENV.key --limit dbservers --vault-password-file=./inventory/vault_pass --tags database_delete,standby +``` + +Execute oracle.dbaas.dbaas to delete a primary and standby database: + +```bash +ansible-playbook oracle.dbaas.database -i inventory/$DBAAS_ENV.yml -e @inventory/$DBAAS_ENV.key --limit dbservers --vault-password-file=./inventory/vault_pass --tags database_delete,primary +``` + +## DBaaS without Inventory + +```bash +ansible-playbook oracle.dbaas.database -i '' -e "target=all group_names=dbservers database_list=" --tags oracle_facts +ansible-playbook oracle.dbaas.database -i '' -e "target=all group_names=dbservers database_list= db_unique_name_standby_suffix=stby1" --tags cofigure,prereqs +``` + +## Changes + +See CHANGELOG__. + +__ https://github.com/oracle-samples/maa/blob/main/CHANGELOG.rst + +## Contributing + +oci-cli is an open source project. See CONTRIBUTING__ for details. + +Oracle gratefully acknowledges the contributions to oci-cli that have been made by the community. + +__ https://github.com/oracle-samples/maa/blob/main/CONTRIBUTING.md + +## Roadmap + + + +## Known Issues + +- [oracle-samples/maa/issues](https://github.com/oracle-samples/maa/issues) +- [High Availability Overview and Best Practices - Troubleshooting Oracle GoldenGate](https://docs.oracle.com/en/database/oracle/oracle-database/19/haovw/ogg-troubleshooting1.html) + +## Licensing + +Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + +This SDK and sample is dual licensed under the Universal Permissive License 1.0 and the Apache License 2.0. + +See LICENSE__ for more details. + +__ https://github.com/oracle-samples/maa/blob/main/LICENSE.txt diff --git a/playbooks/dbaas-ansible-collection/ansible.cfg b/playbooks/dbaas-ansible-collection/ansible.cfg new file mode 100644 index 0000000..a3e5e4e --- /dev/null +++ b/playbooks/dbaas-ansible-collection/ansible.cfg @@ -0,0 +1,74 @@ +[defaults] + +forks=50 +host_key_checking = False +pipelining = True + + +# (string) Set the main callback used to display Ansible output. You can only have one at a time. +# result_format = yaml +format_pretty = true + +# (pathspec) Colon-separated paths in which Ansible will search for collections content. Collections must be in nested *subdirectories*, not directly in these directories. +collections_path=./collections + +# Toggle to control displaying skipped task/host results in a task. +display_skipped_hosts = false + +# (boolean) Controls whether callback plugins are loaded when running /usr/bin/ansible. This may be used to log activity from the command line, send notifications, and so on. +bin_ansible_callbacks = True + +# (path) The default root path for Ansible config files on the controller. +home=./ansible + +# (pathlist) Comma-separated list of Ansible inventory sources +inventory=./inventory + +# (tmppath) Temporary directory for Ansible to use on the controller. +local_tmp=/tmp/.ansible/tmp + +# (path) File to which Ansible will log on the controller. When empty logging is disabled. +log_path=./ansible.log + +# (string) The vault_id to use for encrypting by default. If multiple vault_ids are provided, this specifies which to use for encryption. The ``--encrypt-vault-id`` CLI option overrides the configured value. +;vault_encrypt_identity= + +# (string) The label to use for the default vault id label in cases where a vault id label is not provided. +;vault_identity=default + +# (list) A list of vault-ids to use by default. Equivalent to multiple ``--vault-id`` args. Vault-ids are tried in order. +;vault_identity_list= + +# (string) If true, decrypting vaults with a vault id will only try the password from the matching vault-id. +;vault_id_match=False + +# (path) The vault password file to use. Equivalent to ``--vault-password-file`` or ``--vault-id``. +# If executable, it will be run and the resulting stdout will be used as the password. +;vault_password_file= + +remote_user=opc +# callback_whitelist = timer, profile_tasks +callbacks_enabled=ansible.posix.profile_tasks, ansible.posix.timer +# callbacks_enabled=timer, profile_roles +# stdout_callback=community.general.selective +# stdout_callback=ansible.builtin.oneline +# stdout_callback=ansible.builtin.minimal +# stdout_callback=ansible.builtin.default +# stdout_callback=community.general.unixy +# stdout_callback=community.general.diy +# show_per_host_start = true +# show_custom_stats = true +# display_args_to_stdout=True +# interpreter_python=auto_silent +interpreter_python=/opt/oracle.ahf/common/venv/bin/python + +[ssh_connection] +ssh_args = -C -o ControlMaster=auto -o ControlPersist=60m +pipelining=True +gathering = smart +fact_caching = jsonfile +fact_caching_connection = /tmp/cachedir +fact_caching_timeout = 86400 + +[inventory] +enable_plugins = ansible.builtin.host_list, ansible.builtin.yaml, ansible.builtin.ini, auto, advanced_host_list, constructed diff --git a/playbooks/dbaas-ansible-collection/ansible.log b/playbooks/dbaas-ansible-collection/ansible.log new file mode 100644 index 0000000..6fd1473 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/ansible.log @@ -0,0 +1,16 @@ +2025-06-13 03:48:33,103 p=3612672 u=salasino n=ansible WARNING| [WARNING]: * Failed to parse /scratch/salasino/ansible/dbaas-ansible-collection/inventory/vault_pass with +ansible_collections.ansible.builtin.plugins.inventory.yaml plugin: YAML inventory has invalid structure, it should be a dictionary, got: + +2025-06-13 03:48:33,103 p=3612672 u=salasino n=ansible WARNING| [WARNING]: * Failed to parse /scratch/salasino/ansible/dbaas-ansible-collection/inventory/vault_pass with +ansible_collections.ansible.builtin.plugins.inventory.ini plugin: /scratch/salasino/ansible/dbaas-ansible-collection/inventory/vault_pass:2: Expected +key=value host variable assignment, got: os + +2025-06-13 03:48:33,103 p=3612672 u=salasino n=ansible WARNING| [WARNING]: * Failed to parse /scratch/salasino/ansible/dbaas-ansible-collection/inventory/vault_pass with constructed plugin: 'AnsibleUnicode' object +has no attribute 'get' + +2025-06-13 03:48:33,103 p=3612672 u=salasino n=ansible WARNING| [WARNING]: Unable to parse /scratch/salasino/ansible/dbaas-ansible-collection/inventory/vault_pass as an inventory source + +2025-06-13 03:48:33,128 p=3612672 u=salasino n=ansible INFO| @all: + |--@ungrouped: + | |--localhost diff --git a/playbooks/dbaas-ansible-collection/changelogs/config.yaml b/playbooks/dbaas-ansible-collection/changelogs/config.yaml new file mode 100644 index 0000000..24efc8b --- /dev/null +++ b/playbooks/dbaas-ansible-collection/changelogs/config.yaml @@ -0,0 +1,37 @@ +--- +changelog_filename_template: ../CHANGELOG.rst +changelog_filename_version_depth: 0 +changes_file: changelog.yaml +changes_format: combined +keep_fragments: false +mention_ancestor: true +new_plugins_after_name: removed_features +notesdir: fragments +prelude_section_name: release_summary +prelude_section_title: Release Summary +flatmap: true +sections: + - - major_changes + - Major Changes + - - minor_changes + - Minor Changes + - 20250225_gghub_goldengate_deploy - openssl self signed cert runnin on one node only + - 20250225_gghub_software_deploy - create goldengate environment file + - 20250225_gghub_remove - deinstall xag + - 20250225_gghub_deploy.yml - gg_deployment_password confirmation + - - breaking_changes + - Breaking Changes / Porting Guide + - - deprecated_features + - Deprecated Features + - - removed_features + - Removed Features (previously deprecated) + - - security_fixes + - Security Fixes + - - bugfixes + - Bugfixes + - - known_issues + - Known Issues + - - doc_changes + - Documentation Changes +title: "Oracle Dbaas Collection" +trivial_section_name: trivial diff --git a/playbooks/dbaas-ansible-collection/dbaas_config.sh b/playbooks/dbaas-ansible-collection/dbaas_config.sh new file mode 100755 index 0000000..d006561 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/dbaas_config.sh @@ -0,0 +1,16 @@ +#!/bin/bash +if [ ! -d "collections/ansible_collections/oracle/dbaas" ]; then + echo "Copying ansible.cfg file" + cp dbaas-ansible-collection/ansible.cfg . + echo "Installing dbaas requirements" + python3 -m pip install -r dbaas-ansible-collection/requirements.txt > /dev/null 2>&1 + echo "Installing the ansible dbaas collection" + ansible-galaxy collection install dbaas-ansible-collection -p ./collections > /dev/null 2>&1 + echo "Listing the ansible dbaas collection" + ansible-galaxy collection list oracle.dbaas +else + echo "Upgrading the ansible dbaas collection" + ansible-galaxy collection install dbaas-ansible-collection -p ./collections --upgrade + echo "Listing the ansible dbaas collection" + ansible-galaxy collection list oracle.dbaas +fi diff --git a/playbooks/dbaas-ansible-collection/devfile.yaml b/playbooks/dbaas-ansible-collection/devfile.yaml new file mode 100644 index 0000000..6937a7f --- /dev/null +++ b/playbooks/dbaas-ansible-collection/devfile.yaml @@ -0,0 +1,15 @@ +schemaVersion: 2.2.2 +metadata: + name: ansible-demo +components: + - name: tooling-container + container: + image: ghcr.io/ansible/ansible-workspace-env-reference:latest + memoryRequest: 256M + memoryLimit: 6Gi + cpuRequest: 250m + cpuLimit: 2000m + args: ["tail", "-f", "/dev/null"] + env: + - name: KUBEDOCK_ENABLED + value: "true" diff --git a/playbooks/dbaas-ansible-collection/docs/.keep b/playbooks/dbaas-ansible-collection/docs/.keep new file mode 100644 index 0000000..e69de29 diff --git a/playbooks/dbaas-ansible-collection/docs/docsite/links.yml b/playbooks/dbaas-ansible-collection/docs/docsite/links.yml new file mode 100644 index 0000000..8498d68 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/docs/docsite/links.yml @@ -0,0 +1,47 @@ +--- +# This will make sure that plugin and module documentation gets Edit on GitHub links +# that allow users to directly create a PR for this plugin or module in GitHub's UI. +# Remove this section if the collection repository is not on GitHub, or if you do not +# want this functionality for your collection. +edit_on_github: + # TO-DO: Update this if your collection lives in a different GitHub organization. + repository: ansible-collections/oracle.dbaas + branch: main + # If your collection root (the directory containing galaxy.yml) does not coincide with your + # repository's root, you have to specify the path to the collection root here. For example, + # if the collection root is in a subdirectory ansible_collections/community/REPO_NAME + # in your repository, you have to set path_prefix to 'ansible_collections/community/REPO_NAME'. + path_prefix: "" + +# Here you can add arbitrary extra links. Please keep the number of links down to a +# minimum! Also please keep the description short, since this will be the text put on +# a button. +# +# Also note that some links are automatically added from information in galaxy.yml. +# The following are automatically added: +# 1. A link to the issue tracker (if `issues` is specified); +# 2. A link to the homepage (if `homepage` is specified and does not equal the +# `documentation` or `repository` link); +# 3. A link to the collection's repository (if `repository` is specified). + +extra_links: + - description: Report an issue + # TO-DO: Update this if your collection lives in a different GitHub organization. + url: https://github.com/ansible-collections/oracle.dbaas/issues/new/choose + +# Specify communication channels for your collection. We suggest to not specify more +# than one place for communication per communication tool to avoid confusion. +communication: + matrix_rooms: + - topic: General usage and support questions + room: "#users:ansible.im" + irc_channels: + - topic: General usage and support questions + network: Libera + channel: "#ansible" + mailing_lists: + - topic: Ansible Project List + url: https://groups.google.com/g/ansible-project + # You can also add a `subscribe` field with an URI that allows to subscribe + # to the mailing list. For lists on https://groups.google.com/ a subscribe link is + # automatically generated. diff --git a/playbooks/dbaas-ansible-collection/inventory/localhost.yml b/playbooks/dbaas-ansible-collection/inventory/localhost.yml new file mode 100644 index 0000000..2302eda --- /dev/null +++ b/playbooks/dbaas-ansible-collection/inventory/localhost.yml @@ -0,0 +1 @@ +localhost ansible_connection=local diff --git a/playbooks/dbaas-ansible-collection/inventory/vault_pass b/playbooks/dbaas-ansible-collection/inventory/vault_pass new file mode 100755 index 0000000..c57caa1 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/inventory/vault_pass @@ -0,0 +1,3 @@ +#!/usr/bin/env python3 +import os +print(os.environ['VAULT_PASSWORD']) diff --git a/playbooks/dbaas-ansible-collection/meta/runtime.yml b/playbooks/dbaas-ansible-collection/meta/runtime.yml new file mode 100644 index 0000000..8cf8748 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/meta/runtime.yml @@ -0,0 +1,3 @@ +--- +requires_ansible: ">=2.15.0" + diff --git a/playbooks/dbaas-ansible-collection/playbooks/.DS_Store b/playbooks/dbaas-ansible-collection/playbooks/.DS_Store new file mode 100644 index 0000000..9ac84b1 Binary files /dev/null and b/playbooks/dbaas-ansible-collection/playbooks/.DS_Store differ diff --git a/playbooks/dbaas-ansible-collection/playbooks/batch_workload.yml b/playbooks/dbaas-ansible-collection/playbooks/batch_workload.yml new file mode 100644 index 0000000..5323848 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/batch_workload.yml @@ -0,0 +1,26 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- hosts: '{{target|default("dbservers")}}' + + vars_prompt: + - name: db_sys_password + prompt: Enter DB_SYS_PASSWORD + unsafe: true + private: true + + collections: + - oracle.dbaas + + roles: + - get_oracle_facts + - batch_workload diff --git a/playbooks/dbaas-ansible-collection/playbooks/database.yml b/playbooks/dbaas-ansible-collection/playbooks/database.yml new file mode 100644 index 0000000..16699f6 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/database.yml @@ -0,0 +1,30 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- hosts: "{{ target | default('dbservers')}}" + gather_facts: false + + vars_prompt: + - name: db_sys_password + prompt: Enter db_sys_password + unsafe: true + private: true + confirm: true + + collections: + - oracle.dbaas + + roles: + - oracle_facts + - database + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/playbooks/dataguard.yml b/playbooks/dbaas-ansible-collection/playbooks/dataguard.yml new file mode 100644 index 0000000..fd251cf --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/dataguard.yml @@ -0,0 +1,48 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- hosts: '{{target|default("dbservers")}}' + + vars: + valid_ansible_run_tags: + - oracle_facts + - prereqs + - primary_prepare + - standby_configure + - configure + + vars_prompt: + - name: db_sys_password + prompt: DB_SYS_PASSWORD + unsafe: true + private: true + + collections: + - oracle.dbaas + + pre_tasks: + + - name: Ansible run tags validation + ansible.builtin.assert: + quiet: true + that: item in (valid_ansible_run_tags) + fail_msg: Unrecognized Ansible tags {{ ansible_run_tags|join(',') }}. Valid Ansible tags are {{ valid_ansible_run_tags|join(',') }}. + with_items: "{{ ansible_run_tags|lower }}" + run_once: true + delegate_to: localhost + tags: always + + roles: + - oracle_facts + - dataguard + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/playbooks/dbaas_prereqs.yml b/playbooks/dbaas-ansible-collection/playbooks/dbaas_prereqs.yml new file mode 100644 index 0000000..ec0933f --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/dbaas_prereqs.yml @@ -0,0 +1,21 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- hosts: '{{target|default("dbservers")}}' + + collections: + - oracle.dbaas + + roles: + - dbaas_prereqs + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/playbooks/framework.yml b/playbooks/dbaas-ansible-collection/playbooks/framework.yml new file mode 100644 index 0000000..efc3841 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/framework.yml @@ -0,0 +1,49 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# This playbook uses the following additional variables which should be configured at run time for the template: +# db_name: oradb1,oradb2,oradb +# db_sys_password: + +- name: MAAaaS Framework + hosts: all + order: sorted + gather_facts: true + + vars_prompt: + - name: database_list + prompt: Oracle - Enter the list of databases (comma separated) + private: false + - name: db_sys_password + prompt: Password - Enter the password for user SYS ([8=>length<=30][A-Z][a-z][0-9][-!@%&*.#]) + # default: "{{ vault_gg_deployment_password | default(lookup('ansible.builtin.password', '/dev/null', chars=['ascii_lowercase', 'ascii_uppercase', 'digits', '[-!@%&*.#]'], length=20)) }}G*1w" + private: true + unsafe: true + confirm: true + + collections: + - ansible.builtin + - community.general + - oracle.dbaas + + roles: + # Before + - framework_start + + # Actions + # - dbaas_dataguard_configure + - dbaas + + # After + - framework_stop + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/playbooks/framework_debug.yml b/playbooks/dbaas-ansible-collection/playbooks/framework_debug.yml new file mode 100644 index 0000000..6740071 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/framework_debug.yml @@ -0,0 +1,26 @@ +--- +# file: framework.yml + +- name: MAAaaS Framework + hosts: all + order: sorted + gather_facts: false + collections: + - ansible.builtin + - community.general + - oracle.dbaas + + roles: + # Before + - get_host_facts + - get_oracle_facts + - framework_pre_task + - framework_start + # # Actions + # - dbaas_dataguard_configure + # - dbaas + # # - gghub_maa_ha + # # After + # - get_oracle_facts + - framework_stop + - framework_post_task \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/playbooks/group_vars/.DS_Store b/playbooks/dbaas-ansible-collection/playbooks/group_vars/.DS_Store new file mode 100644 index 0000000..c026b7c Binary files /dev/null and b/playbooks/dbaas-ansible-collection/playbooks/group_vars/.DS_Store differ diff --git a/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/environment.yml b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/environment.yml new file mode 100644 index 0000000..90280b1 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/environment.yml @@ -0,0 +1,73 @@ +# dbservers + +system_config: + inventory_loc: "{{ oracle_facts | community.general.json_query('system.db_name') }}" + dbaascli_on: "{{ oracle_facts | community.general.json_query('system.dbaascli_on') }}" + crs_on: "{{ oracle_facts | community.general.json_query('system.crs_on') }}" + oracle_ahf_loc: "{{ oracle_facts | community.general.json_query('system.oracle_ahf_loc') }}" + +grid_config: + active_version: "{{ oracle_facts | community.general.json_query('grid.activeVersion') }}" + state: "{{ oracle_facts | community.general.json_query('grid.state') }}" + oracle_home: "{{ oracle_facts.grid.oracle_home }}" + scan_name: "{{ oracle_facts | community.general.json_query('grid.scan_name') }}" + scan_ips: "{{ oracle_facts | community.general.json_query('grid.scan_ips') }}" + cluster_nodes: "{{ oracle_facts | community.general.json_query('grid.cluster_nodes') }}" + master_node: "{{ (oracle_facts | community.general.json_query('grid.cluster_nodes') | split(',')) | intersect(ansible_play_hosts | map('extract', hostvars, 'ansible_hostname')) | sort | first }}" + instanceName: "+ASM{{ ansible_hostname[-1] }}" + +database_config: + db_name: "{{ oracle_facts | community.general.json_query(db_name+'.db_name') }}" + db_unique_name: "{{ oracle_facts | community.general.json_query(db_name+'.db_unique_name') }}" + db_role: "{{ oracle_facts | community.general.json_query(db_name+'.db_role') }}" + # cdb_connectString: "{{ oracle_facts[db_name].db_unique_name }}.{{ oracle_facts[db_name].dbDomain }}" + oracle_home: "{{ oracle_facts | community.general.json_query(db_name+'.oracle_home') }}" + oracle_base: "{{ oracle_facts | community.general.json_query(db_name+'.oracle_home') }}" + # oracle_base: "{{ oracle_facts[db_name].oracle_home | default('not_defined/a/b/c') | dirname | dirname | dirname }}" + instance_name: "{{ oracle_facts | community.general.json_query(db_name+'.instance_name') }}" + db_domain: "{{ oracle_facts | community.general.json_query(db_name+'.db_domain') }}" + db_type: "{{ oracle_facts | community.general.json_query(db_name+'.db_type') }}" + dg_on: "{{ oracle_facts | community.general.json_query(db_name+'.dg_on') }}" + # isCDB: "{{ oracle_facts[db_name].isCDB }}" + oracle_home_version: "{{ oracle_facts | community.general.json_query(db_name+'.oracle_home_version') }}" + flashback_on: "{{ oracle_facts | community.general.json_query(db_name+'.flashback_on') }}" + force_logging_on: "{{ oracle_facts | community.general.json_query(db_name+'.force_logging_on') }}" + # master_node: "{% if oracle_facts.system.dbaascli is true %}{{ (oracle_facts[db_name].dbNodeLevelDetails | dict2items | community.general.json_query('[?value.status!=`Not running`].key')) | intersect(ansible_play_hosts | map('extract', hostvars, 'ansible_hostname') ) | sort | first }}{% else %}{{ oracle_facts[db_name].master_node }}{% endif %}" + master_node: "{{ oracle_facts | community.general.json_query(db_name+'.master_node') }}" + # master_node: "{{ grid_config.master_node }}" + tde_on: "{{ oracle_facts | community.general.json_query(db_name+'.tde_on') }}" + wallet_root: "{{ oracle_facts | community.general.json_query(db_name+'.wallet_root') }}" + # pdbs: "{{ oracle_facts[db_name].pdbs }}" + pga_aggregate_target: "{{ oracle_facts | community.general.json_query(db_name+'.pga_aggregate_target') }}" + processes: "{{ oracle_facts | community.general.json_query(db_name+'.processes') }}" + sga_target: "{{ oracle_facts | community.general.json_query(db_name+'.sga_target') }}" + db_recovery_file_dest_size: "{{ oracle_facts | community.general.json_query(db_name+'.db_recovery_file_dest_size') }}" + +pdb_config: + connectString: "{{ oracle_facts[db_name].pdbs[pdb_name] | community.general.json_query('pdbConnectStrings[*].connectString') | first }}" + serviceName: "{{ oracle_facts[db_name].pdbs[pdb_name] | community.general.json_query('pdbConnectStrings[*].serviceName') | first }}" + +# @var grid_env:description: > +# The variable is used for shell, command tasks to set environment Variables. +# +# Do not set it in inventory! +# @end + +grid_env: + PATH: "/sbin:/bin:/usr/sbin:/usr/bin:{{ grid_config.oracle_home }}/bin:{{ grid_config.oracle_home }}/OPatch" + ORACLE_SID: "{{ grid_config.instanceName }}" + ORACLE_HOSTNAME: "{{ ansible_hostname }}" + LD_LIBRARY_PATH: "{{ grid_config.oracle_home }}/lib" + OH: "{{ grid_config.oracle_home }}" + ORACLE_HOME: "{{ grid_config.oracle_home }}" + +oracle_env: + PATH: "{{ database_config.oracle_home }}/bin:{{ database_config.oracle_home }}/OPatch:$PATH" + ORACLE_UNQNAME: "{{ database_config.db_unique_name }}" + ORACLE_SID: "{{ database_config.instance_name }}" + ORACLE_HOSTNAME: "{{ ansible_hostname }}" + LD_LIBRARY_PATH: "{{ database_config.oracle_home }}/lib" + ORACLE_BASE: "{{ database_config.oracle_home }}" + OH: "{{ database_config.oracle_home }}" + ORACLE_HOME: "{{ database_config.oracle_home }}" + # TNS_ADMIN: "{{ database_config.oracle_home }}/network/admin/{{ db_name }}" \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/files.yml b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/files.yml new file mode 100644 index 0000000..e516724 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/files.yml @@ -0,0 +1,5 @@ +dbservers_files: + - { name: "dbaascli" , path: "/usr/bin/dbaascli" } + - { name: "ahf" , path: "/etc/oracle.ahf.loc" } + - { name: "olr" , path: "/etc/oracle/olr.loc" } + - { name: "oraInst" , path: "/etc/oraInst.loc" } \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/main.yml b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/main.yml new file mode 100644 index 0000000..6e18d5c --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/main.yml @@ -0,0 +1,36 @@ +--- + +# dbservers + +cdb_service_name: "{{ oracle_facts[db_name].dbNodeLevelDetails[ansible_hostname].cdb_service_name }}" + +# @var _db_unique_name_for_pdb:description: > +# The variable is internal used only. +# +# Do not set it in inventory! +# +# get db_unique_name from CDB for current pdb +# Requires `opdb` as `loop_var`. +# @end +# @var _db_unique_name_for_pdb: $ "_internal_used_" +# _db_unique_name_for_pdb: >- +# {{ (db_name +# | selectattr('oracle_db_name', 'equalto', _opdb_loop_helper['cdb']) +# | map(attribute='oracle_db_unique_name', default=_opdb_loop_helper['cdb']))[0] +# }} + +# Defaults + +# primary_node: "{{ vars[db_name + '_primary_node'] }}" +# standby_node: "{{ vars[db_name + '_standby_node'] }}" +# db_ezconnect: "sys/{{ db_sys_password }}@{{ grid_config.scan_name }}:{{ grid_config.scanListenerTCPPorts }}/{{ database_config.db_unique_name }}.{{ database_config.dbDomain }} as sysdba" +pdb_name: "{{ db_name|upper }}P{{ pdbNumber | default(1) }}" + +# Oracle database list +# +db_name_list: "{{ database_list | split(',') }}" + +# DB Passwords +db_sys_user: sys +db_tde_password: "{{ db_sys_password }}" +awr_admin_password: "{{ db_sys_password }}" diff --git a/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/programs.yml b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/programs.yml new file mode 100644 index 0000000..a7db541 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/programs.yml @@ -0,0 +1,14 @@ +# Oracle Home +## Oracle +dbca: "{{ database_config.oracle_home }}/bin/dbca" +oracle_srvctl: "{{ database_config.oracle_home }}/bin/srvctl" +oracle_sqlplus: "{{ database_config.oracle_home }}/bin/sqlplus" + +# Grid +grid_srvctl: "{{ grid_config.oracle_home }}/bin/srvctl" +grid_crsctl: "{{ grid_config.oracle_home }}/bin/srvctl" +grid_listener: "{{ grid_config.oracle_home }}/bin/lsnrctl" + +# DBaaS Tools +dbaasca: /var/opt/oracle/dbaastools/dbaasca/bin/dbca +pilot: /opt/oracle/pilot/bin/pilot \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/sql_commands.yml b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/sql_commands.yml new file mode 100644 index 0000000..e35ac10 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/sql_commands.yml @@ -0,0 +1,25 @@ +sql_flashback_on: "alter database flashback on;" +sql_flashback_off: "alter database flashback off;" +sql_force_logging: "alter database force logging;" +sql_db_parameters: | + select name,value + from v$parameter + where name in ( 'cluster_database_instances', + 'instance_name', + 'db_domain', + 'db_name', + 'db_unique_name', + 'processes', + 'pga_aggregate_target', + 'sga_target', + 'db_recovery_file_dest_size', + 'wallet_root' + ); +sql_db_options: | + select open_mode, + flashback_on, + database_role, + DATAGUARD_BROKER, + GUARD_STATUS, + FORCE_LOGGING + from v$database; \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/system.yml b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/system.yml new file mode 100644 index 0000000..6293854 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/system.yml @@ -0,0 +1,30 @@ +# dbservers + +system_config: + inventory_loc: "{{ oracle_facts | community.general.json_query('system.db_name') }}" + dbaascli_on: "{{ oracle_facts | community.general.json_query('system.dbaascli_on') }}" + crs_on: "{{ oracle_facts | community.general.json_query('system.crs_on') }}" + oracle_ahf_loc: "{{ oracle_facts | community.general.json_query('system.oracle_ahf_loc') }}" + +grid_config: + active_version: "{{ oracle_facts | community.general.json_query('grid.activeVersion') }}" + state: "{{ oracle_facts | community.general.json_query('grid.state') }}" + oracle_home: "{{ oracle_facts.grid.oracle_home }}" + scan_name: "{{ oracle_facts | community.general.json_query('grid.scan_name') }}" + scan_ips: "{{ oracle_facts | community.general.json_query('grid.scan_ips') }}" + cluster_nodes: "{{ oracle_facts | community.general.json_query('grid.cluster_nodes') }}" + master_node: "{{ (oracle_facts | community.general.json_query('grid.cluster_nodes') | split(',')) | intersect(ansible_play_hosts | map('extract', hostvars, 'ansible_hostname')) | sort | first }}" + instanceName: "+ASM{{ ansible_hostname[-1] }}" + +# @var grid_env:description: > +# The variable is used for shell, command tasks to set environment Variables. +# +# Do not set it in inventory! +# @end +grid_env: + PATH: "/sbin:/bin:/usr/sbin:/usr/bin:{{ grid_config.oracle_home }}/bin:{{ grid_config.oracle_home }}/OPatch" + ORACLE_SID: "{{ grid_config.instanceName }}" + ORACLE_HOSTNAME: "{{ ansible_hostname }}" + LD_LIBRARY_PATH: "{{ grid_config.oracle_home }}/lib" + OH: "{{ grid_config.oracle_home }}" + ORACLE_HOME: "{{ grid_config.oracle_home }}" \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/users.yml b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/users.yml new file mode 100644 index 0000000..3870a4a --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/dbservers/users.yml @@ -0,0 +1,8 @@ +# Oracle database OS user (sqlplus, rman, srvctl). +# +oracle_user: oracle +oracle_group: oinstall + +# Oracle Grid Infrastructure OS user (asmcmd, crsctl, srvctl). +# +grid_user: grid \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/directories.yml b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/directories.yml new file mode 100644 index 0000000..1550719 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/directories.yml @@ -0,0 +1,20 @@ +# Stage directory +# +ansible_base_control: /scratch/salasino/ansible +ansible_base_managed: /u01/ansible +stage_dir: + control: + base: "{{ ansible_base_control }}" + software: "{{ ansible_base_control }}/software" + app: "{{ ansible_base_control }}/app" + tmp: "{{ ansible_base_control }}/tmp" + # workdir: "{{ ansible_base_control }}/logs/{{ ansible_limit }}/{{ time_stamp_start }}_{{ use_case }}" + managed: + base: "{{ ansible_base_managed }}" + software: "{{ ansible_base_managed }}/software" + app: "{{ ansible_base_managed }}/app" + tmp: "{{ ansible_base_managed }}/tmp" + # workdir: "{{ ansible_base_managed }}/logs/{{ ansible_limit }}/{{ time_stamp_start }}_{{ use_case }}" + +# DBaaS Tools +reg_tmp_files: /var/opt/oracle/log/reg_tmp_files \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/lium.yml b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/lium.yml new file mode 100644 index 0000000..ec82d24 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/lium.yml @@ -0,0 +1,25 @@ +--- +# License Information User Manual + +# Set the minimum version required +oracle_ansible_version: 2.18 +oracle_jinja2_version: 3.1 +oracle_jmespath_version: 1.0 +oracle_pexpect_versioin: 4.9 +oracle_xmltodict_version: 0.14 +oracle_python_version: 3.12 +oracle_grid_infrastructure: 19 + +# Operating System Checklist for Oracle Grid Infrastructure and Oracle RAC +# https://docs.oracle.com/en/database/oracle/oracle-database/19/cwlin/operating-system-checklist-for-oracle-grid-infrastructure-and-oracle-rac.html +oracle_supported_distributions: + oraclelinux: + name: Oracle Linux + versions: [7, 8, 9] + architectures: [x86_64] + redhat: + name: Red Hat Enterprise Linux + versions: [7, 8, 9] + architectures: [x86_64] + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/main.yml b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/main.yml new file mode 100644 index 0000000..e4942da --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/group_vars/all/main.yml @@ -0,0 +1,64 @@ +--- +# Swingbench user +swingbench_user: opc +swingbench_group: opc +jdk: + url: "https://download.oracle.com/java/24/latest/jdk-24_linux-x64_bin.tar.gz" + checksum: "sha256:f04a4421519b9719ac96078e16af1ff0bbbfdbda7481b8ad573d75b5b6cd50b1" + home: "{{ stage_dir.managed.app }}/{{ swingbench_version | default(hostvars['localhost']['swingbench_version']) | default() }}/jdk" + +swingbench: + owner: "{{ swingbench_user }}" + group: "{{ swingbench_group }}" + base: "{{ stage_dir.managed.app }}/{{ swingbench_version | default(hostvars['localhost']['swingbench_version']) | default() }}" + home: "{{ stage_dir.managed.app }}/{{ swingbench_version | default(hostvars['localhost']['swingbench_version']) | default() }}/swingbench" + scale: 2 + number_pdbs: "{{ number_pdbs | default(1) }}" + xml_file_rw: "{{ swingbench_xml_file_rw | default('swingbench_oltpmix_template.xml') }}" + xml_file_ro: "{{ swingbench_xml_file_ro | default('swingbench_oltpmixro_template.xml') }}" + NumberOfUsers: "{{ swingbench_NumberOfUsers | default(10) | int }}" + PooledMaxLimit: "{{ swingbench_PooledMaxLimit | default(10 * 2 ) }}" + delay: "{{ swingbench_delay | default(10) }}" + inter_delay: "{{ swingbench_inter_delay | default(10) }}" + soe_password_enc: "{{ db_sys_password }}" + server: "{{ groups['sbservers'][0] }}" + connection_pooling: "{{ swingbench_connection_pooling | default(true) }}" + +# Ansible +main_html: "{{ ansible_base }}/logs/{{ ansible_limit }}/main.html" +sysdate: "{{ '%Y-%m-%dT%H:%M:%S%z' | strftime( now(utc=false).strftime('%s') ) }}" +use_case: test +time_stamp_start: "{{ ansible_date_time.epoch | int }}" +swingbench_server: "{{ groups['sbservers'][0] }}" +silent: false +minimum_distribution_major_version: 8 +force_facts_timestamp: 86400 # epoch 86400 = 1 day + +# Runtime +run_time: 1m +run_time_sec: "{{ run_time | community.general.to_seconds | int }}" +stabilizing_pause: 1m +stabilizing_pause_sec: "{{ stabilizing_pause | community.general.to_seconds | int }}" +before_task_pause: 1m +before_task_pause_sec: "{{ before_task_pause | community.general.to_seconds | int }}" +inter_task_pause: 1m +inter_task_pause_sec: "{{ inter_task_pause | community.general.to_seconds | int }}" +run_time_total_sec: "{{ run_time_sec|int + stabilizing_pause_sec|int + 60 }}" +swingbench_run_time: "{{ '%H:%M' | strftime( run_time_total_sec|int , utc=true ) }}" +statistics_time_begin: "{{ '%H:%M' | strftime( stabilizing_pause_sec|int , utc=true ) }}" +statistics_time_ends: "{{ '%H:%M' | strftime( run_time_sec|int + stabilizing_pause_sec|int , utc=true ) }}" +reiteration: 1 +run_swingbench_rw: "{{ vars[db_name + '_run_swingbench_rw'] }}" +run_swingbench_ro: "{{ vars[db_name + '_run_swingbench_ro'] }}" + +blackout_yellow_sec: 1 +blackout_red_sec: 2 +brownout_yellow_sec: 5 +brownout_red_sec: 10 +StdDeviation_yellow: 5 +StdDeviation_red: 10 +Kurtosis_yellow: 2500 +Kurtosis_red: 3000 +Skewness_yellow: 50 +Skewness_red: 100 +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/playbooks/group_vars/sbservers.yml b/playbooks/dbaas-ansible-collection/playbooks/group_vars/sbservers.yml new file mode 100644 index 0000000..6595c21 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/group_vars/sbservers.yml @@ -0,0 +1,13 @@ +run_time: 1m +run_time_sec: "{{ run_time | community.general.to_seconds | int }}" +stabilizing_pause: 1m +stabilizing_pause_sec: "{{ stabilizing_pause | community.general.to_seconds | int }}" +before_task_pause: 1m +before_task_pause_sec: "{{ before_task_pause | community.general.to_seconds | int }}" +inter_task_pause: 1m +inter_task_pause_sec: "{{ inter_task_pause | community.general.to_seconds | int }}" +run_time_total_sec: "{{ run_time_sec|int + stabilizing_pause_sec|int + 60 }}" +swingbench_run_time: "{{ '%H:%M' | strftime( run_time_total_sec|int , utc=true ) }}" +statistics_time_begin: "{{ '%H:%M' | strftime( stabilizing_pause_sec|int , utc=true ) }}" +statistics_time_ends: "{{ '%H:%M' | strftime( run_time_sec|int + stabilizing_pause_sec|int , utc=true ) }}" +reiteration: 1 \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/playbooks/onboarding.yml b/playbooks/dbaas-ansible-collection/playbooks/onboarding.yml new file mode 100644 index 0000000..15ba956 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/playbooks/onboarding.yml @@ -0,0 +1,172 @@ +--- +# +# Oracle DBaaS Onboarding +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# This playbook uses the following additional variables which should be configured at run time for the template: +# db_name: oradb1,oradb2,oradb +# db_sys_password: + +- hosts: all + gather_facts: true + vars_prompt: + - name: database_list + prompt: Oracle - Enter the list of databases (comma separated) + private: false + - name: ansible_environment_name + prompt: Ansible - Enter the Ansible environment name + private: false + - name: ansible_remote_user_target + prompt: Ansible - Sets the login user for the target machines + default: opc + private: false + - name: ansible_python_interpreter_target + prompt: Ansible - Sets the ansible_python_interpreter for the target machines + default: /opt/oracle.ahf/common/venv/bin/python + private: false + - name: ansible_inventory_dir + prompt: Ansible - Enter the Ansible inventory full path directory + default: "{{ lookup('ansible.builtin.env', 'PWD') }}/inventory" + private: false + - name: vault_secret + prompt: Password - Enter the password for Ansible Vault ([8=>length<=30][A-Z][a-z][0-9]) + # default: "{{ lookup('ansible.builtin.password', '/dev/null', chars=['ascii_lowercase', 'ascii_uppercase', 'digits'], length=10) }}" + private: true + confirm: true + - name: db_sys_password + prompt: Password - Enter the password for user SYS ([8=>length<=30][A-Z][a-z][0-9][-!@%&*.#]) + # default: "{{ vault_gg_deployment_password | default(lookup('ansible.builtin.password', '/dev/null', chars=['ascii_lowercase', 'ascii_uppercase', 'digits', '[-!@%&*.#]'], length=20)) }}G*1w" + private: true + unsafe: true + confirm: true + + tasks: + + - name: Vault config + delegate_to: localhost + run_once: true + block: + + - name: Include only files matching dbservers.yml + ansible.builtin.include_vars: + dir: group_vars + files_matching: dbservers.yml + + - name: Assert Ansible Vault password + ansible.builtin.assert: + that: + - vault_secret | length >= 8 + - vault_secret | length <= 30 + - vault_secret | regex_search('[0-9]') + - vault_secret | regex_search('[a-z]') + - vault_secret | regex_search('[A-Z]') + fail_msg: + - "Ansible Vault password is not strong." + - "The strong password policy has the following requirements:" + - " * At least one lowercase character [a...z]" + - " * At least one upposercase character [A...Z]" + - " * At least one digit [0...9]" + - " * The length should be between 8 and 30 characters." + success_msg: "GoldenGate deployment password accepted" + + - name: Assert SYS password + ansible.builtin.assert: + that: + - db_sys_password | length >= 8 + - db_sys_password | length <= 30 + - db_sys_password | regex_search('[0-9]') + - db_sys_password | regex_search('[a-z]') + - db_sys_password | regex_search('[A-Z]') + - db_sys_password | select('search', regex) + fail_msg: + - "Oracle database SYS password is not strong." + - "The strong password policy has the following requirements:" + - " * At least one lowercase character [a...z]" + - " * At least one upposercase character [A...Z]" + - " * At least one digit [0...9]" + - " * At least one special character [- ! @ % & * . #]" + - " * The length should be between 8 and 30 characters." + success_msg: "Oracle SYS password accepted" + vars: + PATTERNS: + - '\-' + - '\!' + - '\@' + - '\%' + - '\&' + - '\*' + - '\.' + - '\#' + - '\_' + regex: "{{ PATTERNS | join('|') }}" + + - name: Create inventory directory + file: + path: "{{ ansible_inventory_dir }}" + state: directory + + - name: Create inventory file + copy: + dest: "{{ ansible_inventory_dir }}/{{ ansible_environment_name }}.yml" + content: | + dbservers: + children: + siteA: + hosts: + hostA1: + ansible_host: + hostA2: + ansible_host: + vars: + ansible_python_interpreter: {{ ansible_python_interpreter_target }} + ansible_remote_user: {{ ansible_remote_user_target }} + siteB: + hosts: + hostB1: + ansible_host: + hostB2: + ansible_host: + vars: + ansible_python_interpreter: {{ ansible_python_interpreter_target }} + ansible_remote_user: {{ ansible_remote_user_target }} + vars: + database_list: "{{ database_list }}" + + - name: Create vault_pass file + ansible.builtin.copy: + dest: "{{ ansible_inventory_dir }}/vault_pass" + backup: true + mode: u=rwx,g=,o= + content: | + #!/usr/bin/env python3 + import os + print(os.environ['VAULT_PASSWORD']) + + - name: Create sensitive data file + ansible.builtin.copy: + dest: "{{ ansible_inventory_dir }}/{{ ansible_environment_name }}.key" + backup: true + mode: u=rw,g=,o= + content: | + db_sys_password: "{{ db_sys_password }}" + vault_secret: {{ vault_secret }} + when: + - db_sys_password | length > 0 + - vault_secret | length > 0 + register: sensitive_data_file + + - name: Vault encrypt sensitive data file + expect: + command: "ansible-vault encrypt {{ ansible_inventory_dir }}/{{ ansible_environment_name }}.key --ask-vault-password" + responses: + New Vault password: "{{ vault_secret }}" + Confirm New Vault password: "{{ vault_secret }}" + when: sensitive_data_file is success + diff --git a/playbooks/dbaas-ansible-collection/plugins/.DS_Store b/playbooks/dbaas-ansible-collection/plugins/.DS_Store new file mode 100644 index 0000000..0b44c51 Binary files /dev/null and b/playbooks/dbaas-ansible-collection/plugins/.DS_Store differ diff --git a/playbooks/dbaas-ansible-collection/plugins/action/__init__.py b/playbooks/dbaas-ansible-collection/plugins/action/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/playbooks/dbaas-ansible-collection/plugins/cache/__init__.py b/playbooks/dbaas-ansible-collection/plugins/cache/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/playbooks/dbaas-ansible-collection/plugins/filter/__init__.py b/playbooks/dbaas-ansible-collection/plugins/filter/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/playbooks/dbaas-ansible-collection/plugins/filter/hello_world.py b/playbooks/dbaas-ansible-collection/plugins/filter/hello_world.py new file mode 100644 index 0000000..9a6452e --- /dev/null +++ b/playbooks/dbaas-ansible-collection/plugins/filter/hello_world.py @@ -0,0 +1,58 @@ +"""A hello-world filter plugin in oracle.dbaas.""" + +from __future__ import absolute_import, annotations, division, print_function + + +__metaclass__ = type # pylint: disable=C0103 + +from typing import TYPE_CHECKING + + +if TYPE_CHECKING: + from typing import Callable + + +DOCUMENTATION = """ + name: hello_world + author: Oracle Dbaas + version_added: "1.0.0" + short_description: Demo filter plugin that returns a Hello message. + description: + - This is a demo filter plugin designed to return Hello message. + options: + name: + description: Value specified here is appended to the Hello message. + type: str +""" + +EXAMPLES = """ +# hello_world filter example + +- name: Display a hello message + ansible.builtin.debug: + msg: "{{ 'ansible-creator' | oracle.dbaas.hello_world }}" +""" + + +def _hello_world(name: str) -> str: + """Returns Hello message. + + Args: + name: The name to greet. + + Returns: + str: The greeting message. + """ + return "Hello, " + name + + +class FilterModule: + """filter plugin.""" + + def filters(self: FilterModule) -> dict[str, Callable[[str], str]]: + """Map filter plugin names to their functions. + + Returns: + dict: The filter plugin functions. + """ + return {"hello_world": _hello_world} diff --git a/playbooks/dbaas-ansible-collection/plugins/inventory/__init__.py b/playbooks/dbaas-ansible-collection/plugins/inventory/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/playbooks/dbaas-ansible-collection/plugins/module_utils/__init__.py b/playbooks/dbaas-ansible-collection/plugins/module_utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/playbooks/dbaas-ansible-collection/plugins/modules/__init__.py b/playbooks/dbaas-ansible-collection/plugins/modules/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/playbooks/dbaas-ansible-collection/plugins/modules/sqlplus.py b/playbooks/dbaas-ansible-collection/plugins/modules/sqlplus.py new file mode 100644 index 0000000..aad2115 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/plugins/modules/sqlplus.py @@ -0,0 +1,177 @@ +#!/usr/bin/python + +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +from __future__ import (absolute_import, division, print_function) +from subprocess import Popen, PIPE +from os.path import abspath, dirname, join +__metaclass__ = type + +DOCUMENTATION = r''' +--- +module: sqlplus + +short_description: A module for executing Oracle SQL*Plus commands. + +# If this is part of a collection, you need to use semantic versioning, +# i.e. the version is of the form "2.5.0" and not "2.4". +version_added: "1.0.0" + +description: It is relatively straight-forward to run a basic SQL*Plus commands in Ansible using the command or shell modules. + +options: + oracle_home: + description: Specifies Oracle home directory in which Oracle products are installed. + required: true + type: str + oracle_sid: + description: Specifies the name of the Oracle Database instance on the host computer. + required: true + type: str + sql_query: + description: Specifies the instructions that relational database management systems understand. + required: true + type: str + markup: + description: Specifies the markup options for use in generating HTML or CSV output. + required: false + type: str +# Specify this value according to your collection +# in format of namespace.collection.doc_fragment_name +# extends_documentation_fragment: +# - my_namespace.my_collection.my_doc_fragment_name + +author: + - Sebastin Alasino (@salasino) +''' + +EXAMPLES = r''' +# Pass in a message +- name: Run a Oracle SQLPlus command + oracle.dbaas.sqlplus: + args: + oracle_home: /u01/app/oracle/product/19.0.0/dbhome_1 + oracle_sid: DBLVM1 + markup: csv + sql_query: "select * from dual;" + +# fail the module +- name: Run a Oracle SQLPlus command + oracle.dbaas.sqlplus: + args: + oracle_home: /u01/app/oracle/product/19.0.0/dbhome_1 + oracle_sid: DBLVM1 + markup: csv + sql_query: "fail me" +''' + +RETURN = r''' +# These are examples of possible return values, and in general should use other names for return values. +original_message: + description: The original name param that was passed in. + type: str + returned: always + sample: 'hello world' +message: + description: The output message that the test module generates. + type: str + returned: always + sample: 'goodbye' +''' + +import subprocess +import os +from ansible.module_utils.basic import AnsibleModule + + +def run_module(): + # define available arguments/parameters a user can pass to the module + module_args = dict( + oracle_home=dict(type='str', required=True), + oracle_sid=dict(type='str', required=True), + sql_query=dict(type='str', required=True), + success=dict(type='bool', required=False, default=False), + ) + + # seed the result dict in the object + # we primarily care about changed and state + # changed is if this module effectively modified the target + # state will include any data that you want your module to pass back + # for consumption, for example, in a subsequent task + result = dict( + changed=False, + results='' + ) + + # the AnsibleModule object will be our abstraction working with Ansible + # this includes instantiation, a couple of common attr would be the + # args/params passed to the execution, as well as if the module + # supports check mode + module = AnsibleModule( + argument_spec=module_args, + supports_check_mode=True + ) + + # if the user is working with this module in only check mode we do not + # want to make any changes to the environment, just return the current + # state with no modifications + if module.check_mode: + module.exit_json(**result) + + # manipulate or modify the state as needed (this is going to be the + # part where your module will do what it needs to do) + result['results'] = (run_sqlplus(module.params['oracle_home'],module.params['oracle_sid'],module.params['sql_query'],module.params['success']))[1:-1] + + # use whatever logic you need to determine whether or not this module + # made any modifications to your target + if module.params['success']: + results['changed'] = True + + # during the execution of the module, if there is an exception or a + # conditional state that effectively causes a failure, run + # AnsibleModule.fail_json() to pass in the message and the result + if module.params['sql_query'] == 'fail me': + module.fail_json(msg='You requested this to fail', **result) + + # in the event of a successful module execution, you will want to + # simple AnsibleModule.exit_json(), passing the key/value results + module.exit_json(**result) + +def run_sqlplus(oracle_home,oracle_sid,sql_query,success): + + # Run a sql command or group of commands against + # a database using sqlplus. + + sqlplus = os.path.join(oracle_home, 'bin/sqlplus') + # my_env = {**os.environ, **oracle_sid} + my_env = {'ORACLE_HOME': oracle_home, 'ORACLE_SID': oracle_sid, **os.environ} + + sql_query_to_run = "set feedback off" + "\n" + "SET MARKUP CSV ON QUOTE OFF" + "\n" + sql_query + + p = subprocess.Popen( + [sqlplus,'-L','-F','-SILENT','-nologintime','/ as sysdba'], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + env=my_env + ) + (stdout,stderr) = p.communicate(sql_query_to_run.encode('utf-8')) + stdout_lines = stdout.decode('utf-8').split("\n") + success = True + + return stdout_lines + +def main(): + run_module() + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/plugins/modules/sqlplus2.py b/playbooks/dbaas-ansible-collection/plugins/modules/sqlplus2.py new file mode 100644 index 0000000..4e40dbd --- /dev/null +++ b/playbooks/dbaas-ansible-collection/plugins/modules/sqlplus2.py @@ -0,0 +1,173 @@ +#!/usr/bin/python + +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +from __future__ import (absolute_import, division, print_function) +from subprocess import Popen, PIPE +from os.path import abspath, dirname, join +__metaclass__ = type + +DOCUMENTATION = r''' +--- +module: my_test + +short_description: This is my test module + +# If this is part of a collection, you need to use semantic versioning, +# i.e. the version is of the form "2.5.0" and not "2.4". +version_added: "1.0.0" + +description: This is my longer description explaining my test module. + +options: + name: + description: This is the message to send to the test module. + required: true + type: str + new: + description: + - Control to demo if the result of this module is changed or not. + - Parameter description can be a list as well. + required: false + type: bool +# Specify this value according to your collection +# in format of namespace.collection.doc_fragment_name +# extends_documentation_fragment: +# - my_namespace.my_collection.my_doc_fragment_name + +author: + - Your Name (@yourGitHubHandle) +''' + +EXAMPLES = r''' +# Pass in a message +- name: Test with a message + my_namespace.my_collection.my_test: + name: hello world + +# pass in a message and have changed true +- name: Test with a message and changed output + my_namespace.my_collection.my_test: + name: hello world + new: true + +# fail the module +- name: Test failure of the module + my_namespace.my_collection.my_test: + name: fail me +''' + +RETURN = r''' +# These are examples of possible return values, and in general should use other names for return values. +original_message: + description: The original name param that was passed in. + type: str + returned: always + sample: 'hello world' +message: + description: The output message that the test module generates. + type: str + returned: always + sample: 'goodbye' +''' + +import subprocess +import os +from ansible.module_utils.basic import AnsibleModule + + +def run_module(): + # define available arguments/parameters a user can pass to the module + module_args = dict( + oracle_home=dict(type='str', required=True), + oracle_sid=dict(type='str', required=True), + query=dict(type='str', required=True), + new=dict(type='bool', required=False, default=False) + ) + + # seed the result dict in the object + # we primarily care about changed and state + # changed is if this module effectively modified the target + # state will include any data that you want your module to pass back + # for consumption, for example, in a subsequent task + result = dict( + changed=False, + oracle_home='', + oracle_env='', + query='', + results='' + ) + + # the AnsibleModule object will be our abstraction working with Ansible + # this includes instantiation, a couple of common attr would be the + # args/params passed to the execution, as well as if the module + # supports check mode + module = AnsibleModule( + argument_spec=module_args, + supports_check_mode=True + ) + + # if the user is working with this module in only check mode we do not + # want to make any changes to the environment, just return the current + # state with no modifications + if module.check_mode: + module.exit_json(**result) + + # manipulate or modify the state as needed (this is going to be the + # part where your module will do what it needs to do) + result['oracle_home'] = module.params['oracle_home'] + result['oracle_sid'] = module.params['oracle_sid'] + result['query'] = module.params['query'] + result['results'] = (run_sqlplus(module.params['oracle_home'],module.params['oracle_sid'],module.params['query']))[1:-1] + + # use whatever logic you need to determine whether or not this module + # made any modifications to your target + if module.params['new']: + results['changed'] = True + + # during the execution of the module, if there is an exception or a + # conditional state that effectively causes a failure, run + # AnsibleModule.fail_json() to pass in the message and the result + if module.params['query'] == 'fail me': + module.fail_json(msg='You requested this to fail', **result) + + # in the event of a successful module execution, you will want to + # simple AnsibleModule.exit_json(), passing the key/value results + module.exit_json(**result) + +def run_sqlplus(oracle_home,oracle_sid,query): + + # Run a sql command or group of commands against + # a database using sqlplus. + + sqlplus = os.path.join(oracle_home, 'bin/sqlplus') + sql_query = "set feedback off" + "\n" + "SET MARKUP CSV ON QUOTE OFF" + "\n" + query + # my_env = {**os.environ, **oracle_sid} + my_env = {'ORACLE_HOME': oracle_home, 'ORACLE_SID': oracle_sid, **os.environ} + + p = subprocess.Popen( + [sqlplus,'-L','-F','-SILENT','/ as sysdba'], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + env=my_env + ) + (stdout,stderr) = p.communicate(sql_query.encode('utf-8')) + stdout_lines = stdout.decode('utf-8').split("\n") + + return stdout_lines + +def main(): + run_module() + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/plugins/modules/srvctl.py b/playbooks/dbaas-ansible-collection/plugins/modules/srvctl.py new file mode 100644 index 0000000..05eb359 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/plugins/modules/srvctl.py @@ -0,0 +1,155 @@ +#!/usr/bin/python + +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + +DOCUMENTATION = r''' +--- +module: my_test + +short_description: This is my test module + +# If this is part of a collection, you need to use semantic versioning, +# i.e. the version is of the form "2.5.0" and not "2.4". +version_added: "1.0.0" + +description: This is my longer description explaining my test module. + +options: + name: + description: This is the message to send to the test module. + required: true + type: str + new: + description: + - Control to demo if the result of this module is changed or not. + - Parameter description can be a list as well. + required: false + type: bool +# Specify this value according to your collection +# in format of namespace.collection.doc_fragment_name +# extends_documentation_fragment: +# - my_namespace.my_collection.my_doc_fragment_name + +author: + - Your Name (@yourGitHubHandle) +''' + +EXAMPLES = r''' +# Pass in a message +- name: Test with a message + my_namespace.my_collection.my_test: + name: hello world + +# pass in a message and have changed true +- name: Test with a message and changed output + my_namespace.my_collection.my_test: + name: hello world + new: true + +# fail the module +- name: Test failure of the module + my_namespace.my_collection.my_test: + name: fail me +''' + +RETURN = r''' +# These are examples of possible return values, and in general should use other names for return values. +original_message: + description: The original name param that was passed in. + type: str + returned: always + sample: 'hello world' +message: + description: The output message that the test module generates. + type: str + returned: always + sample: 'goodbye' +''' + +import subprocess +from ansible.module_utils.basic import AnsibleModule + + +def run_module(): + # define available arguments/parameters a user can pass to the module + module_args = dict( + query=dict(type='str', required=True), + new=dict(type='bool', required=False, default=False) + ) + + # seed the result dict in the object + # we primarily care about changed and state + # changed is if this module effectively modified the target + # state will include any data that you want your module to pass back + # for consumption, for example, in a subsequent task + result = dict( + changed=False, + query='', + results='' + ) + + # the AnsibleModule object will be our abstraction working with Ansible + # this includes instantiation, a couple of common attr would be the + # args/params passed to the execution, as well as if the module + # supports check mode + module = AnsibleModule( + argument_spec=module_args, + supports_check_mode=True + ) + + # if the user is working with this module in only check mode we do not + # want to make any changes to the environment, just return the current + # state with no modifications + if module.check_mode: + module.exit_json(**result) + + # manipulate or modify the state as needed (this is going to be the + # part where your module will do what it needs to do) + result['query'] = module.params['query'] + result['results'] = (run_sqlplus(module.params['query']))[1:-1] + + # use whatever logic you need to determine whether or not this module + # made any modifications to your target + if module.params['new']: + results['changed'] = True + + # during the execution of the module, if there is an exception or a + # conditional state that effectively causes a failure, run + # AnsibleModule.fail_json() to pass in the message and the result + if module.params['query'] == 'fail me': + module.fail_json(msg='You requested this to fail', **result) + + # in the event of a successful module execution, you will want to + # simple AnsibleModule.exit_json(), passing the key/value results + module.exit_json(**result) + +def run_sqlplus(query): + + # Run a sql command or group of commands against + # a database using sqlplus. + + p = subprocess.Popen(['sqlplus','-L','-F','-SILENT','/ as sysdba'],stdin=subprocess.PIPE, + stdout=subprocess.PIPE,stderr=subprocess.PIPE) + sql_query = "set feedback off" + "\n" + "SET MARKUP CSV ON QUOTE OFF" + "\n" + query + (stdout,stderr) = p.communicate(sql_query.encode('utf-8')) + stdout_lines = stdout.decode('utf-8').split("\n") + + return stdout_lines + +def main(): + run_module() + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/plugins/plugin_utils/__init__.py b/playbooks/dbaas-ansible-collection/plugins/plugin_utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/playbooks/dbaas-ansible-collection/plugins/sub_plugins/__init__.py b/playbooks/dbaas-ansible-collection/plugins/sub_plugins/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/playbooks/dbaas-ansible-collection/plugins/test/__init__.py b/playbooks/dbaas-ansible-collection/plugins/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/playbooks/dbaas-ansible-collection/pyproject.toml b/playbooks/dbaas-ansible-collection/pyproject.toml new file mode 100644 index 0000000..fb7074c --- /dev/null +++ b/playbooks/dbaas-ansible-collection/pyproject.toml @@ -0,0 +1,7 @@ +[tool.black] +line-length = 100 + +[tool.pytest.ini_options] +addopts = ["-vvv", "-n", "2", "--log-level", "WARNING", "--color", "yes"] +filterwarnings = ['ignore:AnsibleCollectionFinder has already been configured'] +testpaths = ["tests"] diff --git a/playbooks/dbaas-ansible-collection/python_venv_config.sh b/playbooks/dbaas-ansible-collection/python_venv_config.sh new file mode 100755 index 0000000..b7b5c1d --- /dev/null +++ b/playbooks/dbaas-ansible-collection/python_venv_config.sh @@ -0,0 +1,14 @@ +#!/bin/bash +if [ ! -d "python-venv" ]; then + echo "Installing Python module virtualenv" + pip3 install virtualenv > /dev/null 2>&1 + echo "Creating python virtual env" + python3 -m venv dbaas + echo "Activating python virtual env" + source dbaas/bin/activate + echo "Upgrading python pip" + python3 -m pip install --upgrade pip +else + echo "Activating python virtual env" + source dbaas/bin/activate +fi diff --git a/playbooks/dbaas-ansible-collection/requirements.txt b/playbooks/dbaas-ansible-collection/requirements.txt new file mode 100644 index 0000000..8ad0366 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/requirements.txt @@ -0,0 +1,9 @@ +# TO-DO: add python packages that are required for this collection +ansible +passlib +jmespath +xmltodict +redis +pexpect +dnspython +ipaddress \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/.DS_Store b/playbooks/dbaas-ansible-collection/roles/.DS_Store new file mode 100644 index 0000000..93fc297 Binary files /dev/null and b/playbooks/dbaas-ansible-collection/roles/.DS_Store differ diff --git a/playbooks/dbaas-ansible-collection/roles/database/README.md b/playbooks/dbaas-ansible-collection/roles/database/README.md new file mode 100644 index 0000000..ce99f63 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/README.md @@ -0,0 +1,57 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +dbhome_create: +ansible-playbook oracle.dbaas.dbaas --limit -e @inventory/envs/.ini -e "targetVersion=23412406" --tags dbhome_create +ansible-playbook oracle.dbaas.dbaas --limit -e @inventory/envs/.ini -e "targetVersion=23.5.0.24.07" --tags dbhome_create +ansible-playbook oracle.dbaas.dbaas --limit -e @inventory/envs/.ini -e "targetHome=/u01/app/oracle/product/23.6.0.24/db_home_2306241127 goldImage=/ade_autofs/ud222_db/RDBMS_23.0.0.0.0_LINUX.X64.rdd/241127/install/shiphome/goldimage/db_home.zip" --tags dbhome_create + +database_create: +ansible-playbook oracle.dbaas.dbaas --limit -e @inventory/envs/.ini -e "targetVersion=23.5.0.24.07" --tags database_create +ansible-playbook oracle.dbaas.dbaas --limit -e @inventory/envs/.ini -e "targetHome=/u01/app/oracle/product/23.5.0.24/db_home_23502407" --tags database_create + +swingbench_configure: +ansible-playbook oracle.dbaas.onboarding --limit slc1 -e @inventory/envs/slc1.ini --tags swingbench_configure + +create_standby_database: +ansible-playbook oracle.dbaas.onboarding --limit slc1 -e @inventory/envs/slc1.ini --tags create_standby_database --extra-vars "targetVersion=23502407" + +DBaaSCLI command: +ansible-playbook oracle.dbaas.dbaas --limit hdg --extra-vars @inventory/envs/hdg1.ini --extra-vars "dbaascli_command='database modifyParameters --setParameters db_writer_processes=32,log_archive_trace=551 --allowBounce' log_analyze_flag=true" --tags dbaascli +ansible-playbook oracle.dbaas.dbaas -i inventory/oci.ini --limit hdg --extra-vars @inventory/envs/hdg1.ini --extra-vars "dbaascli_command='database move' oracleHomeName='OraHome3'" --tags dbaascli + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/playbooks/dbaas-ansible-collection/roles/database/defaults/main.yml b/playbooks/dbaas-ansible-collection/roles/database/defaults/main.yml new file mode 100644 index 0000000..d06dbdd --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/defaults/main.yml @@ -0,0 +1,7 @@ +#SPDX-License-Identifier: MIT-0 +--- +# defaults file for dbaas + +timeline_task_name: "{{ dbaascli_command | split(' --') | first | replace(' ','_') }}" +sysdate: "{{ '%Y-%m-%dT%H:%M:%S%z' | strftime( now(utc=false).strftime('%s') ) }}" +db_role_flag: defined \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/handlers/main.yml b/playbooks/dbaas-ansible-collection/roles/database/handlers/main.yml new file mode 100644 index 0000000..976c7d5 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/handlers/main.yml @@ -0,0 +1,10 @@ +#SPDX-License-Identifier: MIT-0 +--- +# handlers file for dbaas + +- name: Spool dbaascli_command_output_prereqs + debug: + msg: "{{ dbaascli_command_output_prereqs.stdout }}" + +- name: End execution + meta: end_play \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/meta/main.yml b/playbooks/dbaas-ansible-collection/roles/database/meta/main.yml new file mode 100644 index 0000000..dc4e590 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/meta/main.yml @@ -0,0 +1,28 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +galaxy_info: + role_name: dbaas + author: Sebastian Alasino + description: Oracle Database as a Service (DBAAS) + company: Oracle + + license: license (MIT) + + min_ansible_version: 2.14.0 + + galaxy_tags: + - oracle + - database + +dependencies: + # - oracle_facts diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/common/ahf_configure.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/common/ahf_configure.yml new file mode 100644 index 0000000..46cf93b --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/common/ahf_configure.yml @@ -0,0 +1,104 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Pre-tasks + block: + + - name: Create directory stage + ansible.builtin.file: + path: "{{ stage_dir }}/ahf_stage" + state: directory + owner: oracle + group: oinstall + mode: '0755' + + - name: Find local ahf_file + find: + paths: "{{ stage_dir }}/ahf_stage/" + patterns: "AHF-LINUX_v*.zip" + register: ahf_file + delegate_to: localhost + become: false + + - name: Copy AHF files + copy: + src: "{{ item.path }}" + dest: "{{ stage_dir }}/ahf_stage/" + with_items: "{{ ahf_file.files }}" + loop_control: + label: "{{ item.path }}" + + - name: Check if AHF is already installed + stat: + path: "{{ oracle_ahf_loc }}/bin/tfactl" + register: stat_ahf + + become: true + when: oracle_ahf_loc is defined + +- name: Install AHF + block: + + - name: Find remote ahf_file + find: + paths: "{{ stage_dir }}/ahf_stage/" + patterns: "AHF-LINUX_v*.zip" + register: ahf_file + + - name: Unzip remote ahf archive + unarchive: + src: "{{ item.path }}" + dest: "{{ stage_dir }}" + mode: 0755 + with_items: "{{ ahf_file.files }}" + loop_control: + label: "{{ item.path }}" + environment: + CRYPTOGRAPHY_OPENSSL_NO_LEGACY: '1' + + - name: Create oracle ahf directory + ansible.builtin.file: + path: "{{ oracle_ahf_loc }}/data" + state: directory + owner: root + group: root + mode: '0755' + + - name: Run ahf installer + shell: "{{ stage_dir }}/ahf_setup -silent -ahf_loc /opt/oracle.ahf -data_dir /u01/oracle.ahf/data -local" + + become: true + when: + - oracle_ahf_loc is not defined + - stat_ahf is not defined + - stat_ahf.stat.exists == false + +- name: Post-tasks + block: + + - debug: + msg: "{{ oracle_ahf_loc }}<=" + + - name: AHF setupgrade to autoupgrade + shell: "{{ oracle_ahf_loc }}/bin/ahfctl setupgrade -autoupgrade on -swstage {{ stage_dir }}/ahf_stage -frequency 1 -remove_installer yes" + + # - name: AHF upgrade + # shell: "{{ oracle_ahf_loc }}/bin/ahfctl upgrade -nomos" + # register: command_result + # failed_when: + # - command_result.rc != 0 + # - '"AHF is already running latest version. No need to upgrade." not in command_result.stdout' + + become: true + when: + - oracle_ahf_loc is defined + diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/common/awr_snapshot_create.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/common/awr_snapshot_create.yml new file mode 100644 index 0000000..6b61e22 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/common/awr_snapshot_create.yml @@ -0,0 +1,38 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Get stats_pack_snap + shell: | + set timeout 30 + {{ oracle_home }}/bin/sqlplus -s "/ as sysdba" < 0 + + - debug: + var: targetHome + + when: + - targetHome is not defined + - targetVersion is defined + - db_role is not defined + - "ansible_hostname == primary_node" + +- name: Create RAC Database + block: + + # - name: Generate random primaryDBUniqueName_prefix with length 4 + # set_fact: + # primaryDBUniqueName_prefix_default: "{{ lookup('community.general.random_string', length=4, upper=false, numbers=false, special=false) }}" + # when: primaryDBUniqueName_prefix is not defined + # run_once: true + # delegate_to: localhost + # delegate_facts: true + + - name: Create Oracle Database + shell: > + {{ targetHome }}/bin/dbca + -silent + -createDatabase + -gdb_name {{ db_name }}.{{ domain }} + -dbUniqueName {{ primaryDBUniqueName }} + -sid {{ db_name }} + -createAsContainerDatabase true + -pdb_name {{ pdb_name }} + -responseFile {{ targetHome }}/assistants/dbca/dbca.rsp + -memoryPercentage 10 + -memoryMgmtType auto_sga + -databaseConfigType {% if crs==true %}RAC{% else %}SINGLE{% endif %} + -databaseType MULTIPURPOSE + -templateName {{ targetHome }}/assistants/dbca/templates/General_Purpose.dbc + -datafileDestination {% if crs==true %}+{{ asm.diskgroup.data }}{% else %}{{ oracle_base }}/oradata{% endif %} + -enableArchive true + -enableForceLogging true + -numberOfPDBs 1 + -pdbAdminPassword {{ db_sys_password }} + -recoveryAreaDestination {% if crs==true %}+{{ asm.diskgroup.reco }}{% else %}{{ oracle_base }}/fast_recovery_area{% endif %} + -recoveryAreaSize 400G + -redoLogFileSize 4192 + -storageType {% if crs==true %}ASM{% else %}FS{% endif %} + -sysPassword {{ db_sys_password }} + -systemPassword {{ db_sys_password }} + -useBigFileForTablespace true + -useLocalUndoForPDBs true + -useOMF true + -nodelist "{{ cluster_nodes }}" + register: dbca_createDatabase + async: 600 + poll: 20 + + - name: Configure RAC DB options in open state + shell: | + {{ targetHome }}/bin/sqlplus -s "{{ db_ezconnect }}" < 0 + - "'ORA-38713' not in db_flashback_on.stdout" + + - name: Start the database + shell: | + {{ targetHome }}/bin/srvctl stop database -db {{ dbUniqueName }} -o immediate + {{ targetHome }}/bin/srvctl start database -db {{ dbUniqueName }} + + - name: Create Database env file + blockinfile: + dest: ~/{{ db_name }}.env + create: true + block: | + ORACLE_HOME={{ targetHome }}; export ORACLE_HOME + PATH=$PATH:{{ targetHome }}/bin:{{ targetHome }}/OPatch; export PATH + LD_LIBRARY_PATH={{ targetHome }}/lib; export LD_LIBRARY_PATH + ORACLE_UNQNAME={{ dbUniqueName }}; export ORACLE_UNQNAME + ORACLE_SID={{ db_name }}1; export ORACLE_SID + failed_when: false + + become: true + become_user: oracle + vars: + db_name: "{{ db_name_outer }}" + dbUniqueName: "{{ primaryDBUniqueName }}" + environment: + ORACLE_HOME: '{{ targetHome }}' + ORACLE_BASE: '{{ oracle_base }}' + ORACLE_SID: "{{ db_name }}" + when: + - targetHome is defined + - db_role is not defined + - ansible_hostname == primary_node \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/database/create/dbaascli.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/create/dbaascli.yml new file mode 100644 index 0000000..e075789 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/create/dbaascli.yml @@ -0,0 +1,89 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaaSCLI database create + tags: database_create + become: true + block: + + - name: Run DBaaSCLI database create executePrereqs + expect: + command: > + dbaascli database create + --db_name {{ db_name }} + --dbUniqueName {{ db_name }}_prim + --pdb_name {{ db_name }}p1 + --oracleHomeName {{ oracleHomeName }} + --executePrereqs + responses: + Enter SYS_PASSWORD: "{{ db_sys_password }}" + Enter SYS_PASSWORD (reconfirmation): "{{ db_sys_password }}" + Enter TDE_PASSWORD: "{{ db_sys_password }}" + Enter TDE_PASSWORD (reconfirmation): "{{ db_sys_password }}" + timeout: 3600 + register: dbaascli_database_create_prereqs + failed_when: "'dbaascli execution completed' not in dbaascli_database_create_prereqs.stdout" + + # - debug: + # msg: "Log file location: {{ dbaascli_database_create_prereqs.stdout | regex_search('Log file location: .*') }}" + # when: "'dbaascli execution completed' in dbaascli_database_create_prereqs.stdout" + + - debug: + msg: "{{ output | split('\n') }}" + vars: + output: | + ================================================== + DBaasCLI database create executePrereqs + ----------------- + Log file location: {{ dbaascli_database_create_prereqs.stdout | regex_search('Log file location: .*') }} + Status: {{ dbaascli_database_create_prereqs.stdout | regex_search('dbaascli execution .+') }} + ================================================== + when: dbaascli_database_create_prereqs is not skipped + tags: [print_action] + + - name: Run DBaaSCLI database create + expect: + command: > + dbaascli database create + --db_name {{ db_name }} + --dbUniqueName {{ db_name }}_prim + --pdb_name {{ db_name }}p1 + --oracleHomeName {{ oracleHomeName }} + responses: + Enter SYS_PASSWORD: "{{ db_sys_password }}" + Enter SYS_PASSWORD (reconfirmation): "{{ db_sys_password }}" + Enter TDE_PASSWORD: "{{ db_sys_password }}" + Enter TDE_PASSWORD (reconfirmation): "{{ db_sys_password }}" + timeout: 3600 + register: dbaascli_database_create + when: + - "'prereqs' not in ansible_run_tags" + - dbaascli_database_create_prereqs is success + - "'dbaascli execution completed' in dbaascli_database_create_prereqs.stdout" + failed_when: "'dbaascli execution completed' not in dbaascli_database_create.stdout" + + # - debug: + # msg: "Log file location: {{ dbaascli_database_create.stdout | regex_search('Log file location: .*') }}" + # when: "'dbaascli execution completed' in dbaascli_database_create.stdout" + + - debug: + msg: "{{ output | split('\n') }}" + vars: + output: | + ================================================== + DBaasCLI database create + ----------------- + Log file location: {{ dbaascli_database_create.stdout | regex_search('Log file location: .*') }} + Status: {{ dbaascli_database_create.stdout | regex_search('dbaascli execution .+') }} + ================================================== + when: dbaascli_database_create is not skipped + tags: [print_action] \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/database/create/main.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/create/main.yml new file mode 100644 index 0000000..0ebb89a --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/create/main.yml @@ -0,0 +1,35 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: database create + tags: database_create + when: + - oracleHomeName is defined + - targetHome is true + - not database_config.db_role + - ansible_hostname in hostname_target + block: + + - name: database create dbaasca + ansible.builtin.include_tasks: dbaasca.yml + when: not system_config.dbaascli_on + + - name: database create dbaascli + ansible.builtin.include_tasks: dbaascli.yml + when: system_config.dbaascli_on + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/command_flags.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/command_flags.yml new file mode 100644 index 0000000..f45b762 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/command_flags.yml @@ -0,0 +1,56 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaaSCLI set database move flags + set_fact: + db_name_flag: true + dbUniqueName_flag: false + pdb_name_flag: false + db_role_flag: "defined" + prereqs_flag: true + log_analyze_flag: true + when: dbaascli_command == 'database move' + +- name: DBaaSCLI set database create flags + set_fact: + db_name_flag: true + dbUniqueName_flag: true + dbUniqueName: "{{ db_name }}_prim" + pdb_name_flag: true + pdb_name: "{{ pdb_name }}" + db_role_flag: "not defined" + prereqs_flag: true + log_analyze_flag: true + vars: + pdbNumber: 1 + when: dbaascli_command == 'database create' + +- name: DBaaSCLI set database delete flags + set_fact: + db_name_flag: true + dbUniqueName_flag: false + pdb_name_flag: false + options: "--deleteArchiveLogs true --deleteBackups true" + db_role_flag: "defined" + prereqs_flag: true + log_analyze_flag: true + when: dbaascli_command == 'database delete' + +- name: DBaaSCLI set database modifyParameters flags + set_fact: + db_name_flag: true + dbUniqueName_flag: false + pdb_name_flag: false + db_role_flag: "defined" + prereqs_flag: false + log_analyze_flag: true + when: "'database modifyParameters' in dbaascli_command" \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/command_run.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/command_run.yml new file mode 100644 index 0000000..be34644 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/command_run.yml @@ -0,0 +1,184 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Pre_tasks + block: + + - name: DBaaSCLI dbhome create + include_tasks: + file: dbaascli_dbhome_create.yml + with_items: "{{ db_name_list }}" + loop_control: + loop_var: db_name + when: version is defined + + - import_tasks: awr_snapshot_create.yml + + - name: Add element to stats_pack_snap_end + set_fact: + stats_pack_snap_end: "{{ stats_pack_snap_end | default([]) + [stats_pack_snap.stdout | trim] }}" + when: stats_pack_snap_end.changed is true + + - import_tasks: dbaascli_command_flags.yml + + # - name: Run dbaascli cswlib download + # command: "dbaascli cswlib download --version {{ targetVersion }}" + # register: dbaascli_cswlib_download + # when: targetVersion is defined + # failed_when: "'dbaascli execution completed' not in dbaascli_cswlib_download.stdout" + +- name: DBaaSCLI command prereqs + become: true + when: + - prereqs_flag is true + - "database_config.db_role is {{ db_role_flag }}" + block: + + - import_tasks: timeline_log_write.yml + vars: + timeline_task_name: "{{ dbaascli_command | split(' --') | first | replace(' ','_') }}_prereqs" + status: Running + when: "'framework' in ansible_run_tags" + + - name: Run DBaaSCLI command prereqs + expect: + command: > + dbaascli {{ dbaascli_command }} + {% if db_name_flag is true %}--db_name {{ db_name }} {% endif %} + {% if dbUniqueName_flag is true %}--dbUniqueName {{ dbUniqueName }}{% endif %} + {% if pdb_name_flag is true %}--pdb_name {{ pdb_name }}{% endif %} + {% if oracleHome is defined %}--oracleHome {{ oracleHome }}{% endif %} + {% if oracleHomeName is defined %}--oracleHomeName {{ oracleHomeName }}{% endif %} + {% if _dbHomeTargetName is defined %}--oracleHomeName {{ _dbHomeTargetName }}{% endif %} + {% if targetVersion is defined %}--version {{ targetVersion }}{% endif %} + {% if options is defined %}{{ options }}{% endif %} + --prereqs + responses: + Enter SYS_PASSWORD: "{{ db_sys_password }}" + Enter SYS_PASSWORD (reconfirmation): "{{ db_sys_password }}" + Enter TDE_PASSWORD: "{{ db_sys_password }}" + Enter TDE_PASSWORD (reconfirmation): "{{ db_sys_password }}" + timeout: 3600 + register: dbaascli_command_output_prereqs + throttle: 1 + changed_when: "'dbaascli execution completed' not in dbaascli_command_output_prereqs.stdout" + + - import_tasks: timeline_log_write.yml + vars: + timeline_task_name: "{{ dbaascli_command | split(' --') | first | replace(' ','_') }}_prereqs" + status: Completed + when: + - "'framework' in ansible_run_tags" + - "'dbaascli execution completed' in dbaascli_command_output_prereqs.stdout" + + - import_tasks: timeline_log_write.yml + vars: + timeline_task_name: "{{ dbaascli_command | split(' --') | first | replace(' ','_') }}_prereqs" + status: Failed + when: + - "'framework' in ansible_run_tags" + - "'dbaascli execution completed' not in dbaascli_command_output_prereqs.stdout" + + - set_fact: + _dbaastools_log: "{{ dbaascli_command_output_prereqs.stdout | regex_search('Session log: (.+)') | split(': ') | last }}" + when: + - log_analyze_flag is true + - "'dbaascli execution completed' in dbaascli_command_output_prereqs.stdout" + + - import_tasks: dbaascli_log_analyze.yml + when: + - log_analyze_flag is true + - "'dbaascli execution completed' in dbaascli_command_output_prereqs.stdout" + +- name: DBaaSCLI command + become: true + when: + - "database_config.db_role is {{ db_role_flag }}" + - "'prereqs' not in ansible_run_tags" + - (dbaascli_command_output_prereqs.skipped is true) or ("'dbaascli execution completed' in dbaascli_command_output_prereqs.stdout") + block: + + - import_tasks: timeline_log_write.yml + vars: + status: Running + when: + - "'framework' in ansible_run_tags" + + - name: Run DBaaSCLI command + expect: + command: > + dbaascli {{ dbaascli_command }} + {% if db_name_flag is true %}--db_name {{ db_name }}{% endif %} + {% if dbUniqueName_flag is true %}--dbUniqueName {{ database_config.dbUniqueName }}{% endif %} + {% if pdb_name_flag is true %}--pdb_name {{ pdb_name }}{% endif %} + {% if oracleHome is defined %}--oracleHome {{ oracleHome }}{% endif %} + {% if oracleHomeName is defined %}--oracleHomeName {{ oracleHomeName }}{% endif %} + {% if _dbHomeTargetName is defined %}--oracleHomeName {{ _dbHomeTargetName }}{% endif %} + {% if targetVersion is defined %}--version {{ targetVersion }}{% endif %} + {% if options is defined %}{{ options }}{% endif %} + {% if force is true %}--force{% endif %} + {% if extraParameters is defined %}{{ extraParameters }}{% endif %} + responses: + Enter SYS_PASSWORD: "{{ db_sys_password }}" + Enter SYS_PASSWORD (reconfirmation): "{{ db_sys_password }}" + Enter TDE_PASSWORD: "{{ db_sys_password }}" + Enter TDE_PASSWORD (reconfirmation): "{{ db_sys_password }}" + timeout: 3600 + register: dbaascli_command_output + throttle: 1 + failed_when: "'dbaascli execution completed' not in dbaascli_command_output.stdout" + + - name: Add dbaascli_command_output to story + set_fact: + story: "{{ story | default([]) + [dbaascli_command_output.stdout] }}" + when: dbaascli_command_output.rc == 0 + + - import_tasks: timeline_log_write.yml + vars: + status: Completed + when: + - "'framework' in ansible_run_tags" + - dbaascli_command_output.rc == 0 + + - import_tasks: timeline_log_write.yml + vars: + status: Failed + when: + - "'framework' in ansible_run_tags" + - dbaascli_command_output.rc != 0 + + - set_fact: + _dbaastools_log: "{{ dbaascli_command_output.stdout | regex_search('Session log: (.+)' , '\\1') | first }}" + when: + - log_analyze_flag is true + - "'dbaascli execution completed' in dbaascli_command_output.stdout" + + - import_tasks: dbaascli_log_analyze.yml + when: + - log_analyze_flag is true + - "'dbaascli execution completed' in dbaascli_command_output.stdout" + + - name: Print Story facts + debug: + msg: "{{ item }}" + with_items: "{{ story }}" + when: story is defined + +- name: Post_tasks + block: + + - import_tasks: awr_snapshot_create.yml + + - name: Add element to stats_pack_snap_begin + set_fact: + stats_pack_snap_begin: "{{ stats_pack_snap_begin | default([]) + [stats_pack_snap.stdout | trim] }}" + when: stats_pack_snap_end.changed is true \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/create.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/create.yml new file mode 100644 index 0000000..2bbbc98 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/create.yml @@ -0,0 +1,94 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaaSCLI database create + become: true + when: + - oracleHomeName is defined + - targetHome is true + - database_config.db_role is not defined + - ansible_hostname in hostname_target + # - ansible_hostname in grid_config.master_node + block: + + - name: Run DBaaSCLI database create prereqs + expect: + command: > + dbaascli database create + --db_name {{ db_name }} + --dbUniqueName {{ db_name }}_prim + --pdb_name {{ db_name }}p1 + --oracleHomeName {{ oracleHomeName }} + --prereqs + responses: + Enter SYS_PASSWORD: "{{ db_sys_password }}" + Enter SYS_PASSWORD (reconfirmation): "{{ db_sys_password }}" + Enter TDE_PASSWORD: "{{ db_sys_password }}" + Enter TDE_PASSWORD (reconfirmation): "{{ db_sys_password }}" + timeout: 3600 + register: dbaascli_database_create_prereqs + failed_when: "'dbaascli execution completed' not in dbaascli_database_create_prereqs.stdout" + + # - debug: + # msg: "Log file location: {{ dbaascli_database_create_prereqs.stdout | regex_search('Log file location: .*') }}" + # when: "'dbaascli execution completed' in dbaascli_database_create_prereqs.stdout" + + - debug: + msg: "{{ output | split('\n') }}" + vars: + output: | + ================================================== + DBaasCLI database create prereqs + ----------------- + Log file location: {{ dbaascli_database_create_prereqs.stdout | regex_search('Log file location: .*') }} + Status: {{ dbaascli_database_create_prereqs.stdout | regex_search('dbaascli execution .+') }} + ================================================== + when: dbaascli_database_create_prereqs is not skipped + tags: [print_action] + + - name: Run DBaaSCLI database create + expect: + command: > + dbaascli database create + --db_name {{ db_name }} + --dbUniqueName {{ db_name }}_prim + --pdb_name {{ db_name }}p1 + --oracleHomeName {{ oracleHomeName }} + responses: + Enter SYS_PASSWORD: "{{ db_sys_password }}" + Enter SYS_PASSWORD (reconfirmation): "{{ db_sys_password }}" + Enter TDE_PASSWORD: "{{ db_sys_password }}" + Enter TDE_PASSWORD (reconfirmation): "{{ db_sys_password }}" + timeout: 3600 + register: dbaascli_database_create + when: + - "'prereqs' not in ansible_run_tags" + - dbaascli_database_create_prereqs is success + - "'dbaascli execution completed' in dbaascli_database_create_prereqs.stdout" + failed_when: "'dbaascli execution completed' not in dbaascli_database_create.stdout" + + # - debug: + # msg: "Log file location: {{ dbaascli_database_create.stdout | regex_search('Log file location: .*') }}" + # when: "'dbaascli execution completed' in dbaascli_database_create.stdout" + + - debug: + msg: "{{ output | split('\n') }}" + vars: + output: | + ================================================== + DBaasCLI database create + ----------------- + Log file location: {{ dbaascli_database_create.stdout | regex_search('Log file location: .*') }} + Status: {{ dbaascli_database_create.stdout | regex_search('dbaascli execution .+') }} + ================================================== + when: dbaascli_database_create is not skipped + tags: [print_action] \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/delete.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/delete.yml new file mode 100644 index 0000000..5d92c90 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/delete.yml @@ -0,0 +1,36 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaaSCLI database delete + become: true + throttle: 1 + when: + - database_config.db_role is defined + - ansible_hostname in database_config.master_node + block: + + - name: Run DBaaSCLI database delete standby + command: "dbaascli database delete --db_name {{ db_name }}" + register: _dbaascli_database_delete_standby + failed_when: "'dbaascli execution completed' not in _dbaascli_database_delete_standby.stdout" + when: + - (('primary' in ansible_run_tags) or + ('standby' in ansible_run_tags)) + - database_config.db_role == "physical_standby" + + - name: Run DBaaSCLI database delete primary + command: "dbaascli database delete --db_name {{ db_name }}" + register: _dbaascli_database_delete_primary + failed_when: "'dbaascli execution completed' not in _dbaascli_database_delete_primary.stdout" + when: + - "'primary' in ansible_run_tags" + - database_config.db_role == "primary" \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/getdetails.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/getdetails.yml new file mode 100644 index 0000000..77fe896 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/getdetails.yml @@ -0,0 +1,29 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Block - DBaaSCLI database getDetails + become: true + when: + - database_config.db_role is defined + - ansible_hostname in database_config.master_node + block: + + - debug: + msg: "{{ output | split('\n') }}" + vars: + output: | + ================================================== + DBaasCLI database getDetails + ----------------- + {{ database_config | to_nice_yaml }} + ================================================== + tags: [print_action] \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/log_analyze.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/log_analyze.yml new file mode 100644 index 0000000..9715551 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/log_analyze.yml @@ -0,0 +1,50 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaaSCLI log analyze + become: true + ignore_errors: true + block: + + - name: Get pilot log from _dbaastools_log + command: "awk '/Log file location: / {print $NF}' {{ dbaastools_log }}" + register: _dbaastools_log_output + + - set_fact: + pilot_log: "{{ _dbaastools_log_output.stdout_lines[0] }}" + + - name: DBaaSCLI step-by-step time + shell: > + egrep -B1 'START OF JOB INIT|END OF JOB' {{ pilot_log }} | + egrep -E '[[:digit:]]{4}\-[[:digit:]]{2}\-[[:digit:]]{2}|OF JOB'| + paste -s -d' \n'| + awk -F"[][ ]" -v OFS=',' '{currdate=$3" "$4; if (NR==1) prevdate=currdate; datecmd="date --date \""currdate"\" +%s"; datecmd | + getline currdates; close(datecmd); datecmd="date --date \""prevdate"\" +%s"; datecmd | + getline prevdates; close(datecmd);durations=currdates-prevdates; datecmd="date -d@\""durations"\" -u +%H:%M:%S"; datecmd | + getline duration; close(datecmd);print duration, currdate, $13, $16; prevdate=currdate}' + register: dbaascli_step_by_step_timing + + - debug: + msg: "{{ output | split('\n') }}" + vars: + output: | + ================================================== + DBaasCLI step-by-step time + ----------------- + {{ dbaascli_step_by_step_timing.stdout_lines | to_nice_yaml }} + ================================================== + + - name: Add dbaascli_command_output to story + set_fact: + story: "{{ story | default([]) + [dbaascli_step_by_step_timing.stdout_lines | to_nice_yaml] }}" + when: dbaascli_step_by_step_timing is success +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/move.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/move.yml new file mode 100644 index 0000000..b3e347e --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/move.yml @@ -0,0 +1,107 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaaSCLI database move + become: True + ignore_errors: True + when: + - oracleHomeName is defined + - database_config.db_role is defined + - ansible_hostname in database_config.master_node + block: + + - name: Run DBaaSCLI database move prereqs + command: > + dbaascli database move + --db_name {{ db_name }} + --oracleHomeName {{ oracleHomeName }} + --prereqs + register: dbaascli_database_move_prereqs + failed_when: "'dbaascli execution completed' not in dbaascli_database_move_prereqs.stdout" + + - debug: + msg: "{{ output | split('\n') }}" + vars: + output: | + ================================================== + Run DBaaSCLI database move prereqs + ----------------- + {{ dbaascli_database_move_prereqs.stdout_lines | to_nice_yaml }} + ================================================== + when: dbaascli_database_move_prereqs is failed + + - name: Run DBaaSCLI database move standby + command: > + dbaascli database move + --db_name {{ db_name }} + --oracleHomeName {{ oracleHomeName }} + register: dbaascli_database_move_standby + when: + - dbaascli_database_move_prereqs is success + - database_config.db_role == 'standby' + - "'dbaascli execution completed' in dbaascli_database_move_prereqs.stdout" + - "'prereqs' not in ansible_run_tags|lower" + failed_when: "'dbaascli execution completed' not in dbaascli_database_move_standby.stdout" + + - debug: + msg: "{{ output | split('\n') }}" + vars: + output: | + ================================================== + Run DBaaSCLI database move standby + ----------------- + {{ dbaascli_database_move_standby.stdout_lines | to_nice_yaml }} + ================================================== + when: dbaascli_database_move_standby is failed + + - name: Run DBaaSCLI database move primary + command: > + dbaascli database move + --db_name {{ db_name }} + --oracleHomeName {{ oracleHomeName }} + register: dbaascli_database_move_primary + when: + - dbaascli_database_move_prereqs is success + - "'dbaascli execution completed' in dbaascli_database_move_prereqs.stdout" + - database_config.db_role == 'primary' + - ((dbaascli_database_move_standby is skipped) or + ('dbaascli execution completed' in dbaascli_database_move_standby.stdout)) + - "'prereqs' not in ansible_run_tags|lower" + failed_when: "'dbaascli execution completed' not in dbaascli_database_move_primary.stdout" + + - debug: + msg: "{{ output | split('\n') }}" + vars: + output: | + ================================================== + Run DBaaSCLI database move primary + ----------------- + {{ dbaascli_database_move_primary.stdout_lines | to_nice_yaml }} + ----------------- + {{ dbaascli_database_move_primary.cmd }} --rollback --sessionID {{ dbaascli_database_move_primary.stdout_lines | regex_findall('Session ID of the current execution is: (.*)') | first }} + ================================================== + when: dbaascli_database_move_primary is failed + + # - set_fact: + # dbaastools_log: "{{ dbaascli_database_move_primary.stdout | regex_search('Session log: (.+)' , '\\1') | first }}" + # when: + # - "'dbaascli execution completed' in dbaascli_database_move_primary.stdout" + + - name: Analyze DBaaSCLI log + include_tasks: log_analyze.yml + vars: + dbaastools_log: "{{ dbaascli_database_move_primary.stdout | regex_search('Session log: (.+)' , '\\1') | first }}" + when: + - dbaascli_database_move_primary is success + - "'dbaascli execution completed' in dbaascli_database_move_primary.stdout" + + diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/move_pdb.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/move_pdb.yml new file mode 100644 index 0000000..683ca5b --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/move_pdb.yml @@ -0,0 +1,59 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaaSCLI database move + become: True + ignore_errors: True + when: + - oracleHomeName is defined + - database_config.db_role is defined + - ansible_hostname in database_config.master_node + block: + + - name: Run DBaaSCLI pdb move primary + command: > + dbaascli pdb relocate + --db_name {{ db_name }} + --pdb_name {{ pdb_name }} + --sourceDBConnectionString {{ sourceDBConnectionString }} + --relocateAvailabilityType MAX + --dbca_additional_args "-skipDatapatch" + register: dbaascli_pdb_move_primary + when: + - database_config.db_role == 'primary' + failed_when: "'dbaascli execution completed' not in dbaascli_pdb_move_primary.stdout" + + - debug: + msg: "{{ output | split('\n') }}" + vars: + output: | + ================================================== + Run DBaaSCLI pdb move primary + ----------------- + {{ dbaascli_pdb_move_primary.stdout_lines | to_nice_yaml }} + ================================================== + # when: dbaascli_pdb_move_primary is failed + + # - set_fact: + # dbaastools_log: "{{ dbaascli_database_move_primary.stdout | regex_search('Session log: (.+)' , '\\1') | first }}" + # when: + # - "'dbaascli execution completed' in dbaascli_database_move_primary.stdout" + + - name: Analyze DBaaSCLI log + include_tasks: log_analyze.yml + vars: + dbaastools_log: "{{ dbaascli_pdb_move_primary.stdout | regex_search('Session log: (.+)' , '\\1') | first }}" + when: + - dbaascli_pdb_move_primary is success + - "'dbaascli execution completed' in dbaascli_pdb_move_primary.stdout" + + diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/pdb_move.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/pdb_move.yml new file mode 100644 index 0000000..65aaf26 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/dbaascli/pdb_move.yml @@ -0,0 +1,194 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaaSCLI PDB move + become: false + ignore_errors: true + when: + - database_config.db_name == target_db_name + - database_config.db_role is defined + - database_config.db_role == "primary" + - ansible_hostname in database_config.master_node + block: + + - name: Write timeline into csv file + lineinfile: + insertafter: EOF + dest: "{{ stage_dir.control.workdir }}/run_timeline.csv" + line: "{{ sysdate }},Framework,{{ ansible_hostname }},{{ task_name }},{{ status }}" + delegate_to: "{{ swingbench_server }}" + when: "'framework' in ansible_run_tags" + vars: + task_name: "DBaaSCLI_pdb_move_prereqs" + status: "running" + + - name: Run DBaaSCLI pdb move prereqs + become: True + vars: + sourceDBConnectionString_query: "{{ target_db_name }}.sourceDBConnectionString" + expect: + command: > + dbaascli pdb relocate + --pdb_name {{ pdb_name }} + --db_name {{ db_name }} + --sourceDBConnectionString {{ pdbm | json_query(sourceDBConnectionString_query) }} + --relocateAvailabilityType MAX + --dbca_additional_args "-skipDatapatch" + --prereqs + responses: + Enter REMOTE_DB_SYS_PASSWORD: "{{ db_sys_password }}" + Enter REMOTE_DB_SYS_PASSWORD (reconfirmation): "{{ db_sys_password }}" + timeout: 3600 + register: dbaascli_pdb_move_prereqs + failed_when: "'dbaascli execution completed' not in dbaascli_pdb_move_prereqs.stdout" + + - name: Run DBaaSCLI pdb delete + become: True + command: > + dbaascli pdb delete + --db_name {{ db_name }} + --pdb_name {{ pdb_name }} + register: dbaascli_pdb_delete + when: + - dbaascli_pdb_move_prereqs is failed + - "'DBT-19409' in dbaascli_pdb_move_prereqs.stdout" + # [FATAL] [DBT-19409] There is an already existing PDB (PDB001) with the same GUID of the specified remote PDB. + failed_when: + - "'dbaascli execution completed' not in dbaascli_pdb_delete.stdout" + + - name: Run DBaaSCLI pdb move executeFixups + become: True + vars: + sourceDBConnectionString_query: "{{ target_db_name }}.sourceDBConnectionString" + expect: + command: > + dbaascli pdb relocate + --pdb_name {{ pdb_name }} + --db_name {{ db_name }} + --sourceDBConnectionString {{ pdbm | json_query(sourceDBConnectionString_query) }} + --relocateAvailabilityType MAX + --dbca_additional_args "-skipDatapatch" + --prereqs + responses: + Enter REMOTE_DB_SYS_PASSWORD: "{{ db_sys_password }}" + Enter REMOTE_DB_SYS_PASSWORD (reconfirmation): "{{ db_sys_password }}" + timeout: 3600 + register: dbaascli_pdb_move_executeFixups + when: + - dbaascli_pdb_move_prereqs is failed + failed_when: "'dbaascli execution completed' not in dbaascli_pdb_move_executeFixups.stdout" + + - name: Write timeline into csv file + lineinfile: + insertafter: EOF + dest: "{{ stage_dir.control.workdir }}/run_timeline.csv" + line: "{{ sysdate }},Framework,{{ ansible_hostname }},{{ task_name }},{{ status }}" + delegate_to: "{{ swingbench_server }}" + when: "'framework' in ansible_run_tags" + vars: + task_name: "DBaaSCLI_pdb_move_prereqs" + status: "finished" + + - name: Write timeline into csv file + lineinfile: + insertafter: EOF + dest: "{{ stage_dir.control.workdir }}/run_timeline.csv" + line: "{{ sysdate }},Framework,{{ ansible_hostname }},{{ task_name }},{{ status }}" + delegate_to: "{{ swingbench_server }}" + when: "'framework' in ansible_run_tags" + vars: + task_name: "DBaaSCLI_pdb_move" + status: "running" + + - name: OCI DNS record domain update + command: >- + oci dns record domain update + --compartment-id {{ pdbm.compartment_id }} + --zone-name-or-id {{ pdbm.zone_name_or_id }} + --domain {{ pdbm.domain}} + --from-json "file://{{ pdbm.from_json.start }}" + --force + when: ((dbaascli_pdb_move_executeFixups is success) or (dbaascli_pdb_move_executeFixups is skipped)) + register: dns_record_domain_update_star + + - name: Run DBaaSCLI pdb move primary + become: True + vars: + sourceDBConnectionString_query: "{{ target_db_name }}.sourceDBConnectionString" + expect: + command: > + dbaascli pdb relocate + --pdb_name {{ pdb_name }} + --db_name {{ db_name }} + --sourceDBConnectionString {{ pdbm | json_query(sourceDBConnectionString_query) }} + --relocateAvailabilityType MAX + --dbca_additional_args "-skipDatapatch" + responses: + Enter REMOTE_DB_SYS_PASSWORD: "{{ db_sys_password }}" + Enter REMOTE_DB_SYS_PASSWORD (reconfirmation): "{{ db_sys_password }}" + timeout: 3600 + when: + - ((dbaascli_pdb_move_executeFixups is success) or (dbaascli_pdb_move_executeFixups is skipped)) + - dns_record_domain_update_star is success + register: dbaascli_pdb_move_primary + failed_when: "'dbaascli execution completed' not in dbaascli_pdb_move_primary.stdout" + + - name: OCI DNS record domain update + command: > + oci dns record domain update + --compartment-id {{ pdbm.compartment_id }} + --zone-name-or-id {{ pdbm.zone_name_or_id }} + --domain {{ pdbm.domain}} + --from-json "file://{{ pdbm.from_json.final }}" + --force + when: dns_record_domain_update_star is success + register: dns_record_domain_update_final + + - name: Write timeline into csv file + lineinfile: + insertafter: EOF + dest: "{{ stage_dir.control.workdir }}/run_timeline.csv" + line: "{{ sysdate }},Framework,{{ ansible_hostname }},{{ task_name }},{{ status }}" + delegate_to: "{{ swingbench_server }}" + when: "'framework' in ansible_run_tags" + vars: + task_name: "DBaaSCLI_pdb_move" + status: "finished" + + - debug: + msg: "{{ output | split('\n') }}" + vars: + output: | + ================================================== + Run DBaaSCLI pdb move primary + ----------------- + {{ dbaascli_pdb_move_primary.stdout_lines | to_nice_yaml }} + ================================================== + + - name: Add DBaaSCLI pdb move primary to story + set_fact: + story: "{{ story | default([]) + [dbaascli_pdb_move_primary.stdout_lines | to_nice_yaml] }}" + + # - set_fact: + # dbaastools_log: "{{ dbaascli_database_move_primary.stdout | regex_search('Session log: (.+)' , '\\1') | first }}" + # when: + # - "'dbaascli execution completed' in dbaascli_database_move_primary.stdout" + + - name: Analyze DBaaSCLI log + include_tasks: log_analyze.yml + vars: + dbaastools_log: "{{ dbaascli_pdb_move_primary.stdout | regex_search('Session log: (.+)' , '\\1') | first }}" + when: + - dbaascli_pdb_move_primary is success + - "'dbaascli execution completed' in dbaascli_pdb_move_primary.stdout" + + diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/database/delete/dbaasca.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/delete/dbaasca.yml new file mode 100644 index 0000000..fe8acab --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/delete/dbaasca.yml @@ -0,0 +1,157 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Standby DB Block + delegate_to: localhost + delegate_facts: true + when: database_config.db_role == 'physical_standby' + block: + + - name: Set standby facts + ansible.builtin.set_fact: + standby: + db_unique_name: "{{ database_config.db_unique_name }}" + db_domain: "{{ database_config.db_domain }}" + +- name: DG Block + become: true + become_user: oracle + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + environment: "{{ oracle_env }}" + when: + - hostvars['localhost']['standby']['db_unique_name'] is defined + - database_config.db_role == 'primary' + block: + + - name: DBaasCA deregisterStandby + command: > + {{ dbaasca }} + -silent + -configureDatabase + -deregisterStandby + -dgTNSNamesoraFilePath {% if acfs_mount_point is defined %}{{ acfs_mount_point }}/{{ db_name }}{% else %}{{ database_config.oracle_home }}/network/admin{% endif %} + -sourceDB {{ database_config.db_unique_name }} + -standbydb_unique_name {{ hostvars['localhost']['standby']['db_unique_name'] }} + -standbydb_domain {{ hostvars['localhost']['standby']['db_domain'] }} + register: deregisterStandby_output + timeout: 300 + failed_when: false + ignore_errors: true + # - deregisterStandby_output.failed is true + # - "'The command action failed to execute in the expected time frame' not in deregisterStandby_output.msg" + + - debug: + msg: "{{ output | regex_findall('([^\n,]+)') | default('Database not found') }}" + vars: + output: | + ================================================== + DBaasCA deregisterStandby + ----------------- + {{ deregisterStandby_output.stdout }} + ================================================== + when: deregisterStandby_output.changed + +- name: Standby Block + become: true + become_user: oracle + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + environment: "{{ oracle_env }}" + when: + - "'standby' in ansible_run_tags" + - database_config.db_role == 'physical_standby' + block: + + - name: Standby - Validate DG configuration + shell: "{{ database_config.oracle_home }}/bin/dgmgrl / 'show configuration' -json" + register: dgmgrl_show_config + failed_when: false + + - name: Standby - DBaasCA deleteDatabase + expect: + command: > + {{ dbca }} + -deleteDatabase + -silent + -sourceDB {% if database_config.db_type == 'rac' %}{{ database_config.db_unique_name }}{% else %}{{ database_config.instance_name }}{% endif %} + -sysDBAUserName {{ db_sys_user }} + -forceArchiveLogDeletion + responses: + (?i)password: "{{ db_sys_password }}" + timeout: 3600 + register: deleteDatabase_standby_output + # when: "'Configuration details cannot be determined by DGMGRL' in dgmgrl_show_config.stdout" + # failed_when: "'Database deletion completed.' not in deleteDatabase_standby_output.stdout" + + - debug: + msg: "{{ output | regex_findall('([^\n,]+)') | default('Database not found') }}" + vars: + output: | + ================================================== + DBaasCA deleteDatabase Standby + ----------------- + {{ deleteDatabase_standby_output.stdout }} + ================================================== + when: deleteDatabase_standby_output.changed + + - name: Standby - Remove DB Env File + file: + path: "~/{{ db_name }}.env" + state: absent + +- name: Primary Block + become: true + become_user: oracle + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + environment: "{{ oracle_env }}" + when: + - "'primary' in ansible_run_tags" + - database_config.db_role == 'primary' + block: + + - name: Primary - DBaasCA deleteDatabase + expect: + command: > + {{ dbca }} + -deleteDatabase + -silent + -oui_internal + -sourceDB {{ if database_config.db_type == 'rac' | ternary(database_config.db_unique_name, database_config.instance_name ) }} + -sysDBAUserName {{ db_sys_user }} + -forceArchiveLogDeletion + responses: + (?i)password: "{{ db_sys_password }}" + timeout: 3600 + register: deleteDatabase_output + failed_when: "'Database deletion completed.' not in deleteDatabase_output.stdout" + # -sysDBAPassword {{ db_sys_password }} + + - debug: + msg: "{{ output | regex_findall('([^\n,]+)') | default('Database not found') }}" + vars: + output: | + ================================================== + DBaasCA deleteDatabase + ----------------- + {{ deleteDatabase_output.stdout }} + ================================================== + when: deleteDatabase_output.changed + + - name: Primary - Remove DB Env File + file: + path: "~/{{ db_name }}.env" + state: absent diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/database/delete/dbaascli.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/delete/dbaascli.yml new file mode 100644 index 0000000..6ec85c8 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/delete/dbaascli.yml @@ -0,0 +1,54 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaaSCLI database delete + become: true + throttle: 1 + when: + - database_config.db_role is defined + - ansible_hostname in database_config.master_node + block: + + - name: Run DBaaSCLI dataguard deregisterStandby + command: >- + dbaascli dataguard deregisterStandby + --db_name {{ db_name }} + --standbyDBUniqueName {{ database_config.db_unique_name }} + register: _dbaascli_database_delete_standby + failed_when: "'dbaascli execution completed' not in _dbaascli_database_delete_standby.stdout" + when: + - (('primary' in ansible_run_tags) or + ('standby' in ansible_run_tags)) + - database_config.db_role == "physical_standby" + + - name: Run DBaaSCLI database delete standby + command: >- + dbaascli database delete + --db_name {{ db_name }} + register: _dbaascli_database_delete_standby + failed_when: "'dbaascli execution completed' not in _dbaascli_database_delete_standby.stdout" + when: + - (('primary' in ansible_run_tags) or + ('standby' in ansible_run_tags)) + - database_config.db_role == "physical_standby" + + - name: Run DBaaSCLI database delete primary + command: >- + dbaascli database delete + --db_name {{ db_name }} + register: _dbaascli_database_delete_primary + failed_when: "'dbaascli execution completed' not in _dbaascli_database_delete_primary.stdout" + when: + - "'primary' in ansible_run_tags" + - database_config.db_role == "primary" + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/database/delete/main.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/delete/main.yml new file mode 100644 index 0000000..1fb5325 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/delete/main.yml @@ -0,0 +1,32 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Database delete + when: + - database_config.db_role + - ansible_hostname in database_config.master_node + block: + + - name: dbaasca database delete + ansible.builtin.include_tasks: dbaasca.yml + when: not system_config.dbaascli_on + + - name: dbaascli database delete + ansible.builtin.include_tasks: dbaascli.yml + when: system_config.dbaascli_on + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/database/main.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/main.yml new file mode 100644 index 0000000..53703db --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/database/main.yml @@ -0,0 +1,43 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: database + become: true + when: oracle_facts.system + block: + + - name: database delete + include_tasks: + file: delete/main.yml + apply: + tags: database_delete + with_items: "{{ db_name_list }}" + loop_control: + loop_var: db_name + tags: database_delete + + - name: database create + include_tasks: + file: create/main.yml + apply: + tags: database_create + with_items: "{{ db_name_list }}" + loop_control: + loop_var: db_name + tags: database_create + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/create/dbaasca.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/create/dbaasca.yml new file mode 100644 index 0000000..f56eb0b --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/create/dbaasca.yml @@ -0,0 +1,261 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Print Oracle Homes + become: true + block: + + - name: Install lxml + pip: + name: lxml + + - name: Read inventory.xml + community.general.xml: + path: "{{ oracle_facts.system.inventory_loc }}/ContentsXML/inventory.xml" + xpath: /INVENTORY/HOME_LIST/HOME + content: attribute + register: _inventory_xml + + - name: Get database full version + shell: "$ORACLE_HOME/bin/oraversion -compositeVersion" + become_user: oracle + environment: + ORACLE_HOME: "{{ __oracle_home.LOC }}" + with_items: "{{ _inventory_xml.matches | map(attribute='HOME') }}" + loop_control: + loop_var: __oracle_home + when: __oracle_home.CRS is not defined + register: _dbHome_opatch + + # - name: Get BUILD_LABEL + # shell: | + # grep 'use constant CATCONST_BUILD_LABEL' {{ __oracle_home }}/rdbms/admin/catconst.pm | awk -F"'" '{print $2 ",{{ __oracle_home }}"}' + # with_items: "{{ _inventory_xml.matches | map(attribute='HOME') | map(attribute='LOC') }}" + # loop_control: + # loop_var: __oracle_home + # when: "'product' in __oracle_home" + # register: _catconst_build_label + + - name: Write facts OracleHome_facts + ansible.builtin.set_fact: + cacheable: false + OracleHome_facts: "{{ OracleHome_facts | default({}) | combine(_OracleHome_facts | items2dict) }}" + when: + - _dbHome_opatch.changed|bool + - __dbHome_lspatches.stdout is defined + vars: + _OracleHome_facts: + - key: "dbHome_{{ __dbHome_lspatches.__oracle_home.IDX }}" + value: + homeName: "{{ __dbHome_lspatches.__oracle_home.NAME }}" + homePath: "{{ __dbHome_lspatches.__oracle_home.LOC }}" + version: "{{ __dbHome_lspatches.stdout }}" + # version: "{{ __dbHome_lspatches.stdout | regex_findall('Database Release Update : (.+) ') | first | split(' ') | first }}" + with_items: "{{ _dbHome_opatch.results }}" + loop_control: + loop_var: __dbHome_lspatches + + - name: Write fact _dbHomeTargetVersion_list + set_fact: + _dbHomeTarget_list: "{{ OracleHome_facts | to_json | from_json | json_query(dbHomeTarget_query) | sort(attribute='version',reverse=true) }}" + vars: + dbHomeTarget_query: "*.{version: version, homePath: homePath}" + + - name: Write fact oracleHomePath + ansible.builtin.set_fact: + oracleHomePath: "{{ __dbHomeTargetPath_latest.homePath | default('There are no homes registered in the system') }}" + vars: + __dbHomeTargetPath_latest: "{{ _dbHomeTarget_list | selectattr('version', 'search', version) | sort(attribute='version') | sort(attribute='homePath') | last }}" + + - debug: + msg: "{{ output | split('\n') }}" + vars: + output: | + ================================================== + DBaasCA dbHome getDetails + ----------------- + oracleHomePath: {{ oracleHomePath }} + ================================================== + tags: [print_action] + + # - name: Show BUILD_LABEL + # debug: + # msg: "{{ __oracle_home.LOC }}" + # with_items: "{{ _inventory_xml.matches | map(attribute='HOME') }}" + # loop_control: + # loop_var: __oracle_home + # when: __oracle_home.CRS is not defined + + # - name: Get BUILD_LABEL + # shell: | + # x=$(grep 'use constant CATCONST_BUILD_LABEL' {{ __oracle_home.LOC }}/rdbms/admin/catconst.pm | awk -F"'" '{print $2 ",{{ __oracle_home.LOC }}"}') + # y={{ __oracle_home.NAME }} + # echo $x $y | sed "s/ /,/g" + # with_items: "{{ _inventory_xml.matches | map(attribute='HOME') }}" + # loop_control: + # loop_var: __oracle_home + # when: __oracle_home.CRS is not defined + # register: _catconst_build_label + + # - name: Show an attribute value + # ansible.builtin.debug: + # var: _catconst_build_label + # when: _catconst_build_label is defined + + # - name: Write fact _dbHomeTargetVersion from _catconst_build_label + # ansible.builtin.set_fact: + # _dbHomeTargetVersion: "{{ item.0 }}" + # _dbHomeTargetLoc: "{{ item.1 }}" + # _dbHomeTargetName: "{{ item.2 }}" + # with_items: "{{ _catconst_build_label.stdout_lines | split(',') }}" + # when: + # - version is defined + # - _catconst_build_label is defined + # - _version in item + + # - name: Read Home from inventory.xml + # community.general.xml: + # path: inventory.xml + # xpath: /INVENTORY/HOME_LIST/HOME[@CRS='true'] + # content: attribute + # register: _inventory_xml + +# - name: Check if Oracle is already installed +# shell: "grep {{ targetHome }} {{ inventory_loc }}/ContentsXML/inventory.xml | wc -l" +# register: stat_oracle + +# - name: Delete targetHome directory +# file: +# path: "{{ targetHome }}" +# state: absent +# when: +# - stat_oracle.stdout|int == 0 +# - "'force' in ansible_run_tags" + +# - name: DBaaSCA GIaaS download +# block: + +# - name: Create directories +# file: +# path: "{{ item }}" +# state: directory +# mode: '0755' +# owner: oracle +# group: oinstall +# loop: +# - "{{ stage_dir }}" +# when: ansible_hostname == preferred_node + +# - name: Find checksums of files on the server +# ansible.builtin.stat: +# path: "{{ stage_dir }}/{{ goldImage }}" +# checksum_algorithm: sha256 +# get_checksum: yes +# register: remote_stat_checksum +# changed_when: false +# when: ansible_hostname == preferred_node + +# - name: Download file with check (sha256) +# ansible.builtin.get_url: +# url: "{{ GIaaS_url }}" +# dest: "{{ stage_dir }}" +# checksum: "{{ GIaaS_checksum }}" +# validate_certs: no +# mode: '0755' +# owner: oracle +# group: oinstall +# environment: +# CRYPTOGRAPHY_OPENSSL_NO_LEGACY: '1' +# when: +# - ansible_hostname == preferred_node +# - remote_stat_checksum.stat.checksum|default('no_output') != GIaaS_checksum|split(':')|last + +# become: true +# when: stat_oracle.stdout|int == 0 + +# - name: DBaaSCA dbhome create +# block: + +# - name: Create directories +# file: +# path: "{{ item }}" +# state: directory +# mode: '0755' +# owner: oracle +# group: oinstall +# loop: +# - "{{ targetHome }}" +# when: ansible_hostname == preferred_node + +# - name: Unarchive DB Files +# ansible.builtin.unarchive: +# src: "{{ stage_dir }}/{{ goldImage }}" +# dest: "{{ targetHome }}" +# owner: oracle +# group: oinstall +# remote_src: yes +# environment: +# CRYPTOGRAPHY_OPENSSL_NO_LEGACY: '1' +# when: ansible_hostname == preferred_node + +# - name: Install Oracle Database prereqs +# become_user: oracle +# shell: > +# {{ targetHome }}/runInstaller +# -setupDBHome +# -silent +# -responseFile {{ targetHome }}/install/response/db_install.rsp +# -INVENTORY_LOCATION {{ inventory_loc }} +# -ORACLE_BASE {{ (inventory_loc | split('oraInventory') | first)[:-1] }}/oracle +# -OSDBA {{ inst_group }} +# -OSOPER {{ inst_group }} +# -OSBACKUPDBA {{ inst_group }} +# -OSDGDBA {{ inst_group }} +# -OSKMDBA {{ inst_group }} +# -OSRACDBA {{ inst_group }} +# -clusterNodes {{ cluster_nodes }} +# -prereqs +# register: db_home_install_prereqs +# when: ansible_hostname == preferred_node +# failed_when: +# - "'Prerequisite checks ran successfully.' not in db_home_install_prereqs.stdout" +# - (db_home_install_prereqs.rc != 0) or db_home_install_prereqs.rc != 6 + +# - name: Install Oracle Database +# become_user: oracle +# shell: > +# {{ targetHome }}/runInstaller +# -setupDBHome +# -silent +# -responseFile {{ targetHome }}/install/response/db_install.rsp +# -INVENTORY_LOCATION {{ inventory_loc }} +# -ORACLE_BASE {{ (inventory_loc | split('oraInventory') | first)[:-1] }}/oracle +# -OSDBA {{ inst_group }} +# -OSOPER {{ inst_group }} +# -OSBACKUPDBA {{ inst_group }} +# -OSDGDBA {{ inst_group }} +# -OSKMDBA {{ inst_group }} +# -OSRACDBA {{ inst_group }} +# -clusterNodes {{ cluster_nodes }} +# register: db_home_install +# when: +# - ansible_hostname == preferred_node +# - "'Prerequisite checks ran successfully.' in db_home_install_prereqs.stdout" +# failed_when: +# - "'Successfully Setup Software' not in db_home_install.stdout" +# - (db_home_install.rc != 0) or db_home_install.rc != 6 + +# - name: Run DB orainstRoot.sh +# command: "{{ targetHome }}/root.sh" + +# become: true +# when: stat_oracle.stdout|int == 0 \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/create/dbaascli.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/create/dbaascli.yml new file mode 100644 index 0000000..5de3cb3 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/create/dbaascli.yml @@ -0,0 +1,152 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Standby Block + block: + + - name: Set remaining hosts as not missing + ansible.builtin.set_fact: + dbtarget_success: true + + - name: Save job_report facts under Ansible controller + delegate_to: localhost + delegate_facts: true + set_fact: + dbtarget_list: '{{ hostvars | dict2items | json_query(dbtarget_query) }}' + vars: + dbtarget_query: "[?value.dbtarget_success==`true`].key" + + - name: Set target fact + ansible.builtin.set_fact: + targetHome: true + hostname_target: "{{ hostvars['localhost']['dbtarget_list'] | sort | first }}" + +- name: DBaaSCLI dbHome get version Block + block: + + - name: Verify you are using a supported Oracle Grid Infrastructure + ansible.builtin.assert: + that: + - oracle_facts.grid['activeVersion'] is version(version|split('.')|first, '>=') + success_msg: Oracle Grid Infrastructure {{ oracle_facts.grid['activeVersion'] }} supports database version {{ version }}. + fail_msg: Oracle Grid Infrastructure {{ oracle_facts.grid['activeVersion'] }} does not support database version {{ version }}. + + - name: DBaasCLI system getDBHomes + become: true + shell: > + dbaascli system getDBHomes + --showOutputDelimiter + | sed -n '/Start of output/, /End of output/{ /Start of output/! { /End of output/! p }}' + register: _dbaascli_system_getDBHomes + + - name: Write fact _OracleHome_facts from _dbaascli_database_getDetails + ansible.builtin.set_fact: + cacheable: false + _OracleHome_facts: "{{ _OracleHome_facts | default({}) | combine(_dbhome | items2dict) }}" + vars: + _dbhome: + - key: dbhome + value: "{{ _dbaascli_system_getDBHomes.stdout | from_json | community.general.json_query('*') }}" + when: + - _dbaascli_system_getDBHomes is defined + - _dbaascli_system_getDBHomes.stdout | length > 0 + + - name: Write fact _dbHomeTarget + ansible.builtin.set_fact: + _oracleHomeVersion: "{{ _OracleHome_facts | to_json | from_json | community.general.json_query(oracleHomeVersion_query) | sort | last | default('not_found') }}" + _oracleHomeName: "{{ _OracleHome_facts | to_json | from_json | community.general.json_query(oracleHomeName_query) | sort | last | default('not_found') }}" + _oracleHomePath: "{{ _OracleHome_facts | to_json | from_json | community.general.json_query(oracleHomePath_query) | sort | last | default('not_found') }}" + vars: + oracleHomeVersion_query: "dbhome[?starts_with(version,'{{ version }}')].version" + oracleHomeName_query: "dbhome[?starts_with(version,'{{ version }}')].homeName" + oracleHomePath_query: "dbhome[?starts_with(version,'{{ version }}')].homePath" + when: _OracleHome_facts is defined + + - name: Write fact oracleHomeName + ansible.builtin.set_fact: + oracleHomeName: "{{ _oracleHomeName }}" + when: + - _oracleHomeName is defined + - _oracleHomeName != 'no_oracle_home_found' + +- name: DBaaSCLI cswlib showImages Block + when: + - ((database_config.db_role is defined) or (targetHome is true)) + - ansible_hostname in hostname_target + # - ansible_hostname in grid_config.master_node + - version is defined + - ((oracleHomeName is not defined) or (oracleHomeName=='not_found')) + block: + + - name: DBaaSCLI cswlib showImages + become: true + shell: > + dbaascli cswlib showImages + | grep VERSION= | cut -d'=' -f2 | sort -u + # shell: "dbaascli cswlib showImages | grep VERSION= | cut -d'=' -f2 | sort -u | grep ^{{ version }}" + register: _dbaascli_cswlib_showImages + + - name: Write fact _oracleHomeVersion from _dbaascli_cswlib_showImages + ansible.builtin.set_fact: + _oracleHomeVersion: "{{ _dbaascli_cswlib_showImages.stdout_lines | select('search',version) | last }}" + when: _dbaascli_cswlib_showImages.stdout_lines | length > 0 + +- name: DBaaSCLI dbHome create Block + become: true + when: + - ((database_config.db_role is defined) or (targetHome is true)) + - ansible_hostname in hostname_target + # - ansible_hostname in grid_config.master_node + - ((oracleHomeName is not defined) or (oracleHomeName=='not_found')) + - _oracleHomeVersion is defined + block: + + - name: DBaaSCLI cswlib download + command: > + dbaascli cswlib download + --version {{ _oracleHomeVersion }} + register: _dbaascli_cswlib_download + failed_when: "'dbaascli execution completed' not in _dbaascli_cswlib_download.stdout" + + - name: DBaaSCLI dbHome create + shell: > + dbaascli dbHome create + --version {{ _oracleHomeVersion }} + register: _dbaascli_dbHome_create + when: _dbaascli_cswlib_download.changed|bool + failed_when: "'ORACLE_HOME_NAME' not in _dbaascli_dbHome_create.stdout" + + - name: Write fact _DBHomeTarget from _dbaascli_dbHome_create + ansible.builtin.set_fact: + oracleHomeName: "{{ _dbaascli_dbHome_create.stdout_lines | select('search','ORACLE_HOME_NAME') | last | from_json | community.general.json_query('ORACLE_HOME_NAME') }}" + oracleHomeVersion: "{{ _oracleHomeVersion }}" + oracleHomePath: "{{ _dbaascli_dbHome_create.stdout_lines | select('search','ORACLE_HOME') | last | from_json | community.general.json_query('ORACLE_HOME') }}" + when: _dbaascli_dbHome_create.changed|bool + ignore_errors: true + +- debug: + msg: "{{ output | split('\n') }}" + vars: + output: | + ================================================== + DBaasCLI dbHome getDetails + ----------------- + oracleHomeName: {{ oracleHomeName }} + oracleHomeVersion: {{ oracleHomeVersion | default(_oracleHomeVersion) }} + oracleHomePath: {{ oracleHomePath | default(_oracleHomePath) }} + ================================================== + when: + - ((database_config.db_role is defined) or (targetHome is true)) + - ansible_hostname in hostname_target + # - ansible_hostname in grid_config.master_node + - oracleHomeName is defined + tags: [print_action] \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/create/main.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/create/main.yml new file mode 100644 index 0000000..d2e3a2b --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/create/main.yml @@ -0,0 +1,31 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: database dbhome create + when: version is defined + tags: dbhome_create,database_create + block: + + - name: database dbhome create dbaasca + ansible.builtin.include_tasks: dbaasca.yml + when: not system_config.dbaascli_on + + - name: database dbhome create dbaascli + ansible.builtin.include_tasks: dbaascli.yml + when: system_config.dbaascli_on + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/delete/dbaascli.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/delete/dbaascli.yml new file mode 100644 index 0000000..dfdbdd6 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/delete/dbaascli.yml @@ -0,0 +1,126 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaaSCLI dbHome delete - version - Block + become: true + when: ansible_hostname in grid_config.master_node + block: + + - name: DBaasCLI system getDBHomes + become: true + shell: > + dbaascli system getDBHomes + --showOutputDelimiter + | sed -n '/Start of output/, /End of output/{ /Start of output/! { /End of output/! p }}' + register: _dbaascli_system_getDBHomes + + - name: Write fact _OracleHome_facts from _dbaascli_database_getDetails + ansible.builtin.set_fact: + cacheable: false + _OracleHome_facts: "{{ _OracleHome_facts | default({}) | combine(_dbhome | items2dict) }}" + vars: + _dbhome: + - key: dbhome + value: "{{ _dbaascli_system_getDBHomes.stdout | from_json | community.general.json_query('*') }}" + when: + - _dbaascli_system_getDBHomes is defined + - _dbaascli_system_getDBHomes.stdout | length > 0 + + - name: Write fact _dbHomeTarget + ansible.builtin.set_fact: + _oracleHomeVersion: "{{ _OracleHome_facts | to_json | from_json | community.general.json_query(oracleHomeVersion_query) | sort | last | default('no_oracle_home_found') }}" + _oracleHomeName: "{{ _OracleHome_facts | to_json | from_json | community.general.json_query(oracleHomeName_query) | sort | last | default('no_oracle_home_found') }}" + _oracleHomePath: "{{ _OracleHome_facts | to_json | from_json | community.general.json_query(oracleHomePath_query) | sort | last | default('no_oracle_home_found') }}" + vars: + oracleHomeVersion_query: "dbhome[?starts_with(version,'{{ version }}')].version" + oracleHomeName_query: "dbhome[?starts_with(version,'{{ version }}')].homeName" + oracleHomePath_query: "dbhome[?starts_with(version,'{{ version }}')].homePath" + when: + - version is defined + - _OracleHome_facts is defined + + - name: Write fact _dbHomeTarget + ansible.builtin.set_fact: + oracleHomeName: "{{ _oracleHomeName }}" + when: + - _oracleHomeName is defined + - _oracleHomeName != 'no_oracle_home_found' + +- name: DBaaSCLI dbHome delete - oracleHomePath - Block + become: true + when: + - ansible_hostname in grid_config.master_node + - oracleHomePath is defined + block: + + - name: DBaaSCLI dbHome getDetails + shell: > + dbaascli dbHome getDetails + {% if oracleHomeName is defined %}--oracleHomeName {{ oracleHomeName }}{% endif %} + {% if oracleHomePath is defined %}--oracleHome {{ oracleHomePath }}{% endif %} + --showOutputDelimiter + | sed -n '/Start of output/, /End of output/{ /Start of output/! { /End of output/! p }}' + register: dbaascli_dbHome_getdetails + failed_when: + - dbaascli_dbHome_getdetails.rc != 0 + - "'[FATAL] [DBAAS-60154]' not in dbaascli_dbHome_getdetails.stdout" + # [FATAL] [DBAAS-60154] Oracle home with the name 'OraHome5' not found in the inventory. + + - debug: var=dbaascli_dbHome_getdetails + + - name: Write fact _DBHomeTarget from _dbaascli_dbHome_create + ansible.builtin.set_fact: + oracleHomeName: "{{ dbaascli_dbHome_getdetails.stdout | from_json | community.general.json_query('homeName') }}" + oracleHomePath: "{{ dbaascli_dbHome_getdetails.stdout | from_json | community.general.json_query('homePath') }}" + when: + - oracleHomeName is not defined + - dbaascli_dbHome_getdetails.rc == 0 + +- name: DBaaSCLI dbHome delete - Block + become: true + when: + - ansible_hostname in grid_config.master_node + - oracleHomeName is defined + block: + + - name: DBaaSCLI dbHome getDatabases + shell: > + dbaascli dbHome getDatabases + --oracleHomeName {{ oracleHomeName }} + register: dbaascli_dbHome_getdatabases + failed_when: + - dbaascli_dbHome_getdatabases.rc != 0 + - "'[FATAL] [DBAAS-60154]' not in dbaascli_dbHome_getdatabases.stdout" + # [FATAL] [DBAAS-60154] Oracle home with the name 'OraHome5' not found in the inventory. + + - name: DBaaSCLI dbHome delete + shell: > + dbaascli dbHome delete + --oracleHomeName {{ oracleHomeName }} + register: dbaascli_dbHome_delete + when: + - "'[WARNING] [DBAAS-80101] Unable to get list of databases' in dbaascli_dbHome_getdatabases.stdout" + - "'CAUSE: There are no databases registered in the system' in dbaascli_dbHome_getdatabases.stdout" + failed_when: "'dbaascli execution completed' not in dbaascli_dbHome_delete.stdout" + + # - pause: + # seconds: 0 + # prompt: | + # ================================================== + # DBaaSCLI dbHome delete + # ----------------- + # {{ dbaascli_dbHome_delete.stdout | trim }} + # ================================================== + # when: dbaascli_dbHome_delete.changed + # tags: [print_action] + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/delete/main.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/delete/main.yml new file mode 100644 index 0000000..c9d9b3c --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/delete/main.yml @@ -0,0 +1,31 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: database dbhome delete + when: version is defined + tags: dbhome_delete + block: + + - name: database dbhome delete dbaasca + ansible.builtin.include_tasks: dbaasca.yml + when: not system_config.dbaascli_on + + - name: database dbhome delete dbaascli + ansible.builtin.include_tasks: dbaascli.yml + when: system_config.dbaascli_on + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/main.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/main.yml new file mode 100644 index 0000000..ebdc4fc --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/dbhome/main.yml @@ -0,0 +1,87 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: database dbhome + become: true + when: oracle_facts.system + block: + + - name: database dbhome delete + ansible.builtin.include_tasks: delete/main.yml + tags: dbhome_delete + + - name: database dbhome create + ansible.builtin.include_tasks: create/main.yml + tags: dbhome_create,database_create + + rescue: + + - name: End execution + meta: end_play + +# - name: DBaaSCLI Database Home Block +# become: true +# when: +# - oracle_facts.system.dbaascli_on +# block: + +# - name: DBaaSCLI dbHome create +# include_tasks: +# file: dbaascli/create.yml +# apply: +# tags: +# - dbhome_create +# - database_create +# - database_move +# with_items: "{{ db_name_list }}" +# loop_control: +# loop_var: db_name +# tags: +# - dbhome_create +# - database_create +# - database_move + +# - name: DBaaSCLI dbHome delete +# include_tasks: +# file: dbaascli/delete.yml +# apply: +# tags: +# - dbhome_delete +# with_items: "{{ db_name_list }}" +# loop_control: +# loop_var: db_name +# tags: +# - dbhome_delete + +# - name: DBaaSCA Database Home Block +# become: true +# when: +# - not oracle_facts.system.dbaascli_on +# block: + +# - name: DBaaSCA dbHome create +# include_tasks: +# file: dbaasca/create.yml +# apply: +# tags: +# - dbhome_create +# - database_create +# - database_move +# with_items: "{{ db_name_list }}" +# loop_control: +# loop_var: db_name +# tags: +# - dbhome_create +# - database_create +# - database_move + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/main copy.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/main copy.yml new file mode 100644 index 0000000..3335ffb --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/main copy.yml @@ -0,0 +1,149 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaaSCLI + become: true + when: + - oracle_facts.server.dbservers + # - db_name_list is defined + - system_config.dbaascli_on | bool + - grid_config.master_node in ansible_hostname + block: + + - name: AHF configure + import_tasks: ahf_configure.yml + tags: ahf_configure + + - name: dbaascli gridhome create + import_tasks: dbaascli_gridhome_create.yml + when: targetVersion is defined + tags: gridhome_create + + - name: dbaascli gridHome upgrade + import_tasks: dbaascli_gridhome_upgrade.yml + when: targetVersion is defined + tags: gridhome_upgrade + + - name: DBaaSCLI dbhome create + include_tasks: + file: dbaascli_dbhome_create.yml + apply: + tags: [dbhome_create, database_create] + with_items: "{{ db_name_list }}" + loop_control: + loop_var: db_name + # when: (ansible_hostname == primary_node|default('not defined')) or + # (ansible_hostname == standby_node|default('not defined')) + tags: + - dbhome_create + - database_create + + - name: DBaaSCLI database create + include_tasks: + file: dbaascli_database_create.yml + apply: + tags: database_create + with_items: "{{ db_name_list }}" + loop_control: + loop_var: db_name + # when: + # - database_config.db_role is not defined + # - ansible_hostname == primary_node + tags: database_create + + - name: dbaascli database move + include_tasks: + file: database_move.yml + apply: + tags: database_move + with_items: "{{ db_name_list }}" + loop_control: + loop_var: db_name + when: + - targetHome is defined + - db_role is defined + tags: database_move + + - name: DBaaSCLI command run + include_tasks: + file: dbaascli_command_run.yml + apply: + tags: dbaascli + with_items: "{{ db_name_list }}" + loop_control: + loop_var: db_name + when: + - dbaascli_command is defined + tags: dbaascli + + - name: DBaaSCLI database delete + include_tasks: + file: dbaascli_database_delete.yml + apply: + tags: [database_delete, database_delete_primary, database_delete_standby] + with_items: "{{ db_name_list }}" + loop_control: + loop_var: db_name + when: + - database_config.db_role is defined + tags: [database_delete, database_delete_primary, database_delete_standby] + +- name: DBaaSCA + become: true + when: + - oracle_facts.server.dbservers + # - db_name_list is defined + - not system_config.dbaascli_on | bool + - grid_config.master_node in ansible_hostname + block: + + - name: AHF configure + import_tasks: ahf_configure.yml + tags: ahf_configure + + - name: DBaaSCA dbhome create + include_tasks: + file: dbaasca_dbhome_create.yml + apply: + tags: [dbhome_create, database_create] + with_items: "{{ db_name_list }}" + loop_control: + loop_var: db_name + # when: (ansible_hostname == primary_node|default('not defined')) or + # (ansible_hostname == standby_node|default('not defined')) + tags: + - dbhome_create + - database_create + + - name: DBaaSCA database create + include_tasks: + file: dbaasca_database_create.yml + apply: + tags: database_create + with_items: "{{ db_name_list }}" + loop_control: + loop_var: _db_name + when: + - targetHome is defined + - db_role is not defined + - ansible_hostname == primary_node + tags: database_create + + - name: DBaaSCA database delete + include_tasks: + file: dbaasca_database_delete.yml + apply: + tags: [database_delete, database_delete_primary, database_delete_standby] + with_items: "{{ db_name_list }}" + loop_control: + loop_var: _db_name + tags: [database_delete, database_delete_primary, database_delete_standby] \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/main.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/main.yml new file mode 100644 index 0000000..8dbdd79 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/main.yml @@ -0,0 +1,25 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: database dbhome + when: + - database_list is defined + - oracle_facts.server.dbservers + block: + + - name: dbhome + import_tasks: dbhome/main.yml + + - name: database + import_tasks: database/main.yml + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tasks/timeline_log_write.yml b/playbooks/dbaas-ansible-collection/roles/database/tasks/timeline_log_write.yml new file mode 100644 index 0000000..4635798 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tasks/timeline_log_write.yml @@ -0,0 +1,22 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Timeline write log + lineinfile: + insertafter: EOF + dest: "{{ work_dir }}/run_timeline.csv" + line: "{{ sysdate }},Framework,{{ dbUniqueName }},{{ timeline_task_name }},{{ status }}" + delegate_to: localhost + become: false + when: "'framework' in ansible_run_tags" + ignore_errors: true + diff --git a/playbooks/dbaas-ansible-collection/roles/database/templates/output_getDBHomes.j2 b/playbooks/dbaas-ansible-collection/roles/database/templates/output_getDBHomes.j2 new file mode 100644 index 0000000..b605fa9 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/templates/output_getDBHomes.j2 @@ -0,0 +1,14 @@ +================================================== +DBaasCLI system getDBHomes +{% for host in ansible_play_hosts %} +{% if hostvars[host]['_oracleHomeVersion'] == 'no_oracle_home_found' %} +There are no homes version {{ version }} registered in the system. +{% else %} +----------------- + Hostname: {{ inventory_hostname }} + oracleHomeName: {{ hostvars[host]['_oracleHomeName'] }} + oracleHomeVersion: {{ hostvars[host]['_oracleHomeVersion'] }} + oracleHomePath: {{ hostvars[host]['_oracleHomePath'] }} +{% endif %} +{% endfor %} +================================================== \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/database/tests/inventory b/playbooks/dbaas-ansible-collection/roles/database/tests/inventory new file mode 100644 index 0000000..03ca42f --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tests/inventory @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +localhost + diff --git a/playbooks/dbaas-ansible-collection/roles/database/tests/test.yml b/playbooks/dbaas-ansible-collection/roles/database/tests/test.yml new file mode 100644 index 0000000..a635269 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/tests/test.yml @@ -0,0 +1,15 @@ +#SPDX-License-Identifier: MIT-0 +--- +- hosts: all + # remote_user: root + # roles: + # - dbaas + tasks: + + - debug: var=pdbm.{{ target_db_name }}.sourceDBConnectionString + + - debug: + msg: "{{ pdbm | json_query(sourceDBConnectionString_query) }}" + vars: + sourceDBConnectionString_query: "{{ target_db_name }}.sourceDBConnectionString" + diff --git a/playbooks/dbaas-ansible-collection/roles/database/vars/main.yml b/playbooks/dbaas-ansible-collection/roles/database/vars/main.yml new file mode 100644 index 0000000..787f6e5 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/database/vars/main.yml @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +--- +# vars file for dbaas diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/README.md b/playbooks/dbaas-ansible-collection/roles/dataguard/README.md new file mode 100644 index 0000000..225dd44 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/defaults/main.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/defaults/main.yml new file mode 100644 index 0000000..5af42a5 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/defaults/main.yml @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +--- +# defaults file for dataguard diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/handlers/main.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/handlers/main.yml new file mode 100644 index 0000000..804232a --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/handlers/main.yml @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +--- +# handlers file for dataguard diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/meta/main.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/meta/main.yml new file mode 100644 index 0000000..e68095d --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/meta/main.yml @@ -0,0 +1,27 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +galaxy_info: + role_name: dbaas + author: Sebastian Alasino + description: Oracle Database as a Service (DBAAS) + company: Oracle + + license: license (MIT) + + min_ansible_version: 2.14.0 + + galaxy_tags: + - oracle + - database + +dependencies: \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/main.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/main.yml new file mode 100644 index 0000000..f599ade --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/main.yml @@ -0,0 +1,104 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: dataguard configure + when: oracle_facts.server.dbservers + tags: configure + block: + + - name: prereqs + include_tasks: + file: prereqs/main.yml + apply: + tags: + - always + - prereqs + with_items: "{{ db_name_list }}" + loop_control: + loop_var: db_name + tags: always + + - name: DBaasCLI - Run Database Home create + ansible.builtin.include_role: + name: database + tasks_from: dbhome/create/dbaascli.yml + apply: + tags: + - always + - prereqs + vars: + version: "{{ hostvars['localhost']['primary']['oracle_home_version'] }}" + with_items: "{{ db_name_list }}" + loop_control: + loop_var: db_name + when: + - system_config.dbaascli_on + - hostname_target is defined + - ansible_hostname in hostname_target + tags: always + + - name: DBaasCA - Run Database Home create + ansible.builtin.include_role: + name: database + tasks_from: dbhome/create/dbaasca.yml + apply: + tags: + - always + - prereqs + vars: + version: "{{ hostvars['localhost']['primary']['oracle_home_version'] }}" + with_items: "{{ db_name_list }}" + loop_control: + loop_var: db_name + when: + - not system_config.dbaascli_on + - hostname_target is defined + - ansible_hostname in hostname_target + tags: always + + - name: primary prepare + include_tasks: + file: primary/main.yml + apply: + tags: + - primary_prepare + - configure + with_items: "{{ db_name_list }}" + loop_control: + loop_var: db_name + tags: always + + - name: standby configure + include_tasks: + file: standby/configure/main.yml + apply: + tags: + - standby_configure + - configure + with_items: "{{ db_name_list }}" + loop_control: + loop_var: db_name + tags: always + + - name: standby register + include_tasks: + file: standby/register/main.yml + apply: + tags: + - standby_configure + - configure + with_items: "{{ db_name_list }}" + loop_control: + loop_var: db_name + tags: always + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/prereqs/main.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/prereqs/main.yml new file mode 100644 index 0000000..855ded4 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/prereqs/main.yml @@ -0,0 +1,31 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Primary and Standby Block + block: + + - name: Install pexpect + pip: + name: pexpect + + - name: Primary + ansible.builtin.include_tasks: primary.yml + + - name: Standby + ansible.builtin.include_tasks: standby.yml + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/prereqs/primary.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/prereqs/primary.yml new file mode 100644 index 0000000..c637179 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/prereqs/primary.yml @@ -0,0 +1,79 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Primary Block + when: + - database_config.db_role + - database_config.db_role == 'primary' + - ansible_hostname in database_config.master_node + block: + + # - name: Discover database parameters + # shell: | + # {{ database_config.homePath }}/bin/sqlplus -L -F -SILENT -MARKUP "CSV ON QUOTE OFF DELIMITER :" -nologintime "/ as sysdba" << EOF + # set heading off + # select name,value + # from v\$parameter + # where name in ('processes','pga_aggregate_target','sga_target','db_recovery_file_dest_size'); + # exit + # EOF + # become: true + # become_user: "{{ oracle_user }}" + # become_flags: "--login" + # vars: + # ansible_shell_allow_world_readable_temp: true + # environment: "{{ oracle_env }}" + # register: _database_parameters + + - name: Set primary facts + delegate_to: localhost + delegate_facts: true + ansible.builtin.set_fact: + primary: + scan_name: "{{ grid_config.scan_name | default(database_config.master_node) }}" + scan_ip_addresses: "{{ grid_config.scan_ips | default(ansible_default_ipv4['address']) }}" + scan_port: "{{ grid_config.scan_port | default(oracle_facts.system.tnslsnr_port) }}" + db_unique_name: "{{ database_config.db_unique_name }}" + instance_name: "{{ database_config.instance_name }}" + db_type: "{{ database_config.db_type }}" + db_domain: "{{ database_config.db_domain }}" + pga_aggregate_target: "{{ database_config.pga_aggregate_target }}" + processes: "{{ database_config.processes }}" + sga_target: "{{ database_config.sga_target }}" + db_recovery_file_dest_size: "{{ database_config.db_recovery_file_dest_size }}" + oracle_home_version: "{{ database_config.oracle_home_version }}" + wallet_root: "{{ database_config.wallet_root }}" + + - debug: + msg: "{{ output | regex_findall('([^\n,]+)') }}" + vars: + output: | + ================================================== + Primary facts + ----------------- + {{ hostvars['localhost']['primary'] }} + ================================================== + when: hostvars['localhost']['primary'] is defined + + - name: Assert that primary facts are defined + ansible.builtin.assert: + quiet: true + that: + - hostvars['localhost']['primary'] is defined + fail_msg: "Primary facts are NOT defined" + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/prereqs/standby.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/prereqs/standby.yml new file mode 100644 index 0000000..b47d945 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/prereqs/standby.yml @@ -0,0 +1,70 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Standby Block + when: not database_config.db_role + block: + + - name: Set remaining hosts as not missing + ansible.builtin.set_fact: + dbtarget_success: true + + - name: Save job_report facts under Ansible controller + delegate_to: localhost + delegate_facts: true + set_fact: + dbtarget_list: '{{ hostvars | dict2items | json_query(dbtarget_query) }}' + vars: + dbtarget_query: "[?value.dbtarget_success==`true`].key" + + - name: Set target fact + ansible.builtin.set_fact: + targetHome: true + hostname_target: "{{ hostvars['localhost']['dbtarget_list'] | sort | first }}" + + - name: Set standby facts + delegate_to: localhost + delegate_facts: true + ansible.builtin.set_fact: + standby: + scan_name: "{{ grid_config.scan_name | default(hostname_target) }}" + scan_ip_addresses: "{{ grid_config.scan_ips | default(ansible_default_ipv4['address']) }}" + scan_port: "{{ grid_config.tnslsnr_port | default(oracle_facts.system.tnslsnr_port) }}" + db_unique_name: "{{ db_name }}_{{ db_unique_name_standby_suffix | default(inventory_hostname_short[-6:]) }}" + db_domain: "{{ hostvars['localhost']['primary']['db_domain'] }}" + when: ansible_hostname in hostname_target + + - debug: + msg: "{{ output | regex_findall('([^\n,]+)') }}" + vars: + output: | + ================================================== + Standby facts + ----------------- + {{ hostvars['localhost']['standby'] }} + ================================================== + when: ansible_hostname in hostname_target + tags: [print_action] + + - name: Assert that standby facts are defined + ansible.builtin.assert: + quiet: true + that: + - hostvars['localhost']['standby'] is defined + fail_msg: "Standby facts are NOT defined" + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/backup.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/backup.yml new file mode 100644 index 0000000..ac5d110 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/backup.yml @@ -0,0 +1,375 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaasCA Block + become: true + when: + - "'pilot' not in ansible_run_tags" + - not system_config.dbaascli + - database_config.db_role is defined + - database_config.db_role == 'primary' + - ansible_hostname in database_config.master_node + - hostvars['localhost']['primary'] is defined + - hostvars['localhost']['standby'] is defined + block: + + - name: Create remote stage_dir.managed.tmp + file: + path: "{{ stage_dir.managed.tmp }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + + - name: Create remote acfs_mount_point + file: + path: "{{ acfs_mount_point }}/{{ item }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + with_items: "{{ db_name_list }}" + + - name: Run DBaasCA prepareForStandby on primary DB + expect: + command: > + {{ dbaasca }} + -silent + -prepareForStandby + -configureDatabase + -dgTNSNamesoraFilePath {{ acfs_mount_point }}/{{ db_name }} + -sourceDB {% if database_facts[db_name].dbType == 'rac' %}{{ database_config.dbUniqueName }}{% else %}{{ database_config.instanceName }}{% endif %} + -standbyDBUniqueName {{ hostvars['localhost']['standby']['DBUniqueName'] }} + {% if database_facts[db_name].dbType == 'rac' %}-standbyScanName {{ hostvars['localhost']['standby']['ScanIPAddresses'] }}{% else %}-standbyHostName {{ hostvars['localhost']['standby']['HostIPAddress'] }}{% endif %} + {% if database_facts[db_name].dbType == 'rac' %}-standbyScanPort {{ hostvars['localhost']['standby']['ScanPort'] }}{% else %}-standbyListenerPort {{ hostvars['localhost']['standby']['HostPort'] }}{% endif %} + -standbyDBDomain {{ database_config.dbDomain }} + responses: + (?i)password: "{{ db_sys_password }}" + timeout: 3600 + register: prepareForStandby + no_log: true + # failed_when: "'Successfully created blob file' not in prepareForStandby.stdout" + become_user: oracle + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + environment: "{{ oracle_env }}" + ignore_errors: true + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + DBaasCA prepareForStandby + ----------------- + {{ prepareForStandby.cmd }} + ----------------- + {{ prepareForStandby.stdout }} + ================================================== + when: prepareForStandby is not skipped + + - shell: > + grep SEVERE `ls -t {{ oracle_facts.system.inventory_loc | dirname }}/oracle/cfgtoollogs/dbca/trace.log_* | head -n1` + register: prepareForStandby_error + when: prepareForStandby.failed + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + DBaasCA prepareForStandby_error + ----------------- + {{ prepareForStandby_error.stdout_lines }} + ================================================== + when: prepareForStandby.failed + failed_when: prepareForStandby.failed + + # - name: Find prepareForStandby files + # find: + # paths: "{{ stage_dir.managed.tmp }}" + # patterns: "{{ db_name }}_prepareForStandby.tar" + # register: prepareForStandby_files + # when: "'Successfully created blob file' in prepareForStandby.stdout" + + - name: Set prepareForStandby_files fact + delegate_to: localhost + delegate_facts: true + when: prepareForStandby is success + ansible.builtin.set_fact: + prepareForStandby_files: "{{ prepareForStandby.stdout_lines | select('search','Successfully created blob file:') | first | split(': ') | last }}" + + - name: Fetch prepareForStandby files + ansible.builtin.fetch: + src: "{{ hostvars['localhost']['prepareForStandby_files'] }}" + dest: "/tmp/" + flat: yes + when: prepareForStandby is success + + rescue: + + - name: End execution + meta: end_play + +- name: PILOT Block + become: true + when: + - "'pilot' in ansible_run_tags" + - not system_config.dbaascli + - database_config.db_role is defined + - database_config.db_role == 'primary' + - ansible_hostname in database_config.master_node + - hostvars['localhost']['primary'] is defined + - hostvars['localhost']['standby'] is defined + block: + + - name: Create remote stage_dir.managed.tmp + file: + path: "{{ stage_dir.managed.tmp }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + + - name: Create remote acfs_mount_point + file: + path: "{{ acfs_mount_point }}/{{ item }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + with_items: "{{ db_name_list }}" + + - name: Run PILOT prepareForStandby on primary DB + expect: + command: > + {{ pilot }} + -silent + -plugin prepare_db_for_standby_cloud + db_name="{{ db_name }}" + AGENT_DB_ID="00229ef0-d3da-4082-8ef0-d49768cac803" + DBAASAPI_JOB_ID="jobid-{{ lookup('ansible.builtin.password', '/dev/null', chars=['digits'], length=5) }}" + EXECUTE_PREREQS="{% if 'prereqs' in ansible_run_tags %}true{% else %}false{% endif %}" + IGNORE_PREREQ_FAILURE="false" + SKIP_PREREQS="false" + STANDBY_DB_UNIQUE_NAME="{{ hostvars['localhost']['standby']['DBUniqueName'] }}" + STANDBY_DB_DOMAIN="{{ hostvars['localhost']['standby']['DBDomain'] }}" + STANDBY_SERVICE_NAME="{{ hostvars['localhost']['standby']['DBUniqueName'] }}.{{ hostvars['localhost']['standby']['DBDomain'] }}" + STANDBY_SCAN_NAME="{% if database_facts[db_name].dbType == 'rac' %}{{ hostvars['localhost']['standby']['ScanName'] }}{% else %}{{ hostvars['localhost']['standby']['HostIPAddress'] }}{% endif %}" + STANDBY_SCAN_PORT="{% if database_facts[db_name].dbType == 'rac' %}{{ hostvars['localhost']['standby']['ScanPort'] }}{% else %}{{ hostvars['localhost']['standby']['HostPort'] }}{% endif %}" + PRIMARY_SCAN_NAME="{% if database_facts[db_name].dbType == 'rac' %}{{ hostvars['localhost']['primary']['ScanName'] }}{% else %}{{ hostvars['localhost']['primary']['HostIPAddress'] }}{% endif %}" + PRIMARY_SCAN_PORT="{% if database_facts[db_name].dbType == 'rac' %}{{ hostvars['localhost']['primary']['ScanPort'] }}{% else %}{{ hostvars['localhost']['primary']['HostPort'] }}{% endif %}" + -logDir /var/opt/oracle/log/{{ db_name }}/dataguard/prepareForStandby + -checkpointDir {{ database_config.basePath }}/cfgtoollogs/dbca/checkpoints/oracle/prepare_for_standby + responses: + (?i)password: "{{ db_sys_password }}" + timeout: 3600 + register: pilot_prepareForStandby + failed_when: "'Note: Prepare for Standby operation prechecks have been performed on the primary database' not in pilot_prepareForStandby.stdout" + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + PILOT prepareForStandby + ----------------- + {{ pilot_prepareForStandby.cmd }} + ----------------- + {{ pilot_prepareForStandby.stdout }} + ================================================== + when: pilot_prepareForStandby is not skipped + + - name: Set prepareForStandby_files fact + delegate_to: localhost + delegate_facts: true + when: pilot_prepareForStandby is success + ansible.builtin.set_fact: + prepareForStandby_files: "{{ pilot_prepareForStandby.stdout_lines | regex_findall(', the file (.+) needs to be copied') | first }}" + + - name: Fetch prepareForStandby files + ansible.builtin.fetch: + src: "{{ hostvars['localhost']['prepareForStandby_files'] }}" + dest: "/tmp/" + flat: yes + when: hostvars['localhost']['prepareForStandby_files'] is defined + + rescue: + + - name: End execution + meta: end_play + +- name: DBaasCLI prereqs Block + become: true + when: + - database_config.db_role is defined + - hostvars['localhost']['standby'] is defined + - database_config.db_role == 'primary' + - system_config.dbaascli_on is true + - ansible_hostname in database_config.master_node + - "'prereqs' in ansible_run_tags" + block: + + - name: Run DBaasCLI dataguard getDetails on primary DB + command: > + dbaascli dataguard getDetails + --db_name {{ db_name }} + register: dataguard_getDetails + failed_when: + - dataguard_getDetails.rc != 0 + - "'DBAAS-80035' not in dataguard_getDetails.stdout" + # [DBAAS-80035] The following database does not have Oracle Data Guard enabled + + - name: Run DBaasCLI dataguard enableMultipleStandbySupport on primary DB + command: > + dbaascli dataguard enableMultipleStandbySupport + --db_name {{ db_name }} + register: dataguard_enableMultipleStandbySupport + when: + - dataguard_getDetails is success + - "'dbaascli execution completed' in dataguard_getDetails.stdout" + + - name: Run DBaasCLI dataguard prepareForStandby prereqs on primary DB + expect: + command: > + dbaascli dataguard prepareForStandby + --db_name {{ db_name }} + --standbyDBUniqueName {{ hostvars['localhost']['standby']['DBUniqueName'] }} + --standbyScanIPAddresses {{ hostvars['localhost']['standby']['ScanIPAddresses'] }} + --standbyScanPort {{ hostvars['localhost']['standby']['ScanPort'] }} + --standbyDBDomain {{ hostvars['localhost']['standby']['DBDomain'] }} + --primaryScanIPAddresses {{ hostvars['localhost']['primary']['ScanIPAddresses'] }} + --primaryScanPort {{ grid_config.scanListenerTCPPorts }} + --prereqs + responses: + (?i)password: "{{ db_sys_password }}" + timeout: 3600 + register: prepareForStandby_prereqs + failed_when: + - "'dbaascli execution completed' not in prepareForStandby_prereqs.stdout" + + - name: Fetch prepareForStandby_prereqs_files files + ansible.builtin.fetch: + src: "{{ prepareForStandby_prereqs.stdout | regex_findall(', the file (.+) needs to be copied') | first }}" + dest: "/tmp/" + flat: yes + when: + - prepareForStandby_prereqs is success + - prepareForStandby_prereqs.stdout is defined + + - name: Set prepareForStandby_prereqs_files fact + delegate_to: localhost + delegate_facts: true + when: prepareForStandby_prereqs is success + ansible.builtin.set_fact: + prepareForStandby_prereqs_files: "{{ prepareForStandby_prereqs.stdout | regex_findall(', the file (.+) needs to be copied') | first | basename }}" + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + DBaasCLI prepareForStandby_prereqs + ----------------- + {{ prepareForStandby_prereqs.cmd }} + ----------------- + {{ prepareForStandby_prereqs.stdout }} + ================================================== + when: prepareForStandby_prereqs is not skipped + + rescue: + + - name: End execution + meta: end_play + +- name: DBaasCLI Block + become: true + when: + - database_config.db_role is defined + - hostvars['localhost']['standby'] is defined + - database_config.db_role == 'primary' + - system_config.dbaascli_on is true + - ansible_hostname in database_config.master_node + - "'prereqs' not in ansible_run_tags" + block: + + - name: Run DBaasCLI dataguard getDetails on primary DB + command: > + dbaascli dataguard getDetails + --db_name {{ db_name }} + register: dataguard_getDetails + failed_when: + - dataguard_getDetails.rc != 0 + - "'DBAAS-80035' not in dataguard_getDetails.stdout" + # [DBAAS-80035] The following database does not have Oracle Data Guard enabled + + - name: Run DBaasCLI dataguard enableMultipleStandbySupport on primary DB + command: > + dbaascli dataguard enableMultipleStandbySupport + --db_name {{ db_name }} + register: dataguard_enableMultipleStandbySupport + when: + - dataguard_getDetails is success + - "'dbaascli execution completed' in dataguard_getDetails.stdout" + + - name: Run DBaasCLI dataguard prepareForStandby on primary DB + expect: + command: > + dbaascli dataguard prepareForStandby + --db_name {{ db_name }} + --standbyDBUniqueName {{ hostvars['localhost']['standby']['DBUniqueName'] }} + --standbyScanIPAddresses {{ hostvars['localhost']['standby']['ScanIPAddresses'] }} + --standbyScanPort {{ hostvars['localhost']['standby']['ScanPort'] }} + --standbyDBDomain {{ hostvars['localhost']['standby']['DBDomain'] }} + --primaryScanIPAddresses {{ hostvars['localhost']['primary']['ScanIPAddresses'] }} + --primaryScanPort {{ grid_config.scanListenerTCPPorts }} + responses: + (?i)password: "{{ db_sys_password }}" + timeout: 3600 + register: prepareForStandby + failed_when: + - "'dbaascli execution completed' not in prepareForStandby.stdout" + + - name: Fetch prepareForStandby files + ansible.builtin.fetch: + src: "{{ prepareForStandby.stdout | regex_findall(', the file (.+) needs to be copied') | first }}" + dest: "/tmp/" + flat: yes + when: prepareForStandby is success + + - name: Set prepareForStandby_files fact + delegate_to: localhost + delegate_facts: true + when: prepareForStandby is success + ansible.builtin.set_fact: + prepareForStandby_files: "{{ prepareForStandby.stdout | regex_findall(', the file (.+) needs to be copied') | first | basename }}" + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + DBaasCLI prepareForStandby + ----------------- + {{ prepareForStandby.cmd }} + ----------------- + {{ prepareForStandby.stdout }} + ================================================== + when: prepareForStandby is not skipped + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/dbaasca.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/dbaasca.yml new file mode 100644 index 0000000..d5e3ecc --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/dbaasca.yml @@ -0,0 +1,121 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaasCA Block + become: true + block: + + - name: Create remote stage_dir.managed.tmp + file: + path: "{{ stage_dir.managed.tmp }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + + - name: Create remote acfs_mount_point + file: + path: "{{ acfs_mount_point }}/{{ item }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + with_items: "{{ db_name_list }}" + + - name: Run DBaasCA prepareForStandby on primary DB + expect: + command: > + {{ dbaasca }} + -silent + -prepareForStandby + -configureDatabase + {% if hostvars['localhost']['primary']['db_type'] == 'rac' %} + -sourceDB {{ database_config.db_unique_name }} + -dgTNSNamesoraFilePath {{ acfs_mount_point }}/{{ db_name }} + {% else %} + -sourceDB {{ database_config.instance_name }} + -dgTNSNamesoraFilePath {{ database_config.oracle_home }}/network/admin + {% endif %} + -standbyDBUniqueName {{ hostvars['localhost']['standby']['db_unique_name'] }} + -standbyScanName {{ hostvars['localhost']['standby']['scan_ip_addresses'] }} + -standbyScanPort {{ hostvars['localhost']['standby']['scan_port'] }} + -standbyDBDomain {{ database_config.db_domain }} + responses: + (?i)password: "{{ db_sys_password }}" + timeout: 3600 + register: prepareForStandby + # no_log: true + # failed_when: "'Successfully created blob file' not in prepareForStandby.stdout" + become_user: oracle + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + environment: "{{ oracle_env }}" + ignore_errors: true + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + DBaasCA prepareForStandby + ----------------- + {{ prepareForStandby.cmd }} + ----------------- + {{ prepareForStandby.stdout }} + ================================================== + when: prepareForStandby is not skipped + + - shell: > + grep SEVERE `ls -t {{ oracle_facts.system.inventory_loc | dirname }}/oracle/cfgtoollogs/dbca/trace.log_* | head -n1` + register: prepareForStandby_error + when: prepareForStandby.failed + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + DBaasCA prepareForStandby_error + ----------------- + {{ prepareForStandby_error.stdout_lines }} + ================================================== + when: prepareForStandby.failed + failed_when: prepareForStandby.failed + + # - name: Find prepareForStandby files + # find: + # paths: "{{ stage_dir.managed.tmp }}" + # patterns: "{{ db_name }}_prepareForStandby.tar" + # register: prepareForStandby_files + # when: "'Successfully created blob file' in prepareForStandby.stdout" + + - name: Set prepareForStandby_files fact + delegate_to: localhost + delegate_facts: true + when: prepareForStandby is success + ansible.builtin.set_fact: + prepareForStandby_files: "{{ prepareForStandby.stdout_lines | select('search','Successfully created blob file:') | first | split(': ') | last }}" + + - name: Fetch prepareForStandby files + ansible.builtin.fetch: + src: "{{ hostvars['localhost']['prepareForStandby_files'] }}" + dest: "{{ stage_dir.control.tmp }}/prepareForStandby_{{ db_name }}.zip" + flat: yes + when: prepareForStandby is success + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/dbaascli.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/dbaascli.yml new file mode 100644 index 0000000..1ce8202 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/dbaascli.yml @@ -0,0 +1,89 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaasCLI Block + become: true + block: + + - name: Run DBaasCLI dataguard getDetails on primary DB + command: > + dbaascli dataguard getDetails + --db_name {{ db_name }} + register: dataguard_getDetails + failed_when: + - dataguard_getDetails.rc != 0 + - "'DBAAS-80035' not in dataguard_getDetails.stdout" + # [DBAAS-80035] The following database does not have Oracle Data Guard enabled + + - name: Run DBaasCLI dataguard enableMultipleStandbySupport on primary DB + command: > + dbaascli dataguard enableMultipleStandbySupport + --db_name {{ db_name }} + register: dataguard_enableMultipleStandbySupport + when: + - not "'prereqs' in ansible_run_tags" + - dataguard_getDetails is success + - "'dbaascli execution completed' in dataguard_getDetails.stdout" + + - name: Run DBaasCLI dataguard prepareForStandby on primary DB + expect: + command: > + dbaascli dataguard prepareForStandby + --db_name {{ db_name }} + --standbyDBUniqueName {{ hostvars['localhost']['standby']['db_unique_name'] }} + --standbyScanIPAddresses {{ hostvars['localhost']['standby']['scan_ip_addresses'] }} + --standbyScanPort {{ hostvars['localhost']['standby']['scan_port'] }} + --standbyDBDomain {{ hostvars['localhost']['standby']['db_domain'] }} + --primaryScanIPAddresses {{ hostvars['localhost']['primary']['scan_ip_addresses'] }} + --primaryScanPort {{ hostvars['localhost']['primary']['scan_port'] }} + {% if 'prereqs' in (ansible_run_tags|lower) %}--executePrereqs{% endif %} + responses: + (?i)password: "{{ db_sys_password }}" + timeout: 3600 + register: prepareForStandby + failed_when: "'dbaascli execution completed' not in prepareForStandby.stdout" + ignore_errors: true + + - name: Fetch prepareForStandby files + ansible.builtin.fetch: + src: "{{ prepareForStandby.stdout | regex_findall(', the file (.+) needs to be copied') | first }}" + dest: "{{ stage_dir.control.tmp }}/prepareForStandby_{{ db_name }}.zip" + flat: yes + when: prepareForStandby is success + + # - name: Set prepareForStandby_files fact + # delegate_to: localhost + # delegate_facts: true + # when: prepareForStandby is success + # ansible.builtin.set_fact: + # prepareForStandby_files: "{{ prepareForStandby.stdout | regex_findall(', the file (.+) needs to be copied') | first | basename }}" + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + DBaasCLI prepareForStandby + ----------------- + {{ prepareForStandby.cmd }} + ----------------- + {{ prepareForStandby.stdout }} + ================================================== + when: prepareForStandby is not skipped + failed_when: prepareForStandby.failed + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/lvm.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/lvm.yml new file mode 100644 index 0000000..e2d91a5 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/lvm.yml @@ -0,0 +1,89 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: LVM Block + become: true + ignore_errors: true + block: + + - name: Create remote stage_dir.managed.tmp + file: + path: "{{ stage_dir.managed.tmp }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + + - name: Execute SQL command + shell: | + {{ database_config.homePath }}/bin/sqlplus -L -F -SILENT -MARKUP "CSV ON QUOTE OFF" -nologintime "/ as sysdba" << EOF + set heading OFF + set feedback OFF + {{ item.sql }} + exit + EOF + become: true + become_user: "{{ oracle_user }}" + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + environment: "{{ oracle_env }}" + register: sql_command_output + with_items: + - { query: 'max_bytes' , sql: 'select max(bytes) max_bytes from v\$log;' } + - { query: 'max_group' , sql: 'select max(group#) max_group from v\$log;' } + - { query: 'number_logs' , sql: 'select count(*) number_logs from v\$log;' } + - { query: 'max_standby_group' , sql: 'select max(group#) max_standby_group from v\$standby_log;' } + - { query: 'number_standby_logs' , sql: 'select count(*) number_standby_logs from v\$standby_log;' } + + - name: Generate location_quoted + set_fact: + location_quoted: | + {% set g = namespace(comm0 = '', comma = '') -%} + + {# Header #} + {%- for item in sql_command_output.results -%} + {{ item.item.query }}{{ "," if not loop.last }} + {%- endfor %} + + {# Rows #} + {%- for item in sql_command_output.results -%} + {{ item.stdout }}{{ "," if not loop.last }} + {%- endfor %} + # {% for item in sql_command_output.results %} + # {{ item.item.query }}{{ "," if not loop.last }} + # {{ item.stdout_lines | first }}{{ "," if not loop.last }} + # {% endfor %} + + - name: Parse a CSV file's contents + ansible.builtin.debug: + msg: >- + {{ location_quoted | community.general.from_csv | map(attribute='number_logs') }} + + - name: Parse a CSV file's contents + ansible.builtin.debug: + msg: >- + {{ location_quoted | community.general.from_csv | map(attribute='number_logs') | flatten }} + + # - name: Fetch prepareForStandby files + # ansible.builtin.fetch: + # src: "{{ hostvars['localhost']['prepareForStandby_files'] }}" + # dest: "{{ stage_dir.control.tmp }}/prepareForStandby_{{ db_name }}.zip" + # flat: yes + # when: prepareForStandby is success + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/main.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/main.yml new file mode 100644 index 0000000..83d01b8 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/main.yml @@ -0,0 +1,50 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: prepareForStandby + when: + - database_config.db_role is defined + - database_config.db_role == 'primary' + - ansible_hostname in database_config.master_node + - hostvars['localhost']['primary'] is defined + - hostvars['localhost']['standby'] is defined + block: + + - name: DBaasCA + ansible.builtin.include_tasks: dbaasca.yml + when: + - not system_config.dbaascli_on + - "'pilot' not in ansible_run_tags" + # - oracle_facts.system.crs_on + + - name: DBaasCLI + ansible.builtin.include_tasks: dbaascli.yml + when: system_config.dbaascli_on + + - name: PILOT + ansible.builtin.include_tasks: pilot.yml + when: + - "'pilot' in ansible_run_tags" + - not system_config.dbaascli_on + + # - name: LVM + # ansible.builtin.include_tasks: lvm.yml + # when: + # - not system_config.dbaascli_on + # - not oracle_facts.system.crs_on | default(false) + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/pilot.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/pilot.yml new file mode 100644 index 0000000..edbeb08 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/primary/pilot.yml @@ -0,0 +1,89 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: PILOT Block + become: true + block: + + - name: Create remote stage_dir.managed.tmp + file: + path: "{{ stage_dir.managed.tmp }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + + - name: Create remote acfs_mount_point + file: + path: "{{ acfs_mount_point }}/{{ item }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + with_items: "{{ db_name_list }}" + + - name: Run PILOT prepareForStandby on primary DB + expect: + command: > + {{ pilot }} + -silent + -plugin prepare_db_for_standby_cloud + db_name="{{ db_name }}" + AGENT_DB_ID="00229ef0-d3da-4082-8ef0-d49768cac803" + DBAASAPI_JOB_ID="jobid-{{ lookup('ansible.builtin.password', '/dev/null', chars=['digits'], length=5) }}" + EXECUTE_PREREQS="{% if 'prereqs' in ansible_run_tags %}true{% else %}false{% endif %}" + IGNORE_PREREQ_FAILURE="false" + SKIP_PREREQS="false" + STANDBY_DB_UNIQUE_NAME="{{ hostvars['localhost']['standby']['DBUniqueName'] }}" + STANDBY_DB_DOMAIN="{{ hostvars['localhost']['standby']['DBDomain'] }}" + STANDBY_SERVICE_NAME="{{ hostvars['localhost']['standby']['DBUniqueName'] }}.{{ hostvars['localhost']['standby']['DBDomain'] }}" + STANDBY_SCAN_NAME="{% if database_facts[db_name].dbType == 'rac' %}{{ hostvars['localhost']['standby']['ScanName'] }}{% else %}{{ hostvars['localhost']['standby']['HostIPAddress'] }}{% endif %}" + STANDBY_SCAN_PORT="{% if database_facts[db_name].dbType == 'rac' %}{{ hostvars['localhost']['standby']['ScanPort'] }}{% else %}{{ hostvars['localhost']['standby']['HostPort'] }}{% endif %}" + PRIMARY_SCAN_NAME="{% if database_facts[db_name].dbType == 'rac' %}{{ hostvars['localhost']['primary']['ScanName'] }}{% else %}{{ hostvars['localhost']['primary']['HostIPAddress'] }}{% endif %}" + PRIMARY_SCAN_PORT="{% if database_facts[db_name].dbType == 'rac' %}{{ hostvars['localhost']['primary']['ScanPort'] }}{% else %}{{ hostvars['localhost']['primary']['HostPort'] }}{% endif %}" + Validate_rpms_consistency="false" + Validate_SCAN_name_in_tnsnames_ora_file="false" + -logDir /var/opt/oracle/log/{{ db_name }}/dataguard/prepareForStandby + -checkpointDir {{ database_config.basePath }}/cfgtoollogs/dbca/checkpoints/oracle/prepare_for_standby + responses: + (?i)password: "{{ db_sys_password }}" + timeout: 3600 + register: pilot_prepareForStandby + ignore_errors: true + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + PILOT prepareForStandby + ----------------- + {{ pilot_prepareForStandby.cmd }} + ----------------- + {{ pilot_prepareForStandby.stdout }} + ================================================== + when: pilot_prepareForStandby is not skipped + failed_when: pilot_prepareForStandby.failed + + - name: Fetch prepareForStandby files + ansible.builtin.fetch: + src: "{{ pilot_prepareForStandby.stdout_lines | regex_findall(' the file (.+) needs to be copied') | first }}" + dest: "{{ stage_dir.control.tmp }}/prepareForStandby_{{ db_name }}.{{ pilot_prepareForStandby.stdout_lines | regex_findall(' the file (.+) needs to be copied') | first | split('.') | last }}" + flat: yes + when: pilot_prepareForStandby.rc == 0 + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/backup.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/backup.yml new file mode 100644 index 0000000..3c47cee --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/backup.yml @@ -0,0 +1,483 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaasCA configureStandby Block + become: true + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + throttle: 1 + when: + - "'pilot' not in ansible_run_tags" + - database_config.db_role is not defined + - ansible_hostname in hostname_target + - not oracle_facts.system.dbaascli + - hostvars['localhost']['primary'] is defined + - hostvars['localhost']['standby'] is defined + block: + + - name: Create remote stage_dir.managed.workdir + file: + path: "{{ stage_dir.managed.workdir }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + + - name: Create remote shared_dir + file: + path: "{{ item }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + with_items: + - "{{ acfs_mount_point }}/{{ db_name }}" + - "{{ acfs_mount_point }}/wallets/{{ hostvars['localhost']['standby']['DBUniqueName'] }}" + + - name: Copy prepareForStandby files + copy: + src: "/tmp/{{ hostvars['localhost']['prepareForStandby_files'] | basename }}" + dest: "{{ stage_dir.managed.workdir }}/" + owner: oracle + group: oinstall + mode: 0644 + register: copy_prepareForStandby_blob_file + + - name: Run DBaasCA configureStandby + expect: + command: > + {{ dbaasca }} + -silent + -createDuplicateDB + -createAsStandby + -configureStandby + -useActiveDatabaseDuplication false + -useOMF true + -adminManaged + {% if hostvars['localhost']['primary']['dbType'] == 'rac' %}-standbyScanName{% else %}-standbyHostName{% endif %} {{ grid_config.scan_ips }} + {% if hostvars['localhost']['primary']['dbType'] == 'rac' %}-standbyScanPort{% else %}-standbyListenerPort{% endif %} {{ grid_config.scanListenerTCPPorts }} + -gdb_name {{ db_name }} + -sid {{ db_name }} + -remoteDBConnString {{ hostvars['localhost']['primary']['ScanIPAddresses'] | split(',') | first }}:{{ hostvars['localhost']['primary']['HostPort'] }}/{{ hostvars['localhost']['primary']['DBUniqueName'] }}.{{ hostvars['localhost']['primary']['DBDomain'] }} + -nodelist {{ grid_config.cluster_nodes }} + -dgProtectionMode MAX_PERFORMANCE + -standbyTransportMode ASYNC + -configureActiveDG + -usedb_nameInPDBAlias + -standbyBlobFileLocFromPrimaryDB {{ copy_prepareForStandby_blob_file.dest }} + -dgTNSNamesoraFilePath {{ acfs_mount_point }}/{{ db_name }}/tnsnames.ora + -storageType ASM + -datafileDestination +{{ asm.diskgroup.data }} + -recoveryAreaDestination +{{ asm.diskgroup.reco }} + -recoveryAreaSize {{ hostvars['localhost']['primary']['db_recovery_file_dest_size'] | int | human_readable(unit='M') | split('.') | first }} + -initParams 'db_create_online_log_dest_1=+{{ asm.diskgroup.data }},os_authent_prefix="",processes={{ hostvars['localhost']['primary']['processes'] }},db_name={{ db_name }},pga_aggregate_target={{ hostvars['localhost']['primary']['pga_aggregate_target'] }},sga_target={{ hostvars['localhost']['primary']['sga_target'] }},db_domain={{ hostvars['localhost']['standby']['DBDomain'] }},db_unique_name={% if hostvars['localhost']['primary']['dbType'] %}{{ hostvars['localhost']['standby']['DBUniqueName'] }}{% else %}{{ hostvars['localhost']['standby']['instanceName'] }}{% endif %},inmemory_force=cellmemory_level' + -databaseConfigType {{ hostvars['localhost']['primary']['dbType'] }} + -honorNodeNumberToThread + -honorNodeNumberForInstance + -enableArchive true + -configureTDE true + -tdeWalletRoot {{ acfs_mount_point }}/wallets/{{ hostvars['localhost']['standby']['DBUniqueName'] }} + -primaryDBTdeWallet {{ hostvars['localhost']['primary']['walletLocation'] }} + -skipPasswordComplexityCheck true + -J-Dapplication.exceptions.severity=DBT-06012:WARNING,DBT-06604:WARNING,DBT-16008:WARNING + -J-Doracle.assistants.dbca.useStandardLogLocation=true + -jreLoc /usr/java/jdk-11 + responses: + (?i)password: "{{ db_sys_password }}" + timeout: 3600 + become_user: oracle + register: dbca_configureStandby + when: + - ansible_hostname in grid_config.master_node + failed_when: + - "'Running Recover_managed_standby job' not in dbca_configureStandby.stdout" + + - debug: + msg: "{{ output | regex_findall('([^\n,]+)') | default('Database not found') }}" + vars: + output: | + ================================================== + DBaasCA configureStandby + ----------------- + {{ dbca_configureStandby.cmd }} + ----------------- + {{ dbca_configureStandby.stdout }} + ================================================== + + - name: Delete remote stage_dir.managed.workdir + file: + path: "{{ stage_dir.managed.workdir }}" + state: absent + + rescue: + + - name: End execution + meta: end_play + +- name: PILOT configureStandby Block + become: true + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + throttle: 1 + when: + - "'pilot' in ansible_run_tags" + - database_config.db_role is not defined + - hostname_target is defined + - ansible_hostname in hostname_target + - not oracle_facts.system.dbaascli + - hostvars['localhost']['primary'] is defined + - hostvars['localhost']['standby'] is defined + block: + + - name: Create remote stage_dir.managed.workdir + file: + path: "{{ stage_dir.managed.workdir }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + + - name: Create remote shared_dir + file: + path: "{{ item }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + with_items: + - "{{ acfs_mount_point }}/{{ db_name }}" + - "{{ acfs_mount_point }}/wallets/{{ hostvars['localhost']['standby']['DBUniqueName'] }}" + - /var/opt/oracle/log/reg_tmp_files + + - name: Copy prepareForStandby files + copy: + src: "/tmp/{{ hostvars['localhost']['prepareForStandby_files'] | basename }}" + dest: /var/opt/oracle/log/reg_tmp_files + owner: oracle + group: oinstall + mode: 0644 + register: copy_prepareForStandby_blob_file + + - name: Run PILOT configure_standby_db_cloud + expect: + command: > + {{ pilot }} + -silent + -plugin configure_standby_db_cloud + DB_NAME="{{ db_name }}" + ORACLE_HOME="{{ oracleHomePath }}" + DB_UNIQUE_NAME="{{ hostvars['localhost']['standby']['DBUniqueName'] }}" + AGENT_DB_ID="00229ef0-d3da-4082-8ef0-d49768cac803" + DBAASAPI_JOB_ID="jobid-{{ lookup('ansible.builtin.password', '/dev/null', chars=['digits'], length=5) }}" + EXECUTE_PREREQS="{% if 'prereqs' in ansible_run_tags %}true{% else %}false{% endif %}" + IGNORE_PREREQ_FAILURE="false" + SKIP_PREREQS="false" + STANDBY_DB_UNIQUE_NAME="{{ hostvars['localhost']['standby']['DBUniqueName'] }}" + STANDBY_DB_DOMAIN="{{ hostvars['localhost']['standby']['DBDomain'] }}" + STANDBY_SERVICE_NAME="{{ hostvars['localhost']['standby']['DBUniqueName'] }}.{{ hostvars['localhost']['standby']['DBDomain'] }}" + STANDBY_SCAN_NAME="{% if hostvars['localhost']['primary']['dbType'] == 'rac' %}{{ hostvars['localhost']['standby']['ScanName'] }}{% else %}{{ hostvars['localhost']['standby']['HostIPAddress'] }}{% endif %}" + STANDBY_SCAN_PORT="{% if hostvars['localhost']['primary']['dbType'] == 'rac' %}{{ hostvars['localhost']['standby']['ScanPort'] }}{% else %}{{ hostvars['localhost']['standby']['HostPort'] }}{% endif %}" + PRIMARY_SERVICE_NAME="{{ hostvars['localhost']['primary']['DBUniqueName'] }}.{{ hostvars['localhost']['primary']['DBDomain'] }}" + PRIMARY_SCAN_NAME="{% if hostvars['localhost']['primary']['dbType'] == 'rac' %}{{ hostvars['localhost']['primary']['ScanName'] }}{% else %}{{ hostvars['localhost']['primary']['HostIPAddress'] }}{% endif %}" + PRIMARY_SCAN_PORT="{% if hostvars['localhost']['primary']['dbType'] == 'rac' %}{{ hostvars['localhost']['primary']['ScanPort'] }}{% else %}{{ hostvars['localhost']['primary']['HostPort'] }}{% endif %}" + NODE_LIST="{{ grid_config.cluster_nodes }}" + PROTECTION_MODE="MAX_PERFORMANCE" + TRANSPORT_TYPE="ASYNC" + ACTIVE_DG="TRUE" + STANDBY_DB_INFO_JSON="/var/opt/oracle/log/reg_tmp_files/{{ hostvars['localhost']['prepareForStandby_files'] | basename }}" + SGA_SIZE_IN_MB="{{ sga_size_in_mb | default(hostvars['localhost']['primary']['sga_target'] | int | human_readable(unit='M') | split('.') | first) }}" + PGA_SIZE_IN_MB="{{ pga_size_in_mb | default(hostvars['localhost']['primary']['pga_aggregate_target'] | int | human_readable(unit='M') | split('.') | first) }}" + DATAFILE_DESTINATION="{{ asm.diskgroup.data }}" + FRA_DESTINATION="{{ asm.diskgroup.reco }}" + REDO_LOG_DESTINATION="{{ asm.diskgroup.data }}" + FRA_SIZE_IN_MB="{{ hostvars['localhost']['primary']['db_recovery_file_dest_size'] | int | human_readable(unit='M') | split('.') | first }}" + -logDir /var/opt/oracle/log/{{ db_name }}/dataguard/prepareForStandby + -checkpointDir {{ oracleHomePath | dirname | dirname | dirname }}/cfgtoollogs/dbca/checkpoints/oracle/prepare_for_standby + responses: + (?i)password: "{{ db_sys_password }}" + timeout: 3600 + register: pilot_configure_standby_db_cloud + when: + - ansible_hostname in grid_config.master_node + # failed_when: + # - "'Running Recover_managed_standby job' not in dbca_configureStandby.stdout" + + - debug: var=pilot_configure_standby_db_cloud + + - debug: + msg: "{{ output | regex_findall('([^\n,]+)') | default('Database not found') }}" + vars: + output: | + ================================================== + PILOT pilot_configure_standby_db_cloud + ----------------- + {{ pilot_configure_standby_db_cloud.cmd }} + ----------------- + {{ pilot_configure_standby_db_cloud.stdout }} + ================================================== + + - name: Delete remote stage_dir.managed.workdir + file: + path: "{{ stage_dir.managed.workdir }}" + state: absent + + rescue: + + - name: End execution + meta: end_play + +- name: DBaasCLI configureStandby prereqs Block + become: true + throttle: 1 + when: + - database_config.db_role is not defined + - ansible_hostname in hostname_target + # - ansible_hostname in grid_config.master_node + - system_config.dbaascli_on is true + - "'prereqs' in ansible_run_tags" + block: + + - name: Timeline - DBaasCLI_configureStandby_prereqs + lineinfile: + insertafter: EOF + dest: "{{ stage_dir.managed.workdir }}/run_timeline.csv" + line: "{{ sysdate }},Framework,{{ db_name }},{{ task_name }},{{ status }}" + become: false + delegate_to: localhost + when: + - "'framework' in ansible_run_tags" + - dbaascli is true + ignore_errors: true + vars: + status: "running" + task_name: "DBaasCLI_configureStandby_prereqs" + + - name: Create remote reg_tmp_files + file: + path: /var/opt/oracle/log/reg_tmp_files + state: directory + mode: '0750' + owner: oracle + group: oinstall + + - name: Copy prepareForStandby_prereqs_files files + copy: + src: "/tmp/{{ hostvars['localhost']['prepareForStandby_prereqs_files'] }}" + dest: /var/opt/oracle/log/reg_tmp_files + owner: oracle + group: oinstall + mode: 0640 + + - name: Run DBaasCLI dataguard configureStandby prereqs + expect: + command: > + dbaascli dataguard configureStandby + --db_name {{ db_name }} + --oracleHomeName {{ oracleHomeName }} + --standbyDBUniqueName {{ hostvars['localhost']['standby']['DBUniqueName'] }} + --primaryScanIPAddresses {{ hostvars['localhost']['primary']['ScanIPAddresses'] }} + --primaryScanPort {{ hostvars['localhost']['primary']['ScanPort'] }} + --primaryServiceName {{ hostvars['localhost']['primary']['DBUniqueName'] }}.{{ hostvars['localhost']['primary']['DBDomain'] }} + --protectionMode MAX_PERFORMANCE + --transportType ASYNC + --activeDG true + --standbyScanIPAddresses {{ grid_config.scan_name }} + --standbyScanPort {{ grid_config.scanListenerTCPPorts }} + --standbyDBInfoJsonLocation /var/opt/oracle/log/reg_tmp_files/{{ hostvars['localhost']['prepareForStandby_prereqs_files'] }} + --prereqs + responses: + PRIMARY_DB_SYS_PASSWORD: "{{ db_sys_password }}" + PRIMARY_DB_TDE_PASSWORD: "{{ db_tde_password }}" + AWR_ADMIN_PASSWORD: "{{ awr_admin_password }}" + AWR_ADMIN_PASSWORD (reconfirmation): "{{ awr_admin_password }}" + timeout: 3600 + throttle: 1 + register: configureStandby_prereqs + failed_when: + - "'dbaascli execution completed' not in configureStandby_prereqs.stdout" + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + DBaasCLI configureStandby_prereqs + ----------------- + {{ configureStandby_prereqs.cmd }} + ----------------- + {{ configureStandby_prereqs.stdout }} + ================================================== + when: configureStandby_prereqs is not skipped + + - name: Timeline - DBaasCLI_configureStandby_prereqs + lineinfile: + insertafter: EOF + dest: "{{ stage_dir.managed.workdir }}/run_timeline.csv" + line: "{{ sysdate }},Framework,{{ db_name }},{{ task_name }},{{ status }}" + become: false + delegate_to: localhost + when: + - "'framework' in ansible_run_tags" + - configureStandby_prereqs is success + vars: + status: "finished" + task_name: "DBaasCLI_configureStandby_prereqs" + + - name: Timeline - DBaasCLI_configureStandby_prereqs + lineinfile: + insertafter: EOF + dest: "{{ stage_dir.managed.workdir }}/run_timeline.csv" + line: "{{ sysdate }},Framework,{{ db_name }},{{ task_name }},{{ status }}" + become: false + delegate_to: localhost + when: + - "'framework' in ansible_run_tags" + - configureStandby_prereqs is failed + vars: + status: "failed" + task_name: "DBaasCLI_configureStandby_prereqs" + + rescue: + + - name: End execution + meta: end_play + +- name: DBaasCLI configureStandby Block + become: true + throttle: 1 + ignore_errors: true + when: + - database_config.db_role is not defined + - ansible_hostname in hostname_target + # - ansible_hostname in grid_config.master_node + - system_config.dbaascli_on is true + - "'prereqs' not in ansible_run_tags" + block: + + - name: Timeline - DBaasCLI_configureStandby + lineinfile: + insertafter: EOF + dest: "{{ stage_dir.managed.workdir }}/run_timeline.csv" + line: "{{ sysdate }},Framework,{{ db_name }},{{ task_name }},{{ status }}" + become: false + delegate_to: localhost + when: + - "'framework' in ansible_run_tags" + - dbaascli is true + - "'prereqs' not in ansible_run_tags" + vars: + status: "running" + task_name: "DBaasCLI_configureStandby" + + - name: Create remote reg_tmp_files + file: + path: /var/opt/oracle/log/reg_tmp_files + state: directory + mode: '0750' + owner: oracle + group: oinstall + + - name: Copy prepareForStandby files + copy: + src: "/tmp/{{ hostvars['localhost']['prepareForStandby_files'] }}" + dest: /var/opt/oracle/log/reg_tmp_files + owner: oracle + group: oinstall + mode: 0640 + + - name: Run DBaasCLI dataguard configureStandby + expect: + command: > + dbaascli dataguard configureStandby + --db_name {{ db_name }} + --oracleHomeName {{ oracleHomeName }} + --standbyDBUniqueName {{ hostvars['localhost']['standby']['DBUniqueName'] }} + --primaryScanIPAddresses {{ hostvars['localhost']['primary']['ScanIPAddresses'] }} + --primaryScanPort {{ hostvars['localhost']['primary']['ScanPort'] }} + --primaryServiceName {{ hostvars['localhost']['primary']['DBUniqueName'] }}.{{ hostvars['localhost']['primary']['DBDomain'] }} + --protectionMode MAX_PERFORMANCE + --transportType ASYNC + --activeDG true + --standbyScanIPAddresses {{ grid_config.scan_name }} + --standbyScanPort {{ grid_config.scanListenerTCPPorts }} + --standbyDBInfoJsonLocation /var/opt/oracle/log/reg_tmp_files/{{ hostvars['localhost']['prepareForStandby_files'] }} + responses: + PRIMARY_DB_SYS_PASSWORD: "{{ db_sys_password }}" + PRIMARY_DB_TDE_PASSWORD: "{{ db_tde_password }}" + AWR_ADMIN_PASSWORD: "{{ awr_admin_password }}" + AWR_ADMIN_PASSWORD (reconfirmation): "{{ awr_admin_password }}" + timeout: 14400 + throttle: 1 + register: configureStandby + failed_when: + - "'dbaascli execution completed' not in configureStandby.stdout" + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + DBaasCLI configureStandby + ----------------- + {{ configureStandby.cmd }} + ----------------- + {{ configureStandby.stdout }} + ================================================== + when: configureStandby is not skipped + + - name: Run DBaasCLI dataguard switchover prereqs + command: > + dbaascli dataguard switchover + --db_name {{ db_name }} + --targetStandbyDBUniqueName {{ hostvars['localhost']['standby']['DBUniqueName'] }} + --prereqs + register: dataguard_switchover_prereqs + when: configureStandby is success + failed_when: + - "'Prerequisite checks completed successfully' not in dataguard_switchover_prereqs.stdout" + + - name: Timeline - DBaasCLI_configureStandby + lineinfile: + insertafter: EOF + dest: "{{ stage_dir.managed.workdir }}/run_timeline.csv" + line: "{{ sysdate }},Framework,{{ db_name }},{{ task_name }},{{ status }}" + become: false + delegate_to: localhost + when: + - "'framework' in ansible_run_tags" + - configureStandby is success + vars: + status: "finished" + task_name: "DBaasCLI_configureStandby" + + - name: Timeline - DBaasCLI_configureStandby + lineinfile: + insertafter: EOF + dest: "{{ stage_dir.managed.workdir }}/run_timeline.csv" + line: "{{ sysdate }},Framework,{{ db_name }},{{ task_name }},{{ status }}" + become: false + delegate_to: localhost + when: + - "'framework' in ansible_run_tags" + - configureStandby is failed + vars: + status: "failed" + task_name: "DBaasCLI_configureStandby" + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/configure/dbaasca.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/configure/dbaasca.yml new file mode 100644 index 0000000..dbc904e --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/configure/dbaasca.yml @@ -0,0 +1,125 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaasCA configureStandby Block + become: true + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + + - name: Create remote stage_dir.managed.tmp + file: + path: "{{ stage_dir.managed.tmp }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + + - name: Create remote shared_dir + file: + path: "{{ item }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + with_items: + - "{{ acfs_mount_point }}/{{ db_name }}" + - "{{ acfs_mount_point }}/wallets/{{ hostvars['localhost']['standby']['db_unique_name'] }}" + - /var/opt/oracle/log/reg_tmp_files + + - name: Copy prepareForStandby files + copy: + src: "{{ stage_dir.control.tmp }}/prepareForStandby_{{ db_name }}.zip" + dest: /var/opt/oracle/log/reg_tmp_files/ + owner: oracle + group: oinstall + mode: 0644 + register: copy_prepareForStandby_blob_file + + - name: Run DBaasCA configureStandby + expect: + command: > + {{ dbaasca }} + -silent + -createDuplicateDB + -createAsStandby + -configureStandby + -useActiveDatabaseDuplication false + -useOMF true + -adminManaged + {% if hostvars['localhost']['primary']['db_type'] == 'rac' %} + -standbyScanName {{ hostvars['localhost']['standby']['scan_ip_addresses'] }} + -standbyScanPort {{ hostvars['localhost']['standby']['scan_port'] }} + -nodelist {{ grid_config.cluster_nodes }} + -honorNodeNumberToThread + -honorNodeNumberForInstance + -configureActiveDG + -dgTNSNamesoraFilePath {{ acfs_mount_point }}/{{ db_name }}/tnsnames.ora + -storageType ASM + -datafileDestination +{{ asm.diskgroup.data }} + -recoveryAreaDestination +{{ asm.diskgroup.reco }} + -usedb_nameInPDBAlias + -initParams 'db_create_online_log_dest_1=+{{ asm.diskgroup.data }},os_authent_prefix="",processes={{ hostvars['localhost']['primary']['processes'] }},db_name={{ db_name }},pga_aggregate_target={{ hostvars['localhost']['primary']['pga_aggregate_target'] }},sga_target={{ hostvars['localhost']['primary']['sga_target'] }},db_domain={{ hostvars['localhost']['standby']['db_domain'] }},db_unique_name={% if hostvars['localhost']['primary']['db_type'] %}{{ hostvars['localhost']['standby']['db_unique_name'] }}{% else %}{{ hostvars['localhost']['standby']['instance_name'] }}{% endif %}' + {% else %} + -standbyHostName {{ hostvars['localhost']['standby']['scan_ip_addresses'] }} + -standbyListenerPort {{ hostvars['localhost']['standby']['scan_port'] }} + -dgTNSNamesoraFilePath {{ acfs_mount_point }}/{{ db_name }}/tnsnames.ora + -storageType FS + -datafileDestination {{ asm.diskgroup.data }} + -recoveryAreaDestination {{ asm.diskgroup.reco }} + -initParams 'db_create_online_log_dest_1={{ asm.diskgroup.data }},os_authent_prefix="",processes={{ hostvars['localhost']['primary']['processes'] }},db_name={{ db_name }},pga_aggregate_target={{ hostvars['localhost']['primary']['pga_aggregate_target'] }},sga_target={{ hostvars['localhost']['primary']['sga_target'] }},db_domain={{ hostvars['localhost']['standby']['db_domain'] }},db_unique_name={% if hostvars['localhost']['primary']['db_type'] %}{{ hostvars['localhost']['standby']['db_unique_name'] }}{% else %}{{ hostvars['localhost']['standby']['instance_name'] }}{% endif %}' + -automaticMemoryManagement false + -listeners LISTENER + {% endif %} + -gdb_name {{ db_name }} + -sid {{ db_name }} + -remoteDBConnString {{ hostvars['localhost']['primary']['scan_ip_addresses'] | split(',') | first }}:{{ hostvars['localhost']['primary']['scan_port'] }}/{{ hostvars['localhost']['primary']['db_unique_name'] }}.{{ hostvars['localhost']['primary']['db_domain'] }} + -dgProtectionMode MAX_PERFORMANCE + -standbyTransportMode ASYNC + -standbyBlobFileLocFromPrimaryDB /var/opt/oracle/log/reg_tmp_files/prepareForStandby_{{ db_name }}.zip + -recoveryAreaSize {{ hostvars['localhost']['primary']['db_recovery_file_dest_size'] | int | human_readable(unit='M') | split('.') | first }} + -databaseConfigType {{ hostvars['localhost']['primary']['db_type'] }} + -enableArchive true + -configureTDE true + -tdeWalletRoot {{ acfs_mount_point }}/wallets/{{ hostvars['localhost']['standby']['db_unique_name'] }} + -primaryDBTdeWallet {{ hostvars['localhost']['primary']['wallet_root'] }} + -skipPasswordComplexityCheck true + -J-Dapplication.exceptions.severity=DBT-06012:WARNING,DBT-06604:WARNING,DBT-16008:WARNING + -J-Doracle.assistants.dbca.useStandardLogLocation=true + -jreLoc /usr/java/jdk-11 + responses: + (?i)password: "{{ db_sys_password }}" + timeout: 3600 + become_user: oracle + register: dbca_configureStandby + ignore_errors: yes + + - debug: + msg: "{{ output | regex_findall('([^\n,]+)') | default('Database not found') }}" + vars: + output: | + ================================================== + DBaasCA configureStandby + ----------------- + {{ dbca_configureStandby.cmd }} + ----------------- + {{ dbca_configureStandby.stdout }} + ================================================== + # failed_when: + # - ('FATAL' in dbca_configureStandby.stdout) or ('FAILED' in dbca_configureStandby.stdout)) + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/configure/dbaascli.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/configure/dbaascli.yml new file mode 100644 index 0000000..9cb9585 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/configure/dbaascli.yml @@ -0,0 +1,108 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaasCLI configureStandby Block + become: true + throttle: 1 + block: + + - name: Create remote reg_tmp_files + file: + path: /var/opt/oracle/log/reg_tmp_files + state: directory + mode: '0750' + owner: oracle + group: oinstall + + - name: Copy prepareForStandby files + copy: + # src: "/tmp/{{ hostvars['localhost']['prepareForStandby_files'] }}" + src: "{{ stage_dir.control.tmp }}/prepareForStandby_{{ db_name }}.zip" + dest: /var/opt/oracle/log/reg_tmp_files + owner: oracle + group: oinstall + mode: 0640 + + - name: Run DBaasCLI dataguard configureStandby + expect: + command: > + dbaascli dataguard configureStandby + --db_name {{ db_name }} + --oracleHomeName {{ oracleHomeName }} + --standbyDBUniqueName {{ hostvars['localhost']['standby']['db_unique_name'] }} + --primaryScanIPAddresses {{ hostvars['localhost']['primary']['scan_ip_addresses'] }} + --primaryScanPort {{ hostvars['localhost']['primary']['scan_port'] }} + --primaryServiceName {{ hostvars['localhost']['primary']['db_unique_name'] }}.{{ hostvars['localhost']['primary']['db_domain'] }} + --protectionMode MAX_PERFORMANCE + --transportType ASYNC + --activeDG true + --standbyScanIPAddresses {{ hostvars['localhost']['standby']['scan_ip_addresses'] }} + --standbyScanPort {{ hostvars['localhost']['standby']['scan_port'] }} + --standbyDBInfoJsonLocation /var/opt/oracle/log/reg_tmp_files/prepareForStandby_{{ db_name }}.zip + {% if 'prereqs' in (ansible_run_tags|lower) %}--executePrereqs{% endif %} + responses: + PRIMARY_DB_SYS_PASSWORD: "{{ db_sys_password }}" + PRIMARY_DB_TDE_PASSWORD: "{{ db_tde_password }}" + AWR_ADMIN_PASSWORD: "{{ awr_admin_password }}" + AWR_ADMIN_PASSWORD (reconfirmation): "{{ awr_admin_password }}" + timeout: 14400 + throttle: 1 + register: configureStandby + failed_when: "'dbaascli execution completed' not in configureStandby.stdout" + ignore_errors: true + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + DBaasCLI configureStandby + ----------------- + {{ configureStandby.cmd }} + ----------------- + {{ configureStandby.stdout }} + ================================================== + when: configureStandby is not skipped + failed_when: configureStandby.failed + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + DBaasCLI dataguard switchover prereqs + ----------------- + {{ dataguard_switchover_prereqs.cmd }} + ----------------- + {{ dataguard_switchover_prereqs.stdout }} + ================================================== + when: dataguard_switchover_prereqs is not skipped + + - name: Run DBaasCLI dataguard switchover prereqs + command: > + dbaascli dataguard switchover + --db_name {{ db_name }} + --targetStandbyDBUniqueName {{ hostvars['localhost']['standby']['db_unique_name'] }} + --executePrereqs + register: dataguard_switchover_prereqs + when: + - not "'prereqs' in (ansible_run_tags|lower)" + - configureStandby.changed + failed_when: + - "'Prerequisite checks completed successfully' not in dataguard_switchover_prereqs.stdout" + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/configure/main.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/configure/main.yml new file mode 100644 index 0000000..b516a41 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/configure/main.yml @@ -0,0 +1,41 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: configureStandby + when: + - not database_config.db_role + - ansible_hostname in hostname_target + - hostvars['localhost']['primary'] is defined + - hostvars['localhost']['standby'] is defined + block: + + - name: DBaasCA + ansible.builtin.include_tasks: dbaasca.yml + when: + - "'pilot' not in ansible_run_tags" + - not system_config.dbaascli_on + + - name: DBaasCLI + ansible.builtin.include_tasks: dbaascli.yml + when: system_config.dbaascli_on + + - name: PILOT + ansible.builtin.include_tasks: pilot.yml + when: + - "'pilot' in ansible_run_tags" + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/configure/pilot.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/configure/pilot.yml new file mode 100644 index 0000000..8db7162 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/configure/pilot.yml @@ -0,0 +1,134 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: PILOT configureStandby Block + become: true + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + throttle: 1 + when: + - "'pilot' in ansible_run_tags" + - database_config.db_role is not defined + - hostname_target is defined + - ansible_hostname in hostname_target + - not oracle_facts.system.dbaascli + - hostvars['localhost']['primary'] is defined + - hostvars['localhost']['standby'] is defined + block: + + - name: Create remote shared_dir + file: + path: "{{ item }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + with_items: + - "{{ acfs_mount_point }}/{{ db_name }}" + - "{{ acfs_mount_point }}/wallets/{{ hostvars['localhost']['standby']['DBUniqueName'] }}" + - "{{ reg_tmp_files }}" + + - name: Copy prepareForStandby files + copy: + src: "{{ stage_dir.control.tmp }}/prepareForStandby_{{ db_name }}.{% if 'prereqs' in ansible_run_tags %}json{% else %}tar{% endif %}" + dest: "{{ reg_tmp_files }}" + owner: oracle + group: oinstall + mode: 0644 + register: copy_prepareForStandby_blob_file + + - name: Run PILOT configure_standby_db_cloud + expect: + command: > + {{ pilot }} + -silent + -plugin configure_standby_db_cloud + DB_NAME="{{ db_name }}" + ORACLE_HOME="{{ oracleHomePath }}" + DB_UNIQUE_NAME="{{ hostvars['localhost']['standby']['DBUniqueName'] }}" + AGENT_DB_ID="00229ef0-d3da-4082-8ef0-d49768cac803" + DBAASAPI_JOB_ID="jobid-{{ lookup('ansible.builtin.password', '/dev/null', chars=['digits'], length=5) }}" + EXECUTE_PREREQS="{% if 'prereqs' in ansible_run_tags %}true{% else %}false{% endif %}" + IGNORE_PREREQ_FAILURE="false" + SKIP_PREREQS="false" + STANDBY_DB_UNIQUE_NAME="{{ hostvars['localhost']['standby']['DBUniqueName'] }}" + STANDBY_DB_DOMAIN="{{ hostvars['localhost']['standby']['DBDomain'] }}" + STANDBY_SERVICE_NAME="{{ hostvars['localhost']['standby']['DBUniqueName'] }}.{{ hostvars['localhost']['standby']['DBDomain'] }}" + STANDBY_SCAN_NAME="{% if hostvars['localhost']['primary']['dbType'] == 'rac' %}{{ hostvars['localhost']['standby']['ScanName'] }}{% else %}{{ hostvars['localhost']['standby']['HostIPAddress'] }}{% endif %}" + STANDBY_SCAN_PORT="{% if hostvars['localhost']['primary']['dbType'] == 'rac' %}{{ hostvars['localhost']['standby']['ScanPort'] }}{% else %}{{ hostvars['localhost']['standby']['HostPort'] }}{% endif %}" + PRIMARY_SERVICE_NAME="{{ hostvars['localhost']['primary']['DBUniqueName'] }}.{{ hostvars['localhost']['primary']['DBDomain'] }}" + PRIMARY_SCAN_NAME="{% if hostvars['localhost']['primary']['dbType'] == 'rac' %}{{ hostvars['localhost']['primary']['ScanName'] }}{% else %}{{ hostvars['localhost']['primary']['HostIPAddress'] }}{% endif %}" + PRIMARY_SCAN_PORT="{% if hostvars['localhost']['primary']['dbType'] == 'rac' %}{{ hostvars['localhost']['primary']['ScanPort'] }}{% else %}{{ hostvars['localhost']['primary']['HostPort'] }}{% endif %}" + NODE_LIST="{{ grid_config.cluster_nodes }}" + PROTECTION_MODE="MAX_PERFORMANCE" + TRANSPORT_TYPE="ASYNC" + ACTIVE_DG="TRUE" + {% if 'prereqs' in ansible_run_tags %}STANDBY_DB_INFO_JSON="{{ reg_tmp_files }}/prepareForStandby_{{ db_name }}.json"{% else %}STANDBY_BLOB_FROM_PRIMARY="{{ reg_tmp_files }}/prepareForStandby_{{ db_name }}.tar"{% endif %} + SGA_SIZE_IN_MB="{{ sga_size_in_mb | default(hostvars['localhost']['primary']['sga_target'] | int | human_readable(unit='M') | split('.') | first) }}" + PGA_SIZE_IN_MB="{{ pga_size_in_mb | default(hostvars['localhost']['primary']['pga_aggregate_target'] | int | human_readable(unit='M') | split('.') | first) }}" + DATAFILE_DESTINATION="{{ asm.diskgroup.data }}" + FRA_DESTINATION="{{ asm.diskgroup.reco }}" + REDO_LOG_DESTINATION="{{ asm.diskgroup.data }}" + FRA_SIZE_IN_MB="{{ hostvars['localhost']['primary']['db_recovery_file_dest_size'] | int | human_readable(unit='M') | split('.') | first }}" + Validate_rpms_consistency="false" + Validate_CRS_running="false" + Export_cloud_properties="false" + Perform_dbca_prechecks="false" + -logDir /var/opt/oracle/log/{{ db_name }}/dataguard/prepareForStandby + -checkpointDir {{ oracleHomePath | dirname | dirname | dirname }}/cfgtoollogs/dbca/checkpoints/oracle/prepare_for_standby + responses: + (?i)password: "{{ db_sys_password }}" + timeout: 3600 + register: pilot_configure_standby_db_cloud + # when: ansible_hostname in grid_config.master_node + ignore_errors: true + # failed_when: + # - "'Running Recover_managed_standby job' not in dbca_configureStandby.stdout" + + - debug: + msg: "{{ output | regex_findall('([^\n,]+)') | default('Database not found') }}" + vars: + output: | + ================================================== + PILOT pilot_configure_standby_db_cloud + ----------------- + {{ pilot_configure_standby_db_cloud.cmd }} + ----------------- + {{ pilot_configure_standby_db_cloud.stdout }} + ================================================== + when: pilot_configure_standby_db_cloud is not skipped + + - debug: var=pilot_configure_standby_db_cloud.stdout_lines + + - shell: "grep SEVERE {{ pilot_configure_standby_db_cloud.stdout_lines | regex_findall('Log file location: (.+)') | first | split(',') | replace(\"'\",'') }}" + register: configureStandby_error + when: pilot_configure_standby_db_cloud.failed + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + PILOT configureStandby_error + ----------------- + {{ configureStandby_error.stdout_lines }} + ================================================== + when: pilot_configure_standby_db_cloud.failed + failed_when: pilot_configure_standby_db_cloud.failed + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/dbaasca.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/dbaasca.yml new file mode 100644 index 0000000..dbc904e --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/dbaasca.yml @@ -0,0 +1,125 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaasCA configureStandby Block + become: true + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + + - name: Create remote stage_dir.managed.tmp + file: + path: "{{ stage_dir.managed.tmp }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + + - name: Create remote shared_dir + file: + path: "{{ item }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + with_items: + - "{{ acfs_mount_point }}/{{ db_name }}" + - "{{ acfs_mount_point }}/wallets/{{ hostvars['localhost']['standby']['db_unique_name'] }}" + - /var/opt/oracle/log/reg_tmp_files + + - name: Copy prepareForStandby files + copy: + src: "{{ stage_dir.control.tmp }}/prepareForStandby_{{ db_name }}.zip" + dest: /var/opt/oracle/log/reg_tmp_files/ + owner: oracle + group: oinstall + mode: 0644 + register: copy_prepareForStandby_blob_file + + - name: Run DBaasCA configureStandby + expect: + command: > + {{ dbaasca }} + -silent + -createDuplicateDB + -createAsStandby + -configureStandby + -useActiveDatabaseDuplication false + -useOMF true + -adminManaged + {% if hostvars['localhost']['primary']['db_type'] == 'rac' %} + -standbyScanName {{ hostvars['localhost']['standby']['scan_ip_addresses'] }} + -standbyScanPort {{ hostvars['localhost']['standby']['scan_port'] }} + -nodelist {{ grid_config.cluster_nodes }} + -honorNodeNumberToThread + -honorNodeNumberForInstance + -configureActiveDG + -dgTNSNamesoraFilePath {{ acfs_mount_point }}/{{ db_name }}/tnsnames.ora + -storageType ASM + -datafileDestination +{{ asm.diskgroup.data }} + -recoveryAreaDestination +{{ asm.diskgroup.reco }} + -usedb_nameInPDBAlias + -initParams 'db_create_online_log_dest_1=+{{ asm.diskgroup.data }},os_authent_prefix="",processes={{ hostvars['localhost']['primary']['processes'] }},db_name={{ db_name }},pga_aggregate_target={{ hostvars['localhost']['primary']['pga_aggregate_target'] }},sga_target={{ hostvars['localhost']['primary']['sga_target'] }},db_domain={{ hostvars['localhost']['standby']['db_domain'] }},db_unique_name={% if hostvars['localhost']['primary']['db_type'] %}{{ hostvars['localhost']['standby']['db_unique_name'] }}{% else %}{{ hostvars['localhost']['standby']['instance_name'] }}{% endif %}' + {% else %} + -standbyHostName {{ hostvars['localhost']['standby']['scan_ip_addresses'] }} + -standbyListenerPort {{ hostvars['localhost']['standby']['scan_port'] }} + -dgTNSNamesoraFilePath {{ acfs_mount_point }}/{{ db_name }}/tnsnames.ora + -storageType FS + -datafileDestination {{ asm.diskgroup.data }} + -recoveryAreaDestination {{ asm.diskgroup.reco }} + -initParams 'db_create_online_log_dest_1={{ asm.diskgroup.data }},os_authent_prefix="",processes={{ hostvars['localhost']['primary']['processes'] }},db_name={{ db_name }},pga_aggregate_target={{ hostvars['localhost']['primary']['pga_aggregate_target'] }},sga_target={{ hostvars['localhost']['primary']['sga_target'] }},db_domain={{ hostvars['localhost']['standby']['db_domain'] }},db_unique_name={% if hostvars['localhost']['primary']['db_type'] %}{{ hostvars['localhost']['standby']['db_unique_name'] }}{% else %}{{ hostvars['localhost']['standby']['instance_name'] }}{% endif %}' + -automaticMemoryManagement false + -listeners LISTENER + {% endif %} + -gdb_name {{ db_name }} + -sid {{ db_name }} + -remoteDBConnString {{ hostvars['localhost']['primary']['scan_ip_addresses'] | split(',') | first }}:{{ hostvars['localhost']['primary']['scan_port'] }}/{{ hostvars['localhost']['primary']['db_unique_name'] }}.{{ hostvars['localhost']['primary']['db_domain'] }} + -dgProtectionMode MAX_PERFORMANCE + -standbyTransportMode ASYNC + -standbyBlobFileLocFromPrimaryDB /var/opt/oracle/log/reg_tmp_files/prepareForStandby_{{ db_name }}.zip + -recoveryAreaSize {{ hostvars['localhost']['primary']['db_recovery_file_dest_size'] | int | human_readable(unit='M') | split('.') | first }} + -databaseConfigType {{ hostvars['localhost']['primary']['db_type'] }} + -enableArchive true + -configureTDE true + -tdeWalletRoot {{ acfs_mount_point }}/wallets/{{ hostvars['localhost']['standby']['db_unique_name'] }} + -primaryDBTdeWallet {{ hostvars['localhost']['primary']['wallet_root'] }} + -skipPasswordComplexityCheck true + -J-Dapplication.exceptions.severity=DBT-06012:WARNING,DBT-06604:WARNING,DBT-16008:WARNING + -J-Doracle.assistants.dbca.useStandardLogLocation=true + -jreLoc /usr/java/jdk-11 + responses: + (?i)password: "{{ db_sys_password }}" + timeout: 3600 + become_user: oracle + register: dbca_configureStandby + ignore_errors: yes + + - debug: + msg: "{{ output | regex_findall('([^\n,]+)') | default('Database not found') }}" + vars: + output: | + ================================================== + DBaasCA configureStandby + ----------------- + {{ dbca_configureStandby.cmd }} + ----------------- + {{ dbca_configureStandby.stdout }} + ================================================== + # failed_when: + # - ('FATAL' in dbca_configureStandby.stdout) or ('FAILED' in dbca_configureStandby.stdout)) + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/dbaascli.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/dbaascli.yml new file mode 100644 index 0000000..498f10e --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/dbaascli.yml @@ -0,0 +1,141 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaasCLI configureStandby Block + become: true + throttle: 1 + block: + + - name: Create remote reg_tmp_files + file: + path: /var/opt/oracle/log/reg_tmp_files + state: directory + mode: '0750' + owner: oracle + group: oinstall + + - name: Copy prepareForStandby files + copy: + # src: "/tmp/{{ hostvars['localhost']['prepareForStandby_files'] }}" + src: "{{ stage_dir.control.tmp }}/prepareForStandby_{{ db_name }}.zip" + dest: /var/opt/oracle/log/reg_tmp_files + owner: oracle + group: oinstall + mode: 0640 + + - name: Run DBaasCLI dataguard configureStandby + expect: + command: > + dbaascli dataguard configureStandby + --db_name {{ db_name }} + --oracleHomeName {{ oracleHomeName }} + --standbyDBUniqueName {{ hostvars['localhost']['standby']['db_unique_name'] }} + --primaryScanIPAddresses {{ hostvars['localhost']['primary']['scan_ip_addresses'] }} + --primaryScanPort {{ hostvars['localhost']['primary']['scan_port'] }} + --primaryServiceName {{ hostvars['localhost']['primary']['db_unique_name'] }}.{{ hostvars['localhost']['primary']['db_domain'] }} + --protectionMode MAX_PERFORMANCE + --transportType ASYNC + --activeDG true + --standbyScanIPAddresses {{ hostvars['localhost']['standby']['scan_ip_addresses'] }} + --standbyScanPort {{ hostvars['localhost']['standby']['scan_port'] }} + --standbyDBInfoJsonLocation /var/opt/oracle/log/reg_tmp_files/prepareForStandby_{{ db_name }}.zip + {% if 'prereqs' in (ansible_run_tags|lower) %}--executePrereqs{% endif %} + responses: + PRIMARY_DB_SYS_PASSWORD: "{{ db_sys_password }}" + PRIMARY_DB_TDE_PASSWORD: "{{ db_tde_password }}" + AWR_ADMIN_PASSWORD: "{{ awr_admin_password }}" + AWR_ADMIN_PASSWORD (reconfirmation): "{{ awr_admin_password }}" + timeout: 14400 + throttle: 1 + register: configureStandby + failed_when: "'dbaascli execution completed' not in configureStandby.stdout" + ignore_errors: true + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + DBaasCLI configureStandby + ----------------- + {{ configureStandby.cmd }} + ----------------- + {{ configureStandby.stdout }} + ================================================== + when: configureStandby is not skipped + failed_when: configureStandby.failed + + - name: Run DBaasCLI dataguard registerStandby + expect: + command: > + dbaascli dataguard registerStandby + --db_name {{ db_name }} + --standbyDBUniqueName {{ hostvars['localhost']['standby']['db_unique_name'] }} + --standbyScanIPAddresses {{ hostvars['localhost']['standby']['scan_ip_addresses'] }} + --standbyScanPort {{ hostvars['localhost']['standby']['scan_port'] }} + --standbyServiceName {{ hostvars['localhost']['standby']['db_unique_name'] }}.{{ hostvars['localhost']['standby']['db_domain'] }} + responses: + PRIMARY_DB_SYS_PASSWORD: "{{ db_sys_password }}" + PRIMARY_DB_TDE_PASSWORD: "{{ db_tde_password }}" + AWR_ADMIN_PASSWORD: "{{ awr_admin_password }}" + AWR_ADMIN_PASSWORD (reconfirmation): "{{ awr_admin_password }}" + timeout: 14400 + throttle: 1 + register: registerStandby + failed_when: "'dbaascli execution completed' not in registerStandby.stdout" + ignore_errors: true + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + DBaasCLI registerStandby + ----------------- + {{ registerStandby.cmd }} + ----------------- + {{ registerStandby.stdout }} + ================================================== + when: registerStandby is not skipped + + - name: Run DBaasCLI dataguard switchover prereqs + command: > + dbaascli dataguard switchover + --db_name {{ db_name }} + --targetStandbyDBUniqueName {{ hostvars['localhost']['standby']['db_unique_name'] }} + --prereqs + register: dataguard_switchover_prereqs + when: + - not "'prereqs' in (ansible_run_tags|lower)" + - configureStandby is success + failed_when: + - "'Prerequisite checks completed successfully' not in dataguard_switchover_prereqs.stdout" + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + DBaasCLI dataguard switchover prereqs + ----------------- + {{ dataguard_switchover_prereqs.cmd }} + ----------------- + {{ dataguard_switchover_prereqs.stdout }} + ================================================== + when: dataguard_switchover_prereqs is not skipped + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/main.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/main.yml new file mode 100644 index 0000000..37cd0e3 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/main.yml @@ -0,0 +1,36 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: dataguard standby + block: + + - name: configre standby + ansible.builtin.include_tasks: configure/main.yml + when: + - not database_config.db_role + - ansible_hostname in hostname_target + - hostvars['localhost']['primary'] is defined + - hostvars['localhost']['standby'] is defined + + - name: register standby + ansible.builtin.include_tasks: register/main.yml + when: + - database_config.db_role == 'physical_standby' + - hostvars['localhost']['standby'] is defined + - ansible_hostname in database_config.master_node + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/pilot.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/pilot.yml new file mode 100644 index 0000000..8db7162 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/pilot.yml @@ -0,0 +1,134 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: PILOT configureStandby Block + become: true + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + throttle: 1 + when: + - "'pilot' in ansible_run_tags" + - database_config.db_role is not defined + - hostname_target is defined + - ansible_hostname in hostname_target + - not oracle_facts.system.dbaascli + - hostvars['localhost']['primary'] is defined + - hostvars['localhost']['standby'] is defined + block: + + - name: Create remote shared_dir + file: + path: "{{ item }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + with_items: + - "{{ acfs_mount_point }}/{{ db_name }}" + - "{{ acfs_mount_point }}/wallets/{{ hostvars['localhost']['standby']['DBUniqueName'] }}" + - "{{ reg_tmp_files }}" + + - name: Copy prepareForStandby files + copy: + src: "{{ stage_dir.control.tmp }}/prepareForStandby_{{ db_name }}.{% if 'prereqs' in ansible_run_tags %}json{% else %}tar{% endif %}" + dest: "{{ reg_tmp_files }}" + owner: oracle + group: oinstall + mode: 0644 + register: copy_prepareForStandby_blob_file + + - name: Run PILOT configure_standby_db_cloud + expect: + command: > + {{ pilot }} + -silent + -plugin configure_standby_db_cloud + DB_NAME="{{ db_name }}" + ORACLE_HOME="{{ oracleHomePath }}" + DB_UNIQUE_NAME="{{ hostvars['localhost']['standby']['DBUniqueName'] }}" + AGENT_DB_ID="00229ef0-d3da-4082-8ef0-d49768cac803" + DBAASAPI_JOB_ID="jobid-{{ lookup('ansible.builtin.password', '/dev/null', chars=['digits'], length=5) }}" + EXECUTE_PREREQS="{% if 'prereqs' in ansible_run_tags %}true{% else %}false{% endif %}" + IGNORE_PREREQ_FAILURE="false" + SKIP_PREREQS="false" + STANDBY_DB_UNIQUE_NAME="{{ hostvars['localhost']['standby']['DBUniqueName'] }}" + STANDBY_DB_DOMAIN="{{ hostvars['localhost']['standby']['DBDomain'] }}" + STANDBY_SERVICE_NAME="{{ hostvars['localhost']['standby']['DBUniqueName'] }}.{{ hostvars['localhost']['standby']['DBDomain'] }}" + STANDBY_SCAN_NAME="{% if hostvars['localhost']['primary']['dbType'] == 'rac' %}{{ hostvars['localhost']['standby']['ScanName'] }}{% else %}{{ hostvars['localhost']['standby']['HostIPAddress'] }}{% endif %}" + STANDBY_SCAN_PORT="{% if hostvars['localhost']['primary']['dbType'] == 'rac' %}{{ hostvars['localhost']['standby']['ScanPort'] }}{% else %}{{ hostvars['localhost']['standby']['HostPort'] }}{% endif %}" + PRIMARY_SERVICE_NAME="{{ hostvars['localhost']['primary']['DBUniqueName'] }}.{{ hostvars['localhost']['primary']['DBDomain'] }}" + PRIMARY_SCAN_NAME="{% if hostvars['localhost']['primary']['dbType'] == 'rac' %}{{ hostvars['localhost']['primary']['ScanName'] }}{% else %}{{ hostvars['localhost']['primary']['HostIPAddress'] }}{% endif %}" + PRIMARY_SCAN_PORT="{% if hostvars['localhost']['primary']['dbType'] == 'rac' %}{{ hostvars['localhost']['primary']['ScanPort'] }}{% else %}{{ hostvars['localhost']['primary']['HostPort'] }}{% endif %}" + NODE_LIST="{{ grid_config.cluster_nodes }}" + PROTECTION_MODE="MAX_PERFORMANCE" + TRANSPORT_TYPE="ASYNC" + ACTIVE_DG="TRUE" + {% if 'prereqs' in ansible_run_tags %}STANDBY_DB_INFO_JSON="{{ reg_tmp_files }}/prepareForStandby_{{ db_name }}.json"{% else %}STANDBY_BLOB_FROM_PRIMARY="{{ reg_tmp_files }}/prepareForStandby_{{ db_name }}.tar"{% endif %} + SGA_SIZE_IN_MB="{{ sga_size_in_mb | default(hostvars['localhost']['primary']['sga_target'] | int | human_readable(unit='M') | split('.') | first) }}" + PGA_SIZE_IN_MB="{{ pga_size_in_mb | default(hostvars['localhost']['primary']['pga_aggregate_target'] | int | human_readable(unit='M') | split('.') | first) }}" + DATAFILE_DESTINATION="{{ asm.diskgroup.data }}" + FRA_DESTINATION="{{ asm.diskgroup.reco }}" + REDO_LOG_DESTINATION="{{ asm.diskgroup.data }}" + FRA_SIZE_IN_MB="{{ hostvars['localhost']['primary']['db_recovery_file_dest_size'] | int | human_readable(unit='M') | split('.') | first }}" + Validate_rpms_consistency="false" + Validate_CRS_running="false" + Export_cloud_properties="false" + Perform_dbca_prechecks="false" + -logDir /var/opt/oracle/log/{{ db_name }}/dataguard/prepareForStandby + -checkpointDir {{ oracleHomePath | dirname | dirname | dirname }}/cfgtoollogs/dbca/checkpoints/oracle/prepare_for_standby + responses: + (?i)password: "{{ db_sys_password }}" + timeout: 3600 + register: pilot_configure_standby_db_cloud + # when: ansible_hostname in grid_config.master_node + ignore_errors: true + # failed_when: + # - "'Running Recover_managed_standby job' not in dbca_configureStandby.stdout" + + - debug: + msg: "{{ output | regex_findall('([^\n,]+)') | default('Database not found') }}" + vars: + output: | + ================================================== + PILOT pilot_configure_standby_db_cloud + ----------------- + {{ pilot_configure_standby_db_cloud.cmd }} + ----------------- + {{ pilot_configure_standby_db_cloud.stdout }} + ================================================== + when: pilot_configure_standby_db_cloud is not skipped + + - debug: var=pilot_configure_standby_db_cloud.stdout_lines + + - shell: "grep SEVERE {{ pilot_configure_standby_db_cloud.stdout_lines | regex_findall('Log file location: (.+)') | first | split(',') | replace(\"'\",'') }}" + register: configureStandby_error + when: pilot_configure_standby_db_cloud.failed + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + PILOT configureStandby_error + ----------------- + {{ configureStandby_error.stdout_lines }} + ================================================== + when: pilot_configure_standby_db_cloud.failed + failed_when: pilot_configure_standby_db_cloud.failed + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/register/dbaascli.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/register/dbaascli.yml new file mode 100644 index 0000000..fc05069 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/register/dbaascli.yml @@ -0,0 +1,43 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaasCLI registerStandby Block + become: true + block: + + - name: Run DBaasCLI dataguard registerStandby + command: > + dbaascli dataguard registerStandby + --db_name {{ db_name }} + --standbyDBUniqueName {{ hostvars['localhost']['standby']['db_unique_name'] }} + --standbyScanIPAddresses {{ hostvars['localhost']['standby']['scan_ip_addresses'] }} + --standbyScanPort {{ hostvars['localhost']['standby']['scan_port'] }} + --standbyServiceName {{ hostvars['localhost']['standby']['db_unique_name'] }}.{{ hostvars['localhost']['primary']['db_domain'] }} + --standbyDBDomain {{ hostvars['localhost']['standby']['db_domain'] }} + register: registerStandby + failed_when: "'dbaascli execution completed' not in registerStandby.stdout" + ignore_errors: true + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') | default() }}" + vars: + output: | + ================================================== + DBaasCLI registerStandby + ----------------- + {{ registerStandby.cmd }} + ----------------- + {{ registerStandby.stdout }} + ================================================== + when: registerStandby is not skipped + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/register/main.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/register/main.yml new file mode 100644 index 0000000..297d67e --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/configure/standby/register/main.yml @@ -0,0 +1,30 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: dataguard register standby + when: + - database_config.db_role == 'physical_standby' + - hostvars['localhost']['standby'] is defined + - ansible_hostname in database_config.master_node + - "'prereqs' not in ansible_run_tags" + block: + + - name: DBaasCLI + ansible.builtin.include_tasks: dbaascli.yml + when: system_config.dbaascli_on + + rescue: + + - name: End execution + meta: end_play + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/dbaas_install.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/dbaas_install.yml new file mode 100644 index 0000000..ff933ad --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/dbaas_install.yml @@ -0,0 +1,4 @@ +- name: DBaaS Prereqs + ansible.builtin.import_role: + name: dbaas_prereqs + when: not system_config.dbaascli_on \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/main.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/main.yml new file mode 100644 index 0000000..fd0f0df --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tasks/main.yml @@ -0,0 +1,20 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: dataguard + when: oracle_facts.server.dbservers + block: + + - name: configure + import_tasks: configure/main.yml + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tests/inventory b/playbooks/dbaas-ansible-collection/roles/dataguard/tests/inventory new file mode 100644 index 0000000..03ca42f --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tests/inventory @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +localhost + diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/tests/test.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/tests/test.yml new file mode 100644 index 0000000..10ecf51 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/tests/test.yml @@ -0,0 +1,6 @@ +#SPDX-License-Identifier: MIT-0 +--- +- hosts: localhost + remote_user: root + roles: + - dataguard diff --git a/playbooks/dbaas-ansible-collection/roles/dataguard/vars/main.yml b/playbooks/dbaas-ansible-collection/roles/dataguard/vars/main.yml new file mode 100644 index 0000000..9652684 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dataguard/vars/main.yml @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +--- +# vars file for dataguard diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/README.md b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/README.md new file mode 100644 index 0000000..225dd44 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/defaults/main.yml b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/defaults/main.yml new file mode 100644 index 0000000..4e758e7 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/defaults/main.yml @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +--- +# defaults file for dbaas_prereqs diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/files/dbaasca.zip b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/files/dbaasca.zip new file mode 100644 index 0000000..71b863a Binary files /dev/null and b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/files/dbaasca.zip differ diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/handlers/main.yml b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/handlers/main.yml new file mode 100644 index 0000000..46519a5 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/handlers/main.yml @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +--- +# handlers file for dbaas_prereqs diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/meta/main.yml b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/meta/main.yml new file mode 100644 index 0000000..557450f --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/meta/main.yml @@ -0,0 +1,28 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +galaxy_info: + role_name: dbaas + author: Sebastian Alasino + description: Oracle Database as a Service (DBAAS) + company: Oracle + + license: license (MIT) + + min_ansible_version: 2.14.0 + + galaxy_tags: + - oracle + - database + +dependencies: + - oracle_facts \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/asm/asm_volume_create.yml b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/asm/asm_volume_create.yml new file mode 100644 index 0000000..6720a6e --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/asm/asm_volume_create.yml @@ -0,0 +1,136 @@ +--- +# +# Oracle GoldenGate MAA Deployment +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: ASM Volumen Create + become: true + become_user: "{{ grid_config.user }}" + environment: "{{ grid_env }}" + block: + + - name: ASM volcreate + shell: > + {{ grid_config.homePath }}/bin/asmcmd + volcreate + -G {{ asm.diskgroup.data }} + -s {{ asm.volume.size }} + {{ asm.volume.name | upper }} + when: + - grid_config.master_node in ansible_hostname + register: _asm_volcreate + failed_when: + - _asm_volcreate.rc != 0 + - "'ORA-15460' not in _asm_volcreate.stderr" + # ORA-15460: volume name 'VOL_HUB1' is already in use (DBD ERROR: OCIStmtExecute) + + - name: ASM volinfo + shell: > + {{ grid_config.homePath }}/bin/asmcmd + volinfo + -G {{ asm.diskgroup.data }} + {{ asm.volume.name }} + register: _asm_vol_info + + - name: mkfs acfs asm_vol_dev + become_user: root + shell: > + /sbin/mkfs + -t acfs {{ _asm_vol_info.stdout | regex_search('Volume Device: .*') | split(': ') | last }} + when: + - grid_config.master_node in ansible_hostname + - _asm_volcreate.changed + register: _acfs_mkfs + failed_when: + - _acfs_mkfs.rc != 0 + - "'ACFS-01010' not in _acfs_mkfs.stderr" + # ACFS-01010: Volume already contains an ACFS file system. + + - name: Create asm.volume.mountpath mount directory + become_user: root + file: + path: "{{ asm.volume.mountpath }}" + state: directory + mode: '0775' + owner: oracle + group: oinstall + # when: _acfs_mkfs.rc == 0 + + - name: Srvctl add filesystem + become_user: root + shell: > + {{ grid_config.homePath }}/bin/srvctl + add filesystem + -device {{ _asm_vol_info.stdout | regex_search('Volume Device: .*') | split(': ') | last }} + -volume {{ asm.volume.name }} + -diskgroup {{ asm.diskgroup.data }} + -path {{ asm.volume.mountpath }} + -mountowner oracle + -mountgroup oinstall + -mountperm 755 + when: + - grid_config.master_node in ansible_hostname + - _acfs_mkfs.changed + register: _srvctl_add_filesystem + failed_when: + - _srvctl_add_filesystem.rc != 0 + - "'PRCA-1112' not in _srvctl_add_filesystem.stdout" + # 'PRCA-1112 : Mount point path /mnt/hub_acfs1 is in use by another file system resource on node huba1' + + - name: Srvctl start filesystem + shell: > + {{ grid_config.homePath }}/bin/srvctl + start filesystem + -volume {{ asm.volume.name }} + -diskgroup {{ asm.diskgroup.data }} + register: _srvctl_start_filesystem + failed_when: + - _srvctl_start_filesystem.rc != 0 + - "'PRCR-1120' not in _srvctl_start_filesystem.stdout" + # PRCR-1120 : Resources are already running. + + - name: Gather server mounts facts + ansible.builtin.setup: + gather_subset: + # - "!all" + - "mounts" + +- name: DBaaS ACFS configure + become: true + when: + - dbaas_acfs | default(false) + - ansible_mounts | selectattr ('mount', 'equalto', asm.volume.mountpath ) + block: + + - name: Find asm.volume.mountpath file + stat: + path: "{{ asm.volume.mountpath }}" + register: asm_volume_mountpath_stat + + - name: Create dbaas_acfs directory + file: + path: "{{ asm.volume.mountpath }}/dbaas_acfs" + state: directory + mode: '0755' + owner: oracle + group: oinstall + when: asm_volume_mountpath_stat.stat.exists + register: create_dbaas_acfs_directory + + - name: Create dbaas_acfs link + file: + src: "{{ asm.volume.mountpath }}/dbaas_acfs" + dest: /var/opt/oracle/dbaas_acfs + state: link + owner: root + group: root + when: create_dbaas_acfs_directory is success + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/asm/main.yml b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/asm/main.yml new file mode 100644 index 0000000..f44f84a --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/asm/main.yml @@ -0,0 +1,24 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaaS PreReqs ASM + block: + + - name: ASM volume create + import_tasks: asm_volume_create.yml + when: + - asm_volume_create | default(false) + - (ansible_mounts | selectattr ('mount', 'equalto', asm.volume.mountpath )) | length == 0 + # - oracle_facts.system.crs_on + # - database_config.db_role is defined + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/database/main.yml b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/database/main.yml new file mode 100644 index 0000000..b1c911e --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/database/main.yml @@ -0,0 +1,58 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaaS PreReqs Database + when: database_config.db_role is defined + block: + + # - name: Database enable flashback + # import_tasks: sqlplus_execute.yml + # vars: + # sql_command: "{{ flashback_on }}" + # when: + # - db_flashback | default(false) + # - database_config.db_role == 'primary' + # - not database_config.flashback_on + + # - name: Database force logging + # import_tasks: sqlplus_execute.yml + # vars: + # sql_command: "{{ force_logging }}" + # when: + # - force_logging | default(false) + # - database_config.db_role == 'primary' + # - not database_config.flashback_on + + - name: Database enable flashback + sqlplus: + query: "{{ sql_flashback_on }}" + environment: "{{ oracle_env }}" + when: + - db_flashback | default(false) + - database_config.db_role == 'primary' + - not database_config.flashback_on + + - name: Database force logging + sqlplus: + query: "{{ sql_force_logging }}" + environment: "{{ oracle_env }}" + when: + - force_logging | default(false) + - database_config.db_role == 'primary' + - not database_config.force_logging_on + + - name: Database config TNS_ADMIN + import_tasks: tns_admin_config.yml + when: + - tns_admin_config | default(false) + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/database/sqlplus_execute.yml b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/database/sqlplus_execute.yml new file mode 100644 index 0000000..2bbbcd3 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/database/sqlplus_execute.yml @@ -0,0 +1,24 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Execute SQL command + shell: | + {{ database_config.homePath }}/bin/sqlplus -L -F -SILENT -nologintime "/ as sysdba" << EOF + {{ sql_command }} + exit + EOF + become: true + become_user: "{{ oracle_user }}" + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + environment: "{{ oracle_env }}" \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/database/tns_admin_config.yml b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/database/tns_admin_config.yml new file mode 100644 index 0000000..d11ba0d --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/database/tns_admin_config.yml @@ -0,0 +1,73 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Configure TNS admin + become: true + become_user: "{{ oracle_user }}" + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + environment: "{{ oracle_env }}" + block: + + - name: Find TNS_ADMIN/tnsnames.ora file + ansible.builtin.stat: + path: "{{ database_config.homePath }}/network/admin/{{ database_config.db_name }}/tnsnames.ora" + register: _tns_admin_tnsnames + + - name: Create TNS_ADMIN directory + file: + path: "{{ database_config.homePath }}/network/admin/{{ database_config.db_name }}" + state: directory + mode: '0755' + owner: "{{ oracle_user }}" + group: oinstall + when: not _tns_admin_tnsnames.stat.exists + + - name: Touch tnsnames.ora + ansible.builtin.file: + path: "{{ database_config.homePath }}/network/admin/tnsnames.ora" + state: touch + when: not _tns_admin_tnsnames.stat.exists + + - name: Copy tnsnames.ora to TNS_ADMIN directory + copy: + src: "{{ database_config.homePath }}/network/admin/tnsnames.ora" + dest: "{{ database_config.homePath }}/network/admin/{{ database_config.db_name }}" + owner: "{{ oracle_user }}" + group: oinstall + mode: u=rw,g=r,o= + remote_src: true + when: not _tns_admin_tnsnames.stat.exists + + - name: Setenv TNS_ADMIN + command: > + {{ database_config.homePath }}/bin/srvctl setenv database + -db {{ database_config.dbUniqueName }} + -env TNS_ADMIN={{ database_config.homePath }}/network/admin/{{ database_config.db_name }} + when: not _tns_admin_tnsnames.stat.exists + + - name: Database stop + shell: | + {{ database_config.homePath }}/bin/srvctl stop database -db {{ database_config.dbUniqueName }} -o immediate + when: + - not _tns_admin_tnsnames.stat.exists + - ansible_hostname in database_config.master_node + + - name: Database start + shell: | + {{ database_config.homePath }}/bin/srvctl start database -db {{ database_config.dbUniqueName }} + when: + - not _tns_admin_tnsnames.stat.exists + - ansible_hostname in database_config.master_node + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/main.yml b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/main.yml new file mode 100644 index 0000000..34216ca --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/main.yml @@ -0,0 +1,33 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaaS configure + when: + - oracle_facts.server.dbservers + - not oracle_facts.system.dbaascli_on + tags: always + block: + + - name: database + ansible.builtin.include_tasks: database/main.yml + # with_items: "{{ db_name_list }}" + # loop_control: + # loop_var: db_name + + - name: system + import_tasks: system/main.yml + + - name: asm + import_tasks: asm/main.yml + when: oracle_facts.system.crs_on + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/system/dbaas_acfs.yml b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/system/dbaas_acfs.yml new file mode 100644 index 0000000..cf34be5 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/system/dbaas_acfs.yml @@ -0,0 +1,42 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaaS ACFS configure + become: true + when: system_config.dbaascli_on is not true + block: + + - name: Find asm.volume.mountpath file + stat: + path: "{{ asm.volume.mountpath }}" + register: asm_volume_mountpath_stat + + - name: Create dbaas_acfs directory + file: + path: "{{ asm.volume.mountpath }}/dbaas_acfs" + state: directory + mode: '0755' + owner: oracle + group: oinstall + when: asm_volume_mountpath_stat.stat.exists + register: create_dbaas_acfs_directory + + - name: Create dbaas_acfs directory + file: + src: "{{ asm.volume.mountpath }}/dbaas_acfs" + dest: /var/opt/oracle/dbaas_acfs + state: link + owner: root + group: root + when: create_dbaas_acfs_directory is success + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/system/dbaasca_install.yml b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/system/dbaasca_install.yml new file mode 100644 index 0000000..f7cb36d --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/system/dbaasca_install.yml @@ -0,0 +1,112 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaaSCA configure + become: true + block: + + - name: Create dbaastools directory + file: + path: "{{ item }}" + state: directory + mode: '0755' + owner: oracle + group: oinstall + with_items: + - /var/opt/oracle/dbaastools + - /var/opt/oracle/log + - /var/opt/oracle/dbaastools/dbaasca + + # - name: Find DBaasCA zip file + # find: + # paths: "{{ stage_dir }}" + # patterns: "dbaasca.zip" + # register: dbaasca_zip_files + # delegate_to: localhost + # run_once: true + + # - name: Get current DBaasCA version + # shell: "{{ oracle_home }}/bin/dbca -version | grep Version" + # register: dbaasca_current_version + # become: true + # become_user: "{{ oracle_user }}" + # environment: + # ORACLE_HOME: "{{ oracle_home }}" + + # - name: Set DBaasCA version fact + # ansible.builtin.set_fact: + # dbaasca_current_version: "{{ dbaasca_current_version.stdout | split(':') | last }}" + + - name: Copy DBaasCA file + copy: + src: dbaasca.zip + dest: "{{ stage_dir.managed.software }}/" + owner: oracle + group: oinstall + mode: 0644 + # when: dbaasca_current_version is version(DBaaSCA_version, '<') + register: copy_dbaasca + + # - name: Copy DBaaS Tools files + # copy: + # src: dcs-agent-29.1.0.0.0_250307.0730-375.x86_64_7325.rpm + # dest: "{{ stage_dir.managed.software }}/" + # owner: oracle + # group: oinstall + # mode: 0644 + # # when: dbaasca_current_version is version(DBaaSCA_version, '<') + # register: copy_dcs_agent + + - name: Unarchive DBaasCA + ansible.builtin.unarchive: + src: "{{ stage_dir.managed.software }}/dbaasca.zip" + dest: /var/opt/oracle/dbaastools/dbaasca + owner: oracle + group: oinstall + remote_src: yes + environment: + CRYPTOGRAPHY_OPENSSL_NO_LEGACY: '1' + become_user: oracle + # when: dbaasca_current_version is version(DBaaSCA_version, '<') + # when: copy_dbaasca.changed + + # - name: Install dcs-agent rpm + # command: "rpm -Uvh {{ stage_dir.managed.software }}/dcs-agent-29.1.0.0.0_250307.0730-375.x86_64_7325.rpm --force" + # when: copy_dcs_agent.changed + + # - name: Restart service initdcsagent + # ansible.builtin.service: + # name: initdcsagent + # state: restarted + # when: copy_dcs_agent.changed + + # - name: Create dbaasca link + # file: + # dest: /var/opt/oracle/dbaastools/dbaasca + # src: /opt/oracle/dcs/dbaasca + # state: link + # owner: root + # group: root + + # - name: Recursively change ownership of /opt/oracle/dcs/dbaasca + # ansible.builtin.file: + # path: /opt/oracle/dcs/dbaasca + # state: directory + # recurse: yes + # mode: o=rx + + # - name: Change ownership of PILOT + # ansible.builtin.file: + # path: /opt/oracle/pilot/bin/pilot + # mode: o=rx + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/system/main.yml b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/system/main.yml new file mode 100644 index 0000000..305415c --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/system/main.yml @@ -0,0 +1,50 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaaS PreReqs System + block: + + - name: Configure SSH Equivalence + import_tasks: ssh_equivalence.yml + when: + - ssh_equivalence | default(false) + + - name: Create Database env file + become: true + become_user: "{{ oracle_user }}" + blockinfile: + dest: ~/{{ database_config.db_name }}.env + create: true + block: | + ORACLE_HOME={{ database_config.oracle_home }}; export ORACLE_HOME + ORACLE_BASE={{ database_config.oracle_base }}; export ORACLE_BASE + PATH=$PATH:{{ database_config.oracle_home }}/bin:{{ database_config.oracle_home }}/OPatch; export PATH + LD_LIBRARY_PATH={{ database_config.oracle_home }}/lib; export LD_LIBRARY_PATH + ORACLE_UNQNAME={{ database_config.db_unique_name }}; export ORACLE_UNQNAME + ORACLE_SID={{ database_config.instance_name }}; export ORACLE_SID + TNS_ADMIN={{ database_config.oracle_home }}/network/admin/{{ database_config.db_name }}; export TNS_ADMIN + when: + - db_env_file | default(false) + - database_config.db_role is defined + + - name: Install DBaasCA + import_tasks: dbaasca_install.yml + when: + - dbaasca_install | default(false) + + - name: Configure dbaas_acfs + import_tasks: dbaas_acfs.yml + when: + - dbaas_acfs | default(false) + - oracle_facts.system.crs_on + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/system/ssh_equivalence.yml b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/system/ssh_equivalence.yml new file mode 100644 index 0000000..a277083 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tasks/system/ssh_equivalence.yml @@ -0,0 +1,108 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: SSH Configure Equivalences + tags: ssh_equivalence + block: + + - name: Copy content into .ssh/config + become: true + copy: + dest: "/home/{{ item.user }}/.ssh/config" + owner: "{{ item.user }}" + group: "{{ item.group }}" + content: | + Host * + ServerAliveInterval 60 + ServerAliveCountMax 2 + with_items: + - { user: opc, group: opc } + - { user: grid, group: oinstall } + - { user: oracle, group: oinstall } + + - name: Create a 2048-bit SSH key for users grid/oracle + become: true + ansible.builtin.user: + name: "{{ item }}" + generate_ssh_key: yes + ssh_key_bits: 2048 + ssh_key_file: .ssh/id_rsa + with_items: + - grid + - oracle + - opc + + - name: Remove local id_rsa.pub files + ansible.builtin.file: + path: "{{ stage_dir.control.tmp }}/sshkey_{{ ansible_limit }}_{{ inventory_hostname }}_{{ item }}_id_rsa.pub" + state: absent + with_items: + - opc + - grid + - oracle + delegate_to: localhost + + - name: Fetch id_rsa.pub files + become: true + ansible.builtin.fetch: + src: "/home/{{ item }}/.ssh/id_rsa.pub" + dest: "{{ stage_dir.control.tmp }}/sshkey_{{ ansible_limit }}_{{ inventory_hostname }}_{{ item }}_id_rsa.pub" + flat: yes + with_items: + - opc + - grid + - oracle + + - name: Set authorized key taken for user oracle + become: true + environment: + CRYPTOGRAPHY_OPENSSL_NO_LEGACY: '1' + authorized_key: + user: oracle + state: present + key: "{{ lookup('file', '{{ item }}') }}" + with_fileglob: + - "{{ stage_dir.control.tmp }}/sshkey_{{ ansible_limit }}_*_oracle_id_rsa.pub" + + - name: Set authorized key taken for user grid + become: true + environment: + CRYPTOGRAPHY_OPENSSL_NO_LEGACY: '1' + authorized_key: + user: grid + state: present + key: "{{ lookup('file', '{{ item }}') }}" + with_fileglob: + - "{{ stage_dir.control.tmp }}/sshkey_{{ ansible_limit }}_*_grid_id_rsa.pub" + + - name: Set authorized key taken for user opc + become: true + environment: + CRYPTOGRAPHY_OPENSSL_NO_LEGACY: '1' + authorized_key: + user: opc + state: present + key: "{{ lookup('file', '{{ item }}') }}" + with_fileglob: + - "{{ stage_dir.control.tmp }}/sshkey_{{ ansible_limit }}_*_opc_id_rsa.pub" + + rescue: + + # default is => Fail execution of Playbook + - name: Fail execution of gghub_equivalences_config + ansible.builtin.fail: + msg: >- + Set gghub_equivalences_config=false in inventory/group_vars/gghservers to disable this fail task. + when: + - gghub_equivalences_config | default(true) + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tests/inventory b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tests/inventory new file mode 100644 index 0000000..03ca42f --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tests/inventory @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +localhost + diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tests/test.yml b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tests/test.yml new file mode 100644 index 0000000..8428c40 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/tests/test.yml @@ -0,0 +1,6 @@ +#SPDX-License-Identifier: MIT-0 +--- +- hosts: localhost + remote_user: root + roles: + - dbaas_prereqs diff --git a/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/vars/main.yml b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/vars/main.yml new file mode 100644 index 0000000..33febf2 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/dbaas_prereqs/vars/main.yml @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +--- +# vars file for dbaas_prereqs diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/README.md b/playbooks/dbaas-ansible-collection/roles/oracle_facts/README.md new file mode 100644 index 0000000..225dd44 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/defaults/main.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/defaults/main.yml new file mode 100644 index 0000000..0908ba9 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/defaults/main.yml @@ -0,0 +1,8 @@ +--- +# defaults file for oracle_facts + +oracle_fact_system_ignore_failed: false +_dbHomeTargetExists: false +_ggHomeTargetExists: false + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/handlers/main.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/handlers/main.yml new file mode 100644 index 0000000..217bd63 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/handlers/main.yml @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +--- +# handlers file for oracle_facts diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/meta/main.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/meta/main.yml new file mode 100644 index 0000000..af024df --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/meta/main.yml @@ -0,0 +1,19 @@ +#SPDX-License-Identifier: MIT-0 +galaxy_info: + role_name: oracle_facts + author: Sebastian Alasino + description: Gather Ansible Facts from Oracle Grid and Database + company: Oracle + + license: license (MIT) + + min_ansible_version: 2.18.0 + + galaxy_tags: + - oracle + - database + +dependencies: [] + +collections: + - community.general \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/control_node/assert/main.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/control_node/assert/main.yml new file mode 100644 index 0000000..18d895a --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/control_node/assert/main.yml @@ -0,0 +1,84 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to perform various life-cycle and administration operations on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Validate Ansible Control Node + delegate_to: localhost + run_once: true + block: + + - name: Verify you are using a supported Ansible version on your Ansible host + ansible.builtin.assert: + quiet: true + that: + - ansible_version['full'] is version(oracle_ansible_version, '>=') + # success_msg: Ansible {{ ansible_version['full'] }} is supported. + fail_msg: Ansible {{ ansible_version['full'] }} has reached End of Life (EoL). Please upgrade to a supported Ansible release. Check the README for more details. + + - name: Extract the version of Jinja2 installed on your Ansible host + ansible.builtin.command: ansible --version + register: ansible_version_list + changed_when: false + + - name: Verify that you are using a supported python version on your Ansible host + ansible.builtin.assert: + quiet: true + that: (ansible_version_list['stdout'] | regex_search('python version = ([\\d.]+)', '\\1') | first) is version(oracle_python_version, '>=') + # success_msg: Python {{ ansible_version_list['stdout'] | regex_search('python version = ([\d.]+)', '\1') | first }} is supported. + fail_msg: Python {{ ansible_version_list['stdout'] | regex_search('python version = ([\d.]+)', '\1') | first }} is not supported. Please upgrade to python {{ oracle_python_version }}. Check the README for more details. + + - name: Verify that you are using a supported Jinja2 version on your Ansible host + ansible.builtin.assert: + quiet: true + that: (ansible_version_list['stdout'] | regex_search('jinja version = ([\\d.]+)', '\\1') | first) is version(oracle_jinja2_version, '>=') + # success_msg: Jinja2 {{ ansible_version_list['stdout'] | regex_search('jinja version = ([\d.]+)', '\1') | first }} is supported. + fail_msg: Jinja2 {{ ansible_version_list['stdout'] | regex_search('jinja version = ([\d.]+)', '\1') | first }} is not supported. Please upgrade to Jinja2 {{ oracle_jinja2_version }}. Check the README for more details. + + - name: Extract the list of Ansible collections installed on your Ansible host + ansible.builtin.command: ansible-galaxy collection list + register: collection_list + changed_when: false + + - name: Verify that the 'community.general' Ansible collection is installed on your Ansible host + ansible.builtin.assert: + quiet: true + that: collection_list is search('community.general') + # success_msg: The 'community.general' Ansible collection is installed. + fail_msg: The 'community.general' Ansible collection is not installed. Please install the 'community.general' Ansible collection. Check the README for more details. + + - name: Verify that the 'ansible.posix' Ansible collection is installed on your Ansible host + ansible.builtin.assert: + quiet: true + that: lookup('community.general.collection_version', 'ansible.posix') != 'none' + # success_msg: The 'ansible.posix' Ansible collection is installed. + fail_msg: The 'ansible.posix' Ansible collection is not installed. Please install the 'ansible.posix' Ansible collection. Check the README for more details. + when: oracle_selinux | default(false) | bool + + rescue: + + - name: Assert failed assert control_node + ansible.builtin.debug: + msg: "{{ item.assertion }}" + with_items: + - "{{ ansible_version_list['results'] }}" + - "{{ collection_list['results'] }}" + when: + - oracle_meta_assert_control_node | default(true) + - item.failed is defined + - item.failed | bool + + - name: Fail execution of oracle_meta + ansible.builtin.fail: + msg: >- + See previous debug task for assertation failure + Set oracle_meta_assert_control_node=false in inventory/group_vars/all to disable this fail task. + when: + - oracle_meta_assert_control_node | default(true) \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/control_node/assert/password.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/control_node/assert/password.yml new file mode 100644 index 0000000..d4c94a5 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/control_node/assert/password.yml @@ -0,0 +1,62 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: assert oracle_meta_assert_password + when: + - oracle_meta_assert_password | default(true) + tags: + - always + - oracle_assert + block: + + - name: Assert password + ansible.builtin.assert: + that: + - "{{ assert_password }} | length >= 8" + - "{{ assert_password }} | length <= 30" + - "{{ assert_password }} | regex_search('[0-9]')" + - "{{ assert_password }} | regex_search('[a-z]')" + - "{{ assert_password }} | regex_search('[A-Z]')" + - "{{ assert_password }} | select('search', regex)" + vars: + PATTERNS: + - '\-' + - '\!' + - '\@' + - '\%' + - '\&' + - '\*' + - '\.' + - '\#' + - '\_' + regex: "{{ PATTERNS | join('|') }}" + + rescue: + + - name: Assert password failed + debug: + msg: >- + Password length should be between 8 and 30 characters, and should contain at least: + * One lowercase [a..z] character + * One uppercase [A..Z] character + * One digit [0..9] + * One special character [- ! @ % & * . # _] + + # default is => Fail execution of Playbook + - name: Fail execution of oracle_meta + ansible.builtin.fail: + msg: >- + Set oracle_meta_assert_password=false in inventory/group_vars/all to disable this fail task. + when: + - oracle_meta_assert_password | default(true) + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/control_node/prerequisites/main.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/control_node/prerequisites/main.yml new file mode 100644 index 0000000..b87645a --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/control_node/prerequisites/main.yml @@ -0,0 +1,20 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +# - name: Create the host_vars file +# delegate_to: localhost +# become: false +# ansible.builtin.file: +# path: "{{ playbook_dir }}/host_vars/{{ inventory_hostname }}" +# state: touch + +... diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/assert/database.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/assert/database.yml new file mode 100644 index 0000000..68edc59 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/assert/database.yml @@ -0,0 +1,62 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: assert ansible-oracle variables + tags: + - always + - oracle_assert + block: + + - name: Check switch for oracle_facts_assert_oracle_database + ansible.builtin.debug: + msg: >- + WARNING!!! Assert for oracle_database has been disabled! + when: + - not oracle_facts_assert_oracle_database | bool + + - name: assert oracle_database + when: + - oracle_facts_assert_oracle_database | bool + block: + - name: assert oracle_database + ansible.builtin.assert: + quiet: true + that: + - ass_odb.db_name is defined + with_items: + - "{{ db_name }}" + loop_control: + label: "{{ ass_odb.oracle_db_name | default('') }}" + loop_var: ass_odb + when: + - db_name is defined + register: oracle_database_assert + + rescue: + + - name: assert failed assert db_name + ansible.builtin.debug: + msg: "{{ item.assertion }}" + with_items: + - "{{ oracle_database_assert['results'] }}" + loop_control: + label: "{{ item['dbc']['key'] | default('') }}" + when: + - oracle_database_assert.results is defined + - item.failed is defined + - item.failed | bool + + - name: fail assert db_name + ansible.builtin.fail: + msg: "See previous debug task for assertation failure" + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/assert/grid.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/assert/grid.yml new file mode 100644 index 0000000..88125bc --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/assert/grid.yml @@ -0,0 +1,66 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: assert oracle_meta_assert_grid + when: + - oracle_meta_assert_grid | default(true) + - oracle_facts.grid.state is defined + tags: + - always + - oracle_assert + block: + + - name: Assert Grid Infrasructure + ansible.builtin.assert: + quiet: true + that: + - orafac.state == 'NORMAL' + # - orafac.activeVersion|split('.')|first|int == orafac.patchVersion|split('.')|first|int + with_items: + - "{{ oracle_facts.grid }}" + loop_control: + label: "{{ oracle_facts.grid | default('') }}" + loop_var: orafac + + - name: Verify you are using a supported Oracle Grid Infrastructure + ansible.builtin.assert: + that: + - oracle_facts.grid['activeVersion'] is version(oracle_grid_infrastructure, '>=') + success_msg: Oracle Grid Infrastructure {{ oracle_facts.grid['activeVersion'] }} is supported. + fail_msg: Oracle Grid Infrastructure {{ oracle_facts.grid['activeVersion'] }} has reached End of Life (EoL). Please upgrade to a supported Ansible release. Check the README for more details. + + # - pause: + # seconds: 0 + # prompt: | + # ================================================== + # Oracle Grid Infrastructure + # {% for host in ansible_play_hosts %} + # ----------------- + # Hostname: {{ inventory_hostname }} + # Stage: {{ hostvars[host]['oracle_facts']['grid']['state'] }} + # Activie Version: {{ hostvars[host]['oracle_facts']['grid']['activeVersion'] }} + # {% endfor %} + # ================================================== + # tags: [print_action] + + + rescue: + + # default is => Fail execution of Playbook + - name: Fail execution of oracle_meta + ansible.builtin.fail: + msg: >- + Set oracle_meta_assert_grid=false in inventory/group_vars/all to disable this fail task. + when: + - oracle_meta_assert_grid | default(true) + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/assert/main.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/assert/main.yml new file mode 100644 index 0000000..0e6448c --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/assert/main.yml @@ -0,0 +1,19 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Assert dbserver_grid + ansible.builtin.include_tasks: grid.yml + +- name: Assert dbserver_database + ansible.builtin.include_tasks: database.yml + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database/crs.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database/crs.yml new file mode 100644 index 0000000..2fdd989 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database/crs.yml @@ -0,0 +1,76 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: crs + become: true + become_user: "{{ grid_user }}" + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + _db_unique_name: "{{ srvctl_config_database_output.stdout | regex_search(db_name + '(.+)') }}" + _oracle_home: "{{ srvctl_config_database_home_output.stdout | regex_findall(_db_unique_name + ' (.*)') | join(',') }}" + block: + + - name: Getting process IDs of SMON + community.general.pids: + pattern: "ora_smon_{{ db_name }}.*" + register: smon_running + + - name: Discover database DB_UNIQUE_NAME + shell: "{{ oracle_facts.system.grid_home }}/bin/srvctl config database" + register: srvctl_config_database_output + when: smon_running.pids | length > 0 + environment: "{{ grid_env }}" + + - name: Discover database oracle_home + shell: "{{ oracle_facts.system.grid_home }}/bin/srvctl config database -home | awk '{ print $1,$2 }'" + register: srvctl_config_database_home_output + when: + - _db_unique_name is defined + - _db_unique_name | length > 0 + become: true + environment: "{{ grid_env }}" + + # - name: Discover database config + # shell: "{{ _oracle_home }}/bin/srvctl config database -db {{ _db_unique_name }}" + # when: + # - _db_unique_name is defined + # - _db_unique_name | length > 0 + # - _oracle_home | length > 0 + # register: srvctl_config_database_parameters + + - name: srvctl status instance + shell: "{{ _oracle_home }}/bin/srvctl status instance -db {{ _db_unique_name }} -node {{ ansible_hostname }}" + when: + - _db_unique_name is defined + - _db_unique_name | length > 0 + - _oracle_home | length > 0 + register: srvctl_status_instnace_output + + - name: Generate oracle_env_crs + set_fact: + oracle_env_crs: | + ORACLE_HOME: {{ _oracle_home }} + PATH: $PATH:{{ _oracle_home }}/bin + LD_LIBRARY_PATH: {{ _oracle_home }}/lib + ORACLE_SID: {{ srvctl_status_instnace_output | ternary(srvctl_status_instnace_output.stdout | regex_findall('Instance (.*) is running on node') | join(','), 'not_found') }} + # 'ORACLE_SID': {{ srvctl_status_instnace_output.stdout | regex_findall('Instance (.*) is running on node') | join(',') }} + oracle_home_crs: "{{ _oracle_home }}" + oracle_sid_crs: "{{ srvctl_status_instnace_output | ternary(srvctl_status_instnace_output.stdout | regex_findall('Instance (.*) is running on node') | join(','), 'not_found') }}" + # master_node_crs: "{{ (srvctl_config_database_parameters.stdout | regex_findall('Configured nodes: (.*)')) | intersect(ansible_play_hosts | map('extract', hostvars, 'ansible_hostname')) | sort | first }}" + when: + - smon_running.pids | length > 0 + - srvctl_config_database_output.changed + - srvctl_config_database_home_output.changed + - srvctl_status_instnace_output.changed + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database/lvm.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database/lvm.yml new file mode 100644 index 0000000..5dd2a01 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database/lvm.yml @@ -0,0 +1,51 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: lvm + become: true + become_user: "{{ oracle_user }}" + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + block: + + - name: Find /etc/oratab + stat: + path: /etc/oratab + register: _oratab_file_found + + - name: Reading /etc/oratab + slurp: + src: /etc/oratab + register: _oratab_file + when: _oratab_file_found.stat.exists + + - name: Getting process IDs of SMON + community.general.pids: + name: "ora_smon_{{ _oratab_file.content | b64decode | regex_search(db_name+':') | replace(':','') }}" + register: smon_running + + - name: Generate oracle_env_lvm + set_fact: + oracle_env_lvm: | + ORACLE_HOME: "{{ (_oratab_file.content | b64decode | regex_search(db_name+'(.+):') | split(':'))[1] }}" + PATH: "$PATH:{{ (_oratab_file.content | b64decode | regex_search(db_name+'(.+):') | split(':'))[1]}}/bin" + LD_LIBRARY_PATH: "{{ (_oratab_file.content | b64decode | regex_search(db_name+'(.+):') | split(':'))[1] }}/lib" + ORACLE_SID: "{{ _oratab_file.content | b64decode | regex_search(db_name+':') | replace(':','') }}" + oracle_home_lvm: "{{ (_oratab_file.content | b64decode | regex_search(db_name+'(.+):') | split(':'))[1] }}" + oracle_sid_lvm: "{{ _oratab_file.content | b64decode | regex_search(db_name+':') | replace(':','') }}" + when: + - _oratab_file_found.stat.exists + - _oratab_file.content | length > 0 + - smon_running.pids | length > 0 + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database/main.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database/main.yml new file mode 100644 index 0000000..15b2694 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database/main.yml @@ -0,0 +1,143 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: lvm + import_tasks: lvm.yml + when: not oracle_facts.system.crs_on + +- name: crs + import_tasks: crs.yml + when: oracle_facts.system.crs_on + +- name: database + become: true + become_user: "{{ oracle_user }}" + become_flags: "--login" + when: ((oracle_env_crs is defined) or (oracle_env_lvm is defined)) + vars: + ansible_shell_allow_world_readable_temp: true + oracle_env_fact: "{{ oracle_facts.system.crs_on | ternary(oracle_env_crs, oracle_env_lvm) }}" + oracle_home: "{{ oracle_facts.system.crs_on | ternary(oracle_home_crs, oracle_home_lvm) }}" + oracle_sid: "{{ oracle_facts.system.crs_on | ternary(oracle_sid_crs, oracle_sid_lvm) }}" + block: + + - name: Discover database parameters + sqlplus: + oracle_home: "{{ oracle_home }}" + oracle_sid: "{{ oracle_sid }}" + query: "{{ sql_db_parameters }}" + register: db_parameter_sqlplus_result + + - name: Generate db_parameter_csv + set_fact: + db_parameter_sqlplus: | + {%- for item in db_parameter_sqlplus_result.results -%} + {{ item }} + {% endfor %} + when: db_parameter_sqlplus_result.results is defined + + # - name: Select from v$database + # shell: | + # $ORACLE_HOME/bin/sqlplus -L -F -SILENT -MARKUP "CSV ON QUOTE OFF" -nologintime "/ as sysdba" << EOF + # select open_mode,flashback_on,database_role,DATAGUARD_BROKER,GUARD_STATUS,FORCE_LOGGING from v$database; + # exit + # EOF + # environment: "{{ oracle_env_fact }}" + # when: + # - _oratab_file_found.stat.exists + # - smon_running.pids | length > 0 + # register: _v_database_ouput + # failed_when: + # # ORA-01034: ORACLE not available + # - _v_database_ouput.rc != 0 + # - "'ORA-01034' not in _v_database_ouput.stdout" + + - name: Discover database options + sqlplus: + oracle_home: "{{ oracle_home }}" + oracle_sid: "{{ oracle_sid }}" + query: "{{ sql_db_options }}" + register: db_options_sqlplus_result + + - name: Generate db_options_csv + set_fact: + db_options_sqlplus: | + {%- for item in db_options_sqlplus_result.results -%} + {{ item | lower }} + {% endfor %} + when: db_options_sqlplus_result.results is defined + + - name: Get oraversion full version + shell: | + {{ oracle_home }}/bin/oraversion -compositeVersion + register: _oraversion + + - name: Discover database instances + sqlplus: + oracle_home: "{{ oracle_home }}" + oracle_sid: "{{ oracle_sid }}" + query: "select * from gv$instance;" + register: instances_sqlplus_result + + - name: Generate instance_options_csv + set_fact: + instance_options_sqlplus: | + {%- for item in instances_sqlplus_result.results -%} + {{ item | lower }} + {% endfor %} + when: instances_sqlplus_result.results is defined + + - name: Write facts to database_facts + ansible.builtin.set_fact: + cacheable: false + oracle_facts: "{{ oracle_facts | default({}) | combine(_db_facts | items2dict) }}" + vars: + _db_facts: + - key: "{{ db_parameter_sqlplus | regex_findall('db_name,(.*)') | join }}" + value: + db_name: "{{ db_parameter_sqlplus | regex_findall('db_name,(.*)') | join }}" + db_unique_name: "{{ db_parameter_sqlplus | regex_findall('db_unique_name,(.*)') | join }}" + instance_name: "{{ db_parameter_sqlplus | regex_findall('instance_name,(.*)') | join }}" + oracle_home: "{{ oracle_home }}" + db_role: "{{ db_options_sqlplus | community.general.from_csv | map(attribute='database_role') | join | replace(' ','_') }}" + db_domain: "{{ db_parameter_sqlplus | regex_findall('db_domain,(.*)') | join }}" + db_type: "{{ instance_options_sqlplus | community.general.from_csv | map(attribute='database_type') | unique | join }}" + oracle_home_version: "{{ _oraversion.stdout }}" + open_mode: "{{ db_options_sqlplus | community.general.from_csv | map(attribute='database_role') | join | replace(' ','_') }}" + flashback_on: "{% if (db_options_sqlplus | community.general.from_csv | map(attribute='flashback_on') | join) == 'yes' %}{{ true|bool}}{% else %}{{ false|bool}}{% endif %}" + force_logging_on: "{% if (db_options_sqlplus | community.general.from_csv | map(attribute='force_logging') | join) == 'yes' %}{{ true|bool}}{% else %}{{ false|bool}}{% endif %}" + dg_on: "{% if (db_options_sqlplus | community.general.from_csv | map(attribute='dataguard_broker') | join) == 'enabled' %}{{ true|bool}}{% else %}{{ false|bool}}{% endif %}" + master_node: "{{ (instance_options_sqlplus | community.general.from_csv | map(attribute='host_name')) | intersect(ansible_play_hosts | map('extract', hostvars, 'ansible_hostname')) | sort | first }}" + configured_nodes: "{{ instance_options_sqlplus | community.general.from_csv | map(attribute='host_name') | sort | join(',') }}" + tde_on: "{% if (db_parameter_sqlplus | regex_findall('wallet_root,(.*)') | first) | length > 0 %}{{ true| bool}}{% else %}{{ false| bool}}{% endif %}" + wallet_root: "{{ db_parameter_sqlplus | regex_findall('wallet_root,(.*)') | first }}" + processes: "{{ db_parameter_sqlplus | regex_findall('processes,(.*)') | first }}" + sga_target: "{{ db_parameter_sqlplus | regex_findall('sga_target,(.*)') | first }}" + pga_aggregate_target: "{{ db_parameter_sqlplus | regex_findall('pga_aggregate_target,(.*)') | first }}" + db_recovery_file_dest_size: "{{ db_parameter_sqlplus | regex_findall('db_recovery_file_dest_size,(.*)') | first }}" + + - debug: + msg: "{{ output | regex_findall('([^\n,]+)') }}" + vars: + output: | + ================================================== + Oracle oracle_facts + ----------------- + "{{ oracle_facts | community.general.json_query(db_name) }}" + ================================================== + when: + - oracle_facts is defined + - ansible_hostname in database_config.master_node + tags: [print_action] + ignore_errors: true + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database_backup/dbaasca/getDetails.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database_backup/dbaasca/getDetails.yml new file mode 100644 index 0000000..708c1dd --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database_backup/dbaasca/getDetails.yml @@ -0,0 +1,234 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +# TODO: +# srvctl config database -db DB0528_gh7_zrh -S 1 + +- name: Discover database DB_UNIQUE_NAME + shell: "$ORACLE_HOME/bin/srvctl config database" + # when: database_config.db_role is defined + register: _database_unique_name_output + failed_when: _database_unique_name_output.rc > 1 + become: true + environment: "{{ grid_env }}" + +- name: Set _dbUniqueName fact + set_fact: + _dbUniqueName: "{{ item | regex_search(db_name + '(.+)') }}" + with_items: "{{ _database_unique_name_output.stdout_lines }}" + when: + # - database_config.db_role is defined + - _database_unique_name_output is defined + - _database_unique_name_output.stdout is iterable + - _database_unique_name_output.stdout | length > 0 + +- name: Discover database oracle_home + shell: "$ORACLE_HOME/bin/srvctl config database -home | awk '{ print $1,$2 }'" + register: _srvctl_config_database + when: + - _dbUniqueName is defined + - _dbUniqueName | length > 0 + become: true + environment: "{{ grid_env }}" + +- name: Set _oracle_home fact + set_fact: + _oracle_home: "{{ _srvctl_config_database.stdout | regex_findall(_dbUniqueName + ' (.*)') | first }}" + # _oracle_home: "{{ item | regex_search(db_name + '(.*)') | split(' ') | last }}" + # with_items: "{{ _srvctl_config_database.stdout_lines }}" + when: + - _dbUniqueName is defined + - _dbUniqueName | length > 0 + - _srvctl_config_database.changed|bool + +- name: Discover database OS user + ansible.builtin.stat: + path: "{{ _oracle_home }}/bin/oracle" + when: + - _dbUniqueName is defined + - _dbUniqueName | length > 0 + - _srvctl_config_database.changed|bool + register: _oracle_home_user + +- name: Discover DBaasCA facts + when: + - _dbUniqueName is defined + - _dbUniqueName | length > 0 + - _srvctl_config_database.changed|bool + - _oracle_home is defined + become: true + become_user: "{{ _oracle_home_user.stat.pw_name }}" + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + environment: + ORACLE_HOME: "{{ _oracle_home }}" + block: + + - name: Discover database dbnode list + shell: "{{ _oracle_home }}/bin/srvctl status database -db {{ _dbUniqueName }} | grep 'is running on node' | awk '{print $NF}' | sort -r | tail -1" + register: _dbnode_list + + - name: Discover database config + command: "{{ _oracle_home }}/bin/srvctl config database -db {{ _dbUniqueName }}" + register: _database_details + + - name: Discover instance status + shell: "{{ _oracle_home }}/bin/srvctl status instance -db {{ _dbUniqueName }} -node {{ ansible_hostname }}" + register: _srvctl_status_instance + failed_when: + - _srvctl_status_instance.rc != 0 + - not (('PRCD-1035' in _srvctl_status_instance.stdout) or + ('PRKO-3133' in _srvctl_status_instance.stdout)) + # PRCD-1035 : Database DB0121_hnx_dxb is not a cluster database + # PRKO-3133 : Database DB0520_zgpv has no instance on node sazrhdb32 + + - name: Set _instance_name fact + ansible.builtin.set_fact: + _instance_name: "{{ (_srvctl_status_instance.rc == 0) | ternary((_srvctl_status_instance.stdout | regex_findall('Instance (.*) is running on node') | first), (_database_details.stdout | regex_findall('Database instance: (.*)') | first)) | default('no_instanace_found') }}" + + - name: Discover database parameters + shell: | + {{ _oracle_home }}/bin/sqlplus -L -F -SILENT -MARKUP "CSV ON QUOTE OFF DELIMITER :" -nologintime "/ as sysdba" << EOF + select name,value + from v\$parameter + where name in ('processes','pga_aggregate_target','sga_target','db_recovery_file_dest_size','wallet_root'); + exit + EOF + environment: + ORACLE_SID: "{{ _instance_name }}" + when: _database_details.rc == 0 + register: _database_parameters + failed_when: + # ORA-01034: ORACLE not available + - _database_parameters.rc != 0 + - "'ORA-01034' not in _database_parameters.stdout" + + - name: Select from v$database + shell: | + {{ _oracle_home }}/bin/sqlplus -L -F -SILENT -MARKUP "CSV ON QUOTE OFF" -nologintime "/ as sysdba" << EOF + select open_mode,flashback_on from v\$database; + exit + EOF + environment: + ORACLE_SID: "{{ _instance_name }}" + when: + - _database_details.rc == 0 + - "'ORA-01034' not in _database_parameters.stdout" + register: _v_database_ouput + failed_when: + # ORA-01034: ORACLE not available + - _v_database_ouput.rc != 0 + - "'ORA-01034' not in _v_database_ouput.stdout" + + # - name: Check open mode of database + # oracle_sqlplus_module: + # oracle_home: "{{ _oracle_home }}" + # oracle_sid: "{{ _instance_name }}" + # sql_statement: 'select open_mode from v$database;' + # environment: + # ORACLE_SID: "{{ _instance_name }}" + # ORACLE_HOME: "{{ _oracle_home }}" + # ignore_errors: true + + - name: Get oraversion full version + shell: | + {{ _oracle_home }}/bin/oraversion -compositeVersion + when: _oracle_home is defined + register: _oraversion + + - name: Write facts to database_facts + ansible.builtin.set_fact: + cacheable: false + database_facts: "{{ database_facts | default({}) | combine(_db_facts | items2dict) }}" + when: + - _dbUniqueName is defined + - _dbUniqueName | length > 0 + - _database_details.rc == 0 + - _instance_name != "no_instanace_found" + - "'ORA-01034' not in _database_parameters.stdout" + vars: + _db_facts: + - key: "{{ db_name }}" + value: + db_name: "{{ db_name }}" + dbUniqueName: "{{ _database_details.stdout | regex_findall('Database unique name: (.*)') | first }}" + db_role: "{{ _database_details.stdout | regex_findall('Database role: (.*)') | first }}" + dbDomain: "{{ _database_details.stdout | regex_findall('Domain: (.*)') | first }}" + dbType: "{{ _database_details.stdout | regex_findall('Type: (.*)') | first }}" + disk_groups: "{{ _database_details.stdout | regex_findall('Disk Groups: (.*)') | first }}" + mount_point_paths: "{{ _database_details.stdout | regex_findall('Mount point paths: (.*)') | first }}" + Services: "{{ _database_details.stdout | regex_findall('Services: (.*)') | first }}" + master_node: "{{ _database_details.stdout | regex_findall('Configured nodes: (.*)') | first | split(',') | intersect(ansible_play_hosts | map('extract', hostvars, 'ansible_hostname') ) | sort | first }}" + user: "{{ _oracle_home_user.stat.pw_name }}" + patchVersion: "{{ _oraversion.stdout }}" + homePath: "{{ _database_details.stdout | regex_findall('Oracle home: (.*)') | first }}" + openMode: "{{ _v_database_ouput.stdout[1:] | community.general.from_csv | first | community.general.json_query('OPEN_MODE') | default('') | replace(' ','_') }}" + flashbackMode: "{{ _v_database_ouput.stdout[1:] | community.general.from_csv | first | community.general.json_query('FLASHBACK_ON') | default('OFF') }}" + tdeDetails: + walletRootEnabled: "{% if (_database_parameters.stdout | regex_findall('wallet_root:(.*)') | first) | length > 0 %}TRUE{% else %}FALSE{% endif %}" + walletLocation: "{{ _database_parameters.stdout | regex_findall('wallet_root:(.*)') | first }}" + dbNodeLevelDetails: + homePath: "{{ _database_details.stdout | regex_findall('Oracle home: (.*)') | first }}" + patchVersion: "{{ _oraversion.stdout }}" + instanceName: "{{ _instance_name | default('no_instanace_found') }}" + openMode: "{{ _v_database_ouput.stdout[1:] | community.general.from_csv | first | community.general.json_query('OPEN_MODE') | replace(' ','_') }}" + register: _database_facts + + - debug: + msg: "{{ output | split('\n') | default('Database not found') }}" + vars: + output: | + ================================================== + DBaasCA Oracle Database Facts + ----------------- + dbUniqueName: {{ database_facts[db_name].dbUniqueName }} + db_role: {{ database_facts[db_name].db_role }} + dbType: {{ database_facts[db_name].dbType }} + homePath: {{ database_facts[db_name].homePath }} + flashbackMode: {{ database_facts[db_name].flashbackMode }} + openMode: {{ database_facts[db_name].openMode }} + tdeDetails: + walletRootEnabled: {{ database_facts[db_name].tdeDetails.walletRootEnabled }} + walletLocation: {{ database_facts[db_name].tdeDetails.walletLocation }} + dbNodeLevelDetails: + instanceName: {{ database_facts[db_name].dbNodeLevelDetails.instanceName }} + patchVersion: {{ database_facts[db_name].dbNodeLevelDetails.patchVersion }} + homePath: {{ database_facts[db_name].dbNodeLevelDetails.homePath }} + status: {{ database_facts[db_name].dbNodeLevelDetails.openMode }} + ================================================== + when: + - ansible_hostname in grid_config.master_node + - database_facts is defined + + rescue: + # default is + # => Fail execution of Playbook + - name: Fail execution of oradb_facts + ansible.builtin.fail: + msg: >- + Set oradb_facts_ignore_unreachable=false in db_name + to disable this fail task. + when: + - not _odb_loop_helper.oradb_facts_ignore_unreachable | default(false) + + - name: Write empty facts to oracledb.db_unique_name (rescue from failure above) + ansible.builtin.set_fact: + cacheable: false + database_facts: "{{ database_facts | default({}) | combine(_db_facts | items2dict) }}" + vars: + _db_facts: + - key: "{{ db_name }}" + value: + state: unreachable + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database_backup/dbaascli/getDetails.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database_backup/dbaascli/getDetails.yml new file mode 100644 index 0000000..007ad16 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database_backup/dbaascli/getDetails.yml @@ -0,0 +1,56 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaasCLI database getdetails + become: true + shell: "dbaascli database getDetails --db_name {{ db_name }} --reload --showOutputDelimiter | sed -n '/Start of output/, /End of output/{ /Start of output/! { /End of output/! p }}'" + register: _dbaascli_database_getDetails + +- name: Write DB facts from _dbaascli_database_getDetails + ansible.builtin.set_fact: + cacheable: false + database_facts: "{{ database_facts | default({}) | combine(_database | items2dict) }}" + when: + - _dbaascli_database_getDetails is defined + - _dbaascli_database_getDetails.stdout | length > 0 + vars: + _database: + - key: "{{ db_name }}" + value: "{{ _dbaascli_database_getDetails.stdout }}" + +- debug: + msg: "{{ output | split('\n') | default('Database not found') }}" + vars: + output: | + ================================================== + DBaasCLI Oracle Database Facts + ----------------- + db_name: {{ database_facts[db_name].db_name }} + dbUniqueName: {{ database_facts[db_name].dbUniqueName }} + db_role: {{ database_facts[db_name].db_role }} + dgEnabled: {{ database_facts[db_name].dgEnabled }} + patchVersion: {{ database_facts[db_name].patchVersion }} + dbNodeLevelDetails: + nodeName: {{ database_facts[db_name].dbNodeLevelDetails | json_query('*.nodeName') | join(',') }} + instanceName: {{ database_facts[db_name].dbNodeLevelDetails | json_query('*.instanceName') | join(',') }} + version: {{ database_facts[db_name].dbNodeLevelDetails | json_query('*.version') | unique() | join(',') }} + homePath: {{ database_facts[db_name].dbNodeLevelDetails | json_query('*.homePath') | unique() | join(',') }} + status: {{ database_facts[db_name].dbNodeLevelDetails | json_query('*.status') | unique() | join(',') }} + PDBs: + pdb_name: {{ database_facts[db_name].pdbs | json_query('*.pdb_name') | join(',') }} + ================================================== + when: + - ansible_hostname in grid_config.master_node + - _dbaascli_database_getDetails is defined + - _dbaascli_database_getDetails.stdout | length > 0 + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database_backup/lvm/getDetails.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database_backup/lvm/getDetails.yml new file mode 100644 index 0000000..5180616 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database_backup/lvm/getDetails.yml @@ -0,0 +1,163 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: LVM + become: true + become_user: oracle + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + _oracle_env: + ORACLE_HOME: "{{ (_oratab_file.content | b64decode | regex_search(db_name+'(.+):') | split(':'))[1] }}" + PATH: "$PATH:{{ (_oratab_file.content | b64decode | regex_search(db_name+'(.+):') | split(':'))[1]}}/bin" + LD_LIBRARY_PATH: "{{ (_oratab_file.content | b64decode | regex_search(db_name+'(.+):') | split(':'))[1] }}/lib" + ORACLE_SID: "{{ _oratab_file.content | b64decode | regex_search(db_name+':') | replace(':','') }}" + block: + + - name: Find /etc/oratab + stat: + path: /etc/oratab + register: _oratab_file_found + + - name: Reading /etc/oratab + slurp: + src: /etc/oratab + register: _oratab_file + when: _oratab_file_found.stat.exists + + - name: Getting process IDs of SMON + community.general.pids: + name: "ora_smon_{{ _oratab_file.content | b64decode | regex_search(db_name+':') | replace(':','') }}" + register: smon_pids + + # - name: Discover database parameters + # shell: | + # $ORACLE_HOME/bin/sqlplus -L -F -SILENT -MARKUP "CSV ON QUOTE OFF DELIMITER :" -nologintime "/ as sysdba" << EOF + # select name,value + # from v\$parameter + # where name in ('cluster_database_instances','instance_name','db_domain','db_unique_name','processes','pga_aggregate_target','sga_target','db_recovery_file_dest_size','wallet_root'); + # exit + # EOF + # environment: "{{ _oracle_env }}" + # when: + # - _oratab_file_found.stat.exists + # - smon_pids.pids | length > 0 + # register: _database_parameters + # failed_when: + # # ORA-01034: ORACLE not available + # - _database_parameters.rc != 0 + # - "'ORA-01034' not in _database_parameters.stdout" + + - name: Discover database parameters + sqlplus: + query: "{{ sql_parameters }}" + environment: "{{ _oracle_env }}" + when: + - _oratab_file_found.stat.exists + - smon_pids.pids | length > 0 + register: db_parameter_sqlplus_result + # failed_when: + # # ORA-01034: ORACLE not available + # - _database_parameters.rc != 0 + # - "'ORA-01034' not in _database_parameters.stdout" + + - name: Generate db_parameter_csv + set_fact: + db_parameter_sqlplus: | + {%- for item in db_parameter_sqlplus_result.results -%} + {{ item }} + {% endfor %} + when: db_parameter_sqlplus_result.results is defined + + - name: Select from v$database + shell: | + $ORACLE_HOME/bin/sqlplus -L -F -SILENT -MARKUP "CSV ON QUOTE OFF" -nologintime "/ as sysdba" << EOF + select open_mode,flashback_on,database_role,DATAGUARD_BROKER,GUARD_STATUS,FORCE_LOGGING from v\$database; + exit + EOF + environment: "{{ _oracle_env }}" + when: + - _oratab_file_found.stat.exists + - smon_pids.pids | length > 0 + register: _v_database_ouput + failed_when: + # ORA-01034: ORACLE not available + - _v_database_ouput.rc != 0 + - "'ORA-01034' not in _v_database_ouput.stdout" + + - name: Get oraversion full version + shell: | + $ORACLE_HOME/bin/oraversion -compositeVersion + when: _oratab_file_found.stat.exists + register: _oraversion + + - name: Write facts to database_facts + ansible.builtin.set_fact: + cacheable: false + database_facts: "{{ database_facts | default({}) | combine(_db_facts | items2dict) }}" + when: smon_pids.pids | length > 0 + vars: + _db_facts: + - key: "{{ db_name }}" + value: + db_name: "{{ (_oratab_file.content | b64decode | regex_search(db_name+'(.+):') | split(':'))[0] }}" + homePath: "{{ (_oratab_file.content | b64decode | regex_search(db_name+'(.+):') | split(':'))[1] }}" + dbUniqueName: "{{ db_parameter_sqlplus | regex_findall('db_unique_name,(.*)') | first }}" + db_role: "{{ _v_database_ouput.stdout[1:] | community.general.from_csv | first | community.general.json_query('DATABASE_ROLE') | default('') | replace(' ','_') }}" + dbDomain: "{{ db_parameter_sqlplus | regex_findall('db_domain,(.*)') | first }}" + dbType: "{% if (db_parameter_sqlplus | regex_findall('cluster_database_instances,(.*)') | first | int) == 1 %}SI{% else %}NA{% endif %}" + patchVersion: "{{ _oraversion.stdout }}" + openMode: "{{ _v_database_ouput.stdout[1:] | community.general.from_csv | first | community.general.json_query('OPEN_MODE') | default('') | replace(' ','_') }}" + flashbackMode: "{{ _v_database_ouput.stdout[1:] | community.general.from_csv | first | community.general.json_query('FLASHBACK_ON') | default('NO') }}" + forceLogging: "{{ _v_database_ouput.stdout[1:] | community.general.from_csv | first | community.general.json_query('FORCE_LOGGING') | default('NO') }}" + dgEnabled: "{{ _v_database_ouput.stdout[1:] | community.general.from_csv | first | community.general.json_query('DATAGUARD_BROKER') | default('DISABLED') }}" + master_node: "{{ ansible_hostname }}" + tdeDetails: + walletRootEnabled: "{% if (db_parameter_sqlplus | regex_findall('wallet_root,(.*)') | first) | length > 0 %}TRUE{% else %}FALSE{% endif %}" + walletLocation: "{{ db_parameter_sqlplus | regex_findall('wallet_root,(.*)') | first }}" + dbNodeLevelDetails: + homePath: "{{ (_oratab_file.content | b64decode | regex_search(db_name+'(.+):') | split(':'))[1] }}" + patchVersion: "{{ _oraversion.stdout }}" + instanceName: "{{ db_parameter_sqlplus | regex_findall('instance_name,(.*)') | first }}" + openMode: "{{ _v_database_ouput.stdout[1:] | community.general.from_csv | first | community.general.json_query('OPEN_MODE') | replace(' ','_') }}" + register: _database_facts + + - debug: + msg: "{{ output | regex_findall('([^\n,\r]+)') }}" + vars: + output: | + ================================================== + DBaaS Oracle Database Facts + ----------------- + dbUniqueName: {{ database_facts[db_name].dbUniqueName }} + db_role: {{ database_facts[db_name].db_role }} + dbType: {{ database_facts[db_name].dbType }} + homePath: {{ database_facts[db_name].homePath }} + flashbackMode: {{ database_facts[db_name].flashbackMode }} + forceLogging: {{ database_facts[db_name].forceLogging }} + openMode: {{ database_facts[db_name].openMode }} + dgEnabled: {{ database_facts[db_name].dgEnabled }} + master_node: {{ database_facts[db_name].master_node }} + tdeDetails: + walletRootEnabled: {{ database_facts[db_name].tdeDetails.walletRootEnabled }} + walletLocation: {{ database_facts[db_name].tdeDetails.walletLocation }} + dbNodeLevelDetails: + instanceName: {{ database_facts[db_name].dbNodeLevelDetails.instanceName }} + patchVersion: {{ database_facts[db_name].dbNodeLevelDetails.patchVersion }} + homePath: {{ database_facts[db_name].dbNodeLevelDetails.homePath }} + status: {{ database_facts[db_name].dbNodeLevelDetails.openMode }} + ================================================== + when: + - database_facts is defined + tags: [print_action] + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database_backup/main.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database_backup/main.yml new file mode 100644 index 0000000..f44324a --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/database_backup/main.yml @@ -0,0 +1,51 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaasCA - Gather database facts + ansible.builtin.include_tasks: dbaasca/getDetails.yml + when: + - oracle_facts.system.crs_on | default(false) + - not oracle_facts.system.dbaascli + +- name: DBaasCLI - Gather database facts + ansible.builtin.include_tasks: dbaascli/getDetails.yml + when: + - oracle_facts.system.dbaascli + +- name: LVM - Gather database facts + ansible.builtin.include_tasks: lvm/getDetails.yml + when: + - not oracle_facts.system.crs_on | default(false) + - not oracle_facts.system.dbaascli + +- name: Database Target Block + when: database_config.db_role is not defined + block: + + - name: Set remaining hosts as not missing + ansible.builtin.set_fact: + dbtarget_success: true + + - name: Save job_report facts under Ansible controller + delegate_to: localhost + delegate_facts: true + set_fact: + dbtarget_list: '{{ hostvars | dict2items | json_query(dbtarget_query) }}' + vars: + dbtarget_query: "[?value.dbtarget_success==`true`].key" + + - name: Set target fact + ansible.builtin.set_fact: + targetHome: true + hostname_target: "{{ hostvars['localhost']['dbtarget_list'] | sort | first }}" + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/grid.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/grid.yml new file mode 100644 index 0000000..04377b7 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/grid.yml @@ -0,0 +1,97 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Gather Oracle Grid Facts as grid user + become: true + become_user: "{{ grid_user }}" + environment: + ORACLE_HOME: "{{ oracle_facts.system.grid_home }}" + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + when: oracle_facts.system.crs_on + block: + + - name: Get grid olsnodes + shell: "{{ oracle_facts.system.grid_home }}/bin/olsnodes -s |grep Active | awk '{print $1}'" + register: _grid_olsnodes + + - name: Get orabase + shell: "{{ oracle_facts.system.grid_home }}/bin/orabase" + when: oracle_facts.grid.orabase is not defined + register: _orabase + + - name: Get GI full version + shell: "{{ oracle_facts.system.grid_home }}/bin/oraversion -compositeVersion" + register: _database_version + + - name: Get CRS upgrade state + shell: "{{ oracle_facts.system.grid_home }}/bin/crsctl query crs activeversion -f" + register: _upgrade_state + + - name: Get scan configuration + shell: "{{ oracle_facts.system.grid_home }}/bin/srvctl config scan" + register: _srvctl_config_scan + + - name: Set grid facts + ansible.builtin.set_fact: + cacheable: false + oracle_facts: "{{ oracle_facts | default({}) | combine(_grid | items2dict) }}" + when: oracle_facts.grid is not defined + vars: + _grid: + - key: grid + value: + oracle_base: "{{ oracle_facts.grid.orabase | default(_orabase.stdout) }}" + state: "{{ (_upgrade_state.stdout | regex_findall('The cluster upgrade state is (.+). The cluster active patch level is') | first)[1:-1] }}" + cluster_nodes: "{{ _grid_olsnodes.stdout_lines | join(',') }}" + master_node: "{{ _grid_olsnodes.stdout_lines | intersect(ansible_play_hosts | map('extract', hostvars, 'ansible_hostname') ) | sort | first }}" + oracle_home: "{{ oracle_facts.system.grid_home }}" + patchVersion: "{{ _database_version.stdout }}" + activeVersion: "{{ (_upgrade_state.stdout | regex_findall('Oracle Clusterware active version on the cluster is (.+). The cluster upgrade state is') | first)[1:-1] }}" + scan_name: "{{ _srvctl_config_scan.stdout | regex_search('SCAN name: (.+),' , '\\1') | first }}" + scan_ips: "{{ _srvctl_config_scan.stdout | regex_findall('IPv4 VIP: (.+)') | join(',') }}" + + - debug: + msg: "{{ output | regex_findall('([^\n,]+)') }}" + vars: + output: | + ================================================== + Oracle oracle_facts.grid + ----------------- + "{{ oracle_facts | community.general.json_query('grid') }}" + ================================================== + when: oracle_facts is defined + tags: [print_action] + ignore_errors: true + + rescue: + + # default is => Fail execution of Playbook + - name: Fail execution of system + ansible.builtin.fail: + msg: >- + Set oracle_fact_system_ignore_failed=true in inventory/group_vars/dbservers to disable this fail task. + when: + - not oracle_fact_system_ignore_failed | default(false) + + - name: Write empty facts to system(rescue from failure above) + ansible.builtin.set_fact: + cacheable: false + oracle_facts: "{{ oracle_facts | default({}) | combine(_system | items2dict) }}" + vars: + _system: + - key: system + value: + state: failed + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/grid/dbaasca/getDetails.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/grid/dbaasca/getDetails.yml new file mode 100644 index 0000000..be54673 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/grid/dbaasca/getDetails.yml @@ -0,0 +1,172 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Get grid user + ansible.builtin.stat: + path: "{{ _olr_file_content.content | b64decode | regex_findall('crs_home=(.+)') | first }}/bin/oracle" + when: oracle_facts.grid.user is not defined + register: _grid_home_user + +- name: Gather Oracle Grid Facts as grid user + become: true + become_user: "{{ oracle_facts.grid.user | default(_grid_home_user.stat.pw_name) }}" + environment: + ORACLE_HOME: "{{ _olr_file_content.content | b64decode | regex_findall('crs_home=(.+)') | first }}" + become_flags: "--login" + vars: + ansible_shell_allow_world_readable_temp: true + when: oracle_facts.system.crs_on + block: + + - name: Get grid olsnodes + shell: "$ORACLE_HOME/bin/olsnodes -s |grep Active | awk '{print $1}'" + register: _grid_olsnodes + + - name: Get orabase + shell: "$ORACLE_HOME/bin/orabase" + when: oracle_facts.grid.orabase is not defined + register: _orabase + + # - name: Get CRS scan name + # shell: "$ORACLE_HOME/bin/srvctl config scan | grep 'SCAN name:'" + # register: _srvctl_scan_name + + # - name: Get CRS scan port + # shell: "$ORACLE_HOME/bin/lsnrctl status |grep '(PROTOCOL=tcp)'" + # when: oracle_facts.grid.scanListenerTCPPorts is not defined + # register: _srvctl_scan_port + + # - name: Get CRS scan IPs + # command: "dig +short {{ oracle_facts.system.scan_name }}" + # register: _scan_ips + + - name: Get GI full version + shell: "$ORACLE_HOME/bin/oraversion -compositeVersion" + register: _database_version + + - name: Get CRS upgrade state + shell: "$ORACLE_HOME/bin/crsctl query crs activeversion -f" + register: _upgrade_state + + - name: Set grid facts + ansible.builtin.set_fact: + cacheable: false + oracle_facts: "{{ oracle_facts | default({}) | combine(_grid | items2dict) }}" + when: oracle_facts.grid is not defined + vars: + _grid: + - key: grid + value: + user: "{{ oracle_facts.grid.user | default(_grid_home_user.stat.pw_name) }}" + # scan_name: "{{ _srvctl_scan_name.stdout | regex_findall('SCAN name: (.+),') | first }}" + scanListenerTCPPorts: "{{ oracle_facts.grid.scanListenerTCPPorts | default(_srvctl_scan_port.stdout | regex_findall('PORT=(.+)') | first | split(')') | first) }}" + orabase: "{{ oracle_facts.grid.orabase | default(_orabase.stdout) }}" + # scan_name: "{{ oracle_facts.system.scan_name }}" + # scan_ips: "{{ oracle_facts.system.scan_ips }}" + + - name: Update grid facts + ansible.utils.update_fact: + updates: + - path: oracle_facts.grid.state + value: "{{ (_upgrade_state.stdout | regex_findall('The cluster upgrade state is (.+). The cluster active patch level is') | first)[1:-1] }}" + - path: oracle_facts.grid.cluster_nodes + value: "{{ _grid_olsnodes.stdout_lines | join(',') }}" + - path: oracle_facts.grid.master_node + value: "{{ _grid_olsnodes.stdout_lines | intersect(ansible_play_hosts | map('extract', hostvars, 'ansible_hostname') ) | sort | first }}" + - path: oracle_facts.grid.homePath + value: "{{ _olr_file_content.content | b64decode | regex_findall('crs_home=(.+)') | first }}" + - path: oracle_facts.grid.patchVersion + value: "{{ _database_version.stdout }}" + - path: oracle_facts.grid.activeVersion + value: "{{ (_upgrade_state.stdout | regex_findall('Oracle Clusterware active version on the cluster is (.+). The cluster upgrade state is') | first)[1:-1] }}" + register: _oracle_facts_updated + + - name: Update oracle_facts.grid + ansible.builtin.set_fact: + cacheable: false + oracle_facts: "{{ oracle_facts | default({}) | combine(_grid | items2dict) }}" + vars: + _grid: + - key: grid + value: "{{ _oracle_facts_updated.oracle_facts.grid }}" + + # oracle_facts: "{{ oracle_facts | default({}) | combine(_grid | items2dict) }}" + # # when: _grid_home_user.stat.pw_name is defined + # vars: + # _grid: + # - key: grid + # value: + # state: "{{ (_upgrade_state.stdout | regex_findall('The cluster upgrade state is (.+). The cluster active patch level is') | first)[1:-1] }}" + # # user: "{{ oracle_facts.grid.user | default(_grid_home_user.stat.pw_name) }}" + # cluster_nodes: "{{ _grid_olsnodes.stdout_lines | join(',') }}" + # master_node: "{{ _grid_olsnodes.stdout_lines | sort | first }}" + # # scan_name: "{{ _srvctl_scan_name.stdout | regex_findall('SCAN name: (.+),') | first }}" + # # scanListenerTCPPorts: "{{ oracle_facts.grid.scanListenerTCPPorts | default(_srvctl_scan_port.stdout | regex_findall('PORT=(.+)') | first | split(')') | first) }}" + # # orabase: "{{ oracle_facts.grid.orabase | default(_orabase.stdout) }}" + # homePath: "{{ _olr_file_content.content | b64decode | regex_findall('crs_home=(.+)') | first }}" + # patchVersion: "{{ _database_version.stdout }}" + # activeVersion: "{{ (_upgrade_state.stdout | regex_findall('Oracle Clusterware active version on the cluster is (.+). The cluster upgrade state is') | first)[1:-1] }}" + + # - name: Record grid facts + # delegate_to: localhost + # become: false + # ansible.builtin.lineinfile: + # path: "{{ playbook_dir }}/host_vars/{{ inventory_hostname }}" + # regexp: "^{{ item.parameter }}" + # line: "{{ item.parameter }}: {{ item.value }}" + # loop: + # - { parameter: " grid" , value: "" } + # - { parameter: " user" , value: "{{ oracle_facts.grid.user }}" } + # - { parameter: " scanListenerTCPPorts" , value: "{{ oracle_facts.grid.scanListenerTCPPorts }}" } + # - { parameter: " orabase" , value: "{{ oracle_facts.grid.orabase }}" } + + - debug: + msg: "{{ output | split('\n') }}" + vars: + output: | + ================================================== + DBaaS Oracle Gird Facts + ----------------- + activeVersion: {{ oracle_facts.grid | json_query('activeVersion') }} + state: {{ oracle_facts.grid | json_query('state') }} + scan_name: {{ oracle_facts.system.scan_name }} + scan_ips: {{ oracle_facts.system.scan_ips }} + giNodeLevelDetails: + nodeName: {{ oracle_facts.grid | json_query('cluster_nodes') }} + homePath: {{ oracle_facts.grid | json_query('homePath') }} + version: {{ oracle_facts.grid | json_query('patchVersion') }} + ================================================== + when: + - ansible_hostname in grid_config.master_node + - oracle_facts is defined + + rescue: + + # default is => Fail execution of Playbook + - name: Fail execution of system + ansible.builtin.fail: + msg: >- + Set oracle_fact_system_ignore_failed=true in inventory/group_vars/dbservers to disable this fail task. + when: + - not oracle_fact_system_ignore_failed | default(false) + + - name: Write empty facts to system(rescue from failure above) + ansible.builtin.set_fact: + cacheable: false + oracle_facts: "{{ oracle_facts | default({}) | combine(_system | items2dict) }}" + vars: + _system: + - key: system + value: + state: failed + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/grid/dbaascli/getDetails.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/grid/dbaascli/getDetails.yml new file mode 100644 index 0000000..3d779b0 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/grid/dbaascli/getDetails.yml @@ -0,0 +1,54 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaasCLI grid getDetails + become: true + shell: "dbaascli grid getDetails --showOutputDelimiter | sed -n '/Start of output/, /End of output/{ /Start of output/! { /End of output/! p }}'" + register: _dbaascli_grid_getDetails + +# - name: Write facts from _dbaascli_grid_getDetails +# ansible.builtin.set_fact: +# cacheable: false +# grid_facts: "{{ _dbaascli_grid_getDetails.stdout }}" +# when: _dbaascli_grid_getDetails.rc == 0 + +- name: Write facts from _dbaascli_grid_getDetails + ansible.builtin.set_fact: + cacheable: false + oracle_facts: "{{ oracle_facts | default({}) | combine(_grid | items2dict) }}" + when: _dbaascli_grid_getDetails.rc == 0 + vars: + _grid: + - key: grid + value: "{{ _dbaascli_grid_getDetails.stdout }}" + +- debug: + msg: "{{ output | split('\n') }}" + vars: + output: | + ================================================== + DBaaS Oracle Gird Facts + ----------------- + activeVersion: {{ oracle_facts.grid | json_query('activeVersion') }} + state: {{ oracle_facts.grid | json_query('state') }} + scan_name: {{ oracle_facts.system.scan_name }} + scan_ips: {{ oracle_facts.system.scan_ips }} + giNodeLevelDetails: + nodeName: {{ oracle_facts.grid | json_query('giNodeLevelDetails.*.nodeName') | join(',') }} + homePath: {{ oracle_facts.grid | json_query('giNodeLevelDetails.*.homePath') | unique() | join(',') }} + version: {{ oracle_facts.grid | json_query('giNodeLevelDetails.*.version') | unique() | join(',') }} + ================================================== + when: + - ansible_hostname in grid_config.master_node + - oracle_facts is defined + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/grid/main.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/grid/main.yml new file mode 100644 index 0000000..0bd479d --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/grid/main.yml @@ -0,0 +1,24 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: DBaasCA - Gather grid facts + ansible.builtin.include_tasks: dbaasca/getDetails.yml + when: + - oracle_facts.system.crs_on | default(false) + - not oracle_facts.system.dbaascli | default(false) + +- name: DBaasCLI - Gather grid facts + ansible.builtin.include_tasks: dbaascli/getDetails.yml + when: + - oracle_facts.system.dbaascli | default(false) + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/main.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/main.yml new file mode 100644 index 0000000..418757e --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/main.yml @@ -0,0 +1,34 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: dbserver + block: + + - name: system + ansible.builtin.include_tasks: system.yml + + - name: Gather grid facts + ansible.builtin.include_tasks: grid.yml + + # - name: Assert dbserver_grid + # ansible.builtin.include_tasks: dbservers/assert/grid.yml + + - name: Gather database facts + ansible.builtin.include_tasks: database/main.yml + with_items: "{{ db_name_list }}" + loop_control: + loop_var: db_name + when: + - oracle_facts.server.dbservers + - db_name_list is defined + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/oracle_home/main.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/oracle_home/main.yml new file mode 100644 index 0000000..05a5d3e --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/oracle_home/main.yml @@ -0,0 +1,188 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Gather facts for Oracle Homes + become: true + when: oracle_facts.system.inventory_loc | length > 0 + block: + + - name: Install lxml + pip: + name: lxml + timeout: 60 + + - name: Gather Oracle Homes from inventory.xml + community.general.xml: + path: "{{ oracle_facts.system.inventory_loc }}/ContentsXML/inventory.xml" + xpath: /INVENTORY/HOME_LIST/HOME + content: attribute + register: _inventory_xml + + - name: Write facts OracleHome_facts + ansible.builtin.set_fact: + OracleHome_facts: "{{ OracleHome_facts | default({}) | combine(_OracleHome_facts | items2dict) }}" + vars: + _OracleHome_facts: + - key: "dbHome_{{ __dbHome.IDX }}" + value: + oracleHomeName: "{{ __dbHome.NAME }}" + oracleHomePath: "{{ __dbHome.LOC }}" + CRS: "{{ __dbHome.CRS | default(false) | bool }}" + with_items: "{{ _inventory_xml.matches | map(attribute='HOME') | reject('search','REMOVED') }}" + loop_control: + loop_var: __dbHome + when: _inventory_xml.count > 0 + + - name: Write fact _dbHomeTargetExists + set_fact: + _dbHomeTargetExists: "{% if (OracleHome_facts | to_json | from_json | json_query(dbHomeTarget_query) | selectattr('homePath', 'search', oracle_home_target) | length > 0) %}{{ true|bool }}{% else %}{{ false|bool }}{% endif %}" + vars: + dbHomeTarget_query: "*.{homePath: homePath}" + when: oracle_home_target is defined + + - name: Write fact _ggHomeTargetExists + set_fact: + _ggHomeTargetExists: "{% if (OracleHome_facts | to_json | from_json | json_query(ggHomeTarget_query) | selectattr('homePath', 'search', goldengate.oracle_home_target ) | length > 0) %}{{ true|bool }}{% else %}{{ false|bool }}{% endif %}" + vars: + ggHomeTarget_query: "*.{homePath: homePath}" + when: goldengate.oracle_home_target is defined + + rescue: + + # default is => Fail execution of Playbook + - name: Fail execution of dbHome + ansible.builtin.fail: + msg: >- + Set oracle_facts_dbHome_ignore_failed=true in inventory/group_vars/all to disable this fail task. + when: + - not oracle_facts_dbHome_ignore_failed | default(false) + + - name: Write empty facts to system(rescue from failure above) + ansible.builtin.set_fact: + cacheable: false + OracleHome_facts: "{{ OracleHome_facts | default({}) | combine(_OracleHome_facts | items2dict) }}" + vars: + _OracleHome_facts: + - key: dbHome + value: + state: failed + + # - name: Find oraInst.loc file + # stat: + # path: /etc/oraInst.loc + # register: _oraInst_found + + # - name: Reading oraInst.loc file + # slurp: + # src: /etc/oraInst.loc + # register: _inventory_loc + # when: _oraInst_found.stat.exists + + # - name: Set inventory_loc fact + # set_fact: + # inventory_loc: "{{ _inventory_loc['content'] | b64decode | regex_search('inventory_loc=(.+)', '\\1') | first }}" + # when: _oraInst_found.stat.exists + + # - name: Read inventory_loc + # community.general.xml: + # path: "{{ inventory_loc }}/ContentsXML/inventory.xml" + # xpath: /INVENTORY/HOME_LIST/HOME + # content: attribute + # register: _inventory_xml + + # - name: Get database full version + # shell: | + # {{ _oracle_home }}/bin/oraversion -compositeVersion + # when: _oracle_home is defined + # register: _oraversion + + + # - debug: + # msg: "{% set output = [] %}\ + # {% for item in xmlresp.matches | map(attribute='HOME') %}\ + # {{ output.append( 'HOME_' ~ item.IDX ~ ': ' ~ item.LOC ) }}\ + # {% endfor %}\ + # {{ output }}" + + # - name: Generate location_quoted + # set_fact: + # oracle_homes_jinja: | + # {% for item in xmlresp.matches | map(attribute='HOME') %} + # {{ 'HOME_' ~ item.IDX ~ ': ' ~ item.LOC }} + # {% endfor %} + + # - name: Find installed Oracle Homes + # set_fact: + # _oracle_homes_yaml: "{{ ___LOC | zip(___NAME) | map('join', ',') }}" + # vars: + # __xml_command_results: "{{ _inventory_xml.matches | map(attribute='HOME') }}" + # ___NAME: "{{ __xml_command_results | map(attribute='NAME') }}" + # ___LOC: "{{ __xml_command_results | map(attribute='LOC') }}" + + # - name: Get BUILD_LABEL + # shell: | + # grep 'use constant CATCONST_BUILD_LABEL' {{ __oracle_home }}/rdbms/admin/catconst.pm | awk -F"'" '{print $2 ",{{ __oracle_home }}"}' + # with_items: "{{ _inventory_xml.matches | map(attribute='HOME') | map(attribute='LOC') }}" + # loop_control: + # loop_var: __oracle_home + # when: "'product' in __oracle_home" + # register: _catconst_build_label + + # - name: Write Oracle Homes facts + # ansible.builtin.set_fact: + # cacheable: false + # oracle_home_facts: "{{ oracle_home_facts | default({}) | combine(_oracle_homes | items2dict) }}" + # vars: + # _oracle_homes: + # - key: "DBHOME_IDX{{ __inventory_xml_matches.HOME.IDX }}" + # value: + # # build_label: "{{ _catconst_build_label.stdout | regex_findall('(.+){{ __inventory_xml_matches.HOME.LOC }}') }}" + # oracle_home_path: "{{ __inventory_xml_matches.HOME.LOC }}" + # oracle_home_name: "{{ __inventory_xml_matches.HOME.NAME }}" + # with_items: + # - "{{ _inventory_xml.matches }}" + # loop_control: + # loop_var: __inventory_xml_matches + # when: "'product' in __inventory_xml_matches.HOME.LOC" + + # - debug: + # msg: "{{ item.stdout }}" + # with_items: "{{ _catconst_build_label.results }}" + # when: item.changed | bool + + # - debug: + # msg: "{{ __inventory_xml_matches.HOME.LOC }}" + # with_items: + # - "{{ _inventory_xml.matches }}" + # loop_control: + # loop_var: __inventory_xml_matches + # when: "'product' in __inventory_xml_matches.HOME.LOC" + + # - name: Write Oracle Homes facts + # ansible.builtin.set_fact: + # cacheable: false + # oracle_home_facts: "{{ oracle_home_facts | default({}) | combine(_oracle_homes | items2dict) }}" + # vars: + # _oracle_homes: + # - key: "{{ __oracle_home_build_label.stdout }}" + # value: + # build_label: "{{ __oracle_home_build_label.stdout }}" + # oracle_home_path: "{{ __oracle_home_build_label.__oracle_home }}" + # oracle_home_name: "{{ _inventory_xml.matches | map(attribute='HOME') | map(attribute='NAME') }}" + # with_items: "{{ _catconst_build_label.results }}" + # loop_control: + # loop_var: __oracle_home_build_label + # when: + # - _catconst_build_label is defined + # - __oracle_home_build_label.changed | bool + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/system.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/system.yml new file mode 100644 index 0000000..ba34c0d --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/system.yml @@ -0,0 +1,98 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Set fact run_system_facts + set_fact: + run_system_facts: true|bool + when: + - ((oracle_facts.system.timestamp is not defined) or + ( (ansible_date_time.epoch|int - oracle_facts.system.timestamp|int) > force_facts_timestamp|int ) or + ('force_facts' in ansible_run_tags) or + (force_facts | default(false))) + +- name: oracle_facts dbservers system + when: + - oracle_facts.server.dbservers + - run_system_facts | default(false) + block: + + - name: Find oracle files + stat: + path: "{{ item }}" + with_items: "{{ dbservers_files | map(attribute='path') }}" + register: oracle_files_stat + + - name: Reading oracle files + slurp: + src: "{{ item.stat.path }}" + with_items: "{{ oracle_files_stat.results }}" + when: + - item.stat.exists | default(false) + - item.stat.readable + register: oracle_files_stat_slurp + + - name: Generate oracle_files_stat_slurp + set_fact: + oracle_files_fact: | + {%- for item in oracle_files_stat_slurp.results -%} + {% if (item.item.stat.exists and not item.item.stat.executable) | default(false) %}{{ item.content | b64decode }}{% endif %} + {% endfor %} + when: oracle_files_stat_slurp.results is defined + + - name: Gather facts on listening ports + become: true + community.general.listen_ports_facts: + + - name: Set system facts + ansible.builtin.set_fact: + cacheable: false + oracle_facts: "{{ oracle_facts | default({}) | combine(_system | items2dict) }}" + vars: + _system: + - key: system + value: + inventory_loc: "{{ oracle_files_fact | regex_findall('inventory_loc=(.*)') | first }}" + inst_group: "{{ oracle_files_fact | regex_findall('inst_group=(.*)') | first }}" + oracle_ahf_loc: "{{ oracle_files_fact | regex_search('(.+)ahf') }}" + crs_on: "{{ oracle_files_stat.results | selectattr ('item', 'equalto', '/etc/oracle/olr.loc') | map(attribute='stat') | map(attribute='exists') | first }}" + grid_home: "{{ (oracle_files_stat.results | selectattr ('item', 'equalto', '/etc/oracle/olr.loc') | map(attribute='stat') | map(attribute='exists') | first) | ternary(( oracle_files_fact | regex_findall('crs_home=(.*)') | first), false | bool) }}" + dbaascli_on: "{{ oracle_files_stat.results | selectattr ('item', 'equalto', '/usr/bin/dbaascli') | map(attribute='stat') | map(attribute='exists') | first }}" + tnslsnr_port: "{{ ansible_facts.tcp_listen | selectattr ('name', 'equalto', 'tnslsnr' ) | selectattr ('address', 'equalto', ansible_default_ipv4['address'] ) | map(attribute='port') | min | default(ansible_facts.tcp_listen | selectattr ('name', 'equalto', 'tnslsnr' ) | selectattr ('address', 'equalto', '0.0.0.0' ) | map(attribute='port') | min) }}" + ons_port: "{{ ansible_facts.tcp_listen | selectattr ('name', 'equalto', 'ons' ) | map(attribute='port') | join(',') | default(false|bool) }}" + timestamp: "{{ ansible_date_time.epoch | int }}" + + - name: Create inventory_hostname directory + delegate_to: localhost + file: + path: "{{ inventory_dir }}/host_vars/{{ inventory_hostname }}" + state: directory + + - name: Record system facts + delegate_to: localhost + ansible.builtin.copy: + content: "{ oracle_facts: {system: {{ oracle_facts.system }} } }" + dest: "{{ inventory_dir }}/host_vars/{{ inventory_hostname }}/system.yml" + + - debug: + msg: "{{ output | regex_findall('([^\n,]+)') }}" + vars: + output: | + ================================================== + Oracle oracle_facts.system + ----------------- + "{{ oracle_facts | community.general.json_query('system') }}" + ================================================== + when: oracle_facts is defined + tags: [print_action] + ignore_errors: true + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/system/backup.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/system/backup.yml new file mode 100644 index 0000000..40e6251 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/dbservers/system/backup.yml @@ -0,0 +1,215 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Find dbaascli + stat: + path: /usr/bin/dbaascli + register: _dbaascli_found + +- name: Gather system facts when dbaascli is present + when: + - oracle_facts.server.dbservers + - ((oracle_facts.system.dbaascli|default(false)) or + (_dbaascli_found.stat.exists|default(false)) ) + block: + + - name: Find /etc/oracle.ahf.loc + stat: + path: /etc/oracle.ahf.loc + register: _ahf_file_found + + - name: Reading /etc/oracle.ahf.loc + slurp: + src: /etc/oracle.ahf.loc + register: _ahf_file_content + when: + - _ahf_file_found.stat.exists + + - name: Get scan configuration + become: true + shell: "$(grep ^crs_home /etc/oracle/olr.loc | cut -d= -f2)/bin/srvctl config scan" + register: _scan_config + + - name: Set oracle_facts + ansible.builtin.set_fact: + cacheable: false + oracle_facts: "{{ oracle_facts | default({}) | combine(_system | items2dict) }}" + vars: + _system: + - key: system + value: + dbaascli: "{% if _dbaascli_found.stat.exists %}{{true|bool}}{% else %}{{false|bool}}{% endif %}" + scan_name: "{{ _scan_config.stdout | regex_search('SCAN name: (.+),' , '\\1') | first }}" + scan_ips: "{{ _scan_config.stdout | regex_findall('IPv4 VIP: (.+)') | join(',') }}" + oracle_ahf_loc: "{% if _ahf_file_found.stat.exists %}{{ _ahf_file_content.content | b64decode | regex_search('(.+)ahf') }}{% else %}{{ false|bool }}{% endif %}" + + - name: Set oracle_facts + ansible.builtin.set_fact: + ansible_python_interpreter: "{% if _ahf_file_found.stat.exists %}{{ _ahf_file_content.content | b64decode | regex_search('(.+)ahf') }}/common/venv/bin/python3{% else %}{{ false|bool }}{% endif %}" + + # - name: Record system facts + # delegate_to: localhost + # ansible.builtin.lineinfile: + # path: "{{ playbook_dir }}/host_vars/{{ inventory_hostname }}" + # regexp: "^{{ item.parameter }}" + # line: "{{ item.parameter }}: {{ item.value }}" + # create: true + # loop: + # - { parameter: "oracle_facts" , value: "" } + # - { parameter: " system" , value: "" } + # - { parameter: " oracle_ahf_loc" , value: "{{ oracle_facts.system.oracle_ahf_loc }}" } + # - { parameter: " dbaascli" , value: "{{ oracle_facts.system.dbaascli }}" } + # - { parameter: " scan_name" , value: "{{ oracle_facts.system.scan_name }}" } + # - { parameter: " scan_ips" , value: "{{ oracle_facts.system.scan_ips }}" } + # - { parameter: "ansible_python_interpreter" , value: "{% if _ahf_file_found.stat.exists %}{{ _ahf_file_content.content | b64decode | regex_search('(.+)ahf') }}/common/venv/bin/python3{% else %}{{ false|bool }}{% endif %}" } + + rescue: + + # default is => Fail execution of Playbook + - name: Fail execution of system + ansible.builtin.fail: + msg: >- + Set oracle_facts_system_ignore_failed=true in inventory/group_vars/dbservers to disable this fail task. + when: + - not oracle_facts_system_ignore_failed | default(false) + + - name: Set empty facts to system(rescue from failure above) + ansible.builtin.set_fact: + cacheable: false + oracle_facts: "{{ oracle_facts | default({}) | combine(_system | items2dict) }}" + vars: + _system: + - key: system + value: + state: failed + +- name: Gather system facts when dbaascli is not present + when: + - ((oracle_facts.system.dbaascli is not defined) or + (not _dbaascli_found.stat.exists) ) + block: + + - name: Gather facts on listening ports + become: true + community.general.listen_ports_facts: + + - name: Find /etc/oracle/olr.loc + stat: + path: /etc/oracle/olr.loc + register: _olr_file_found + + - name: Find /etc/oraInst.loc + stat: + path: /etc/oraInst.loc + register: _oraInst_file_found + + - name: Find /etc/oracle.ahf.loc + stat: + path: /etc/oracle.ahf.loc + register: _ahf_file_found + + - name: Reading /etc/oracle/olr.loc + slurp: + src: /etc/oracle/olr.loc + register: _olr_file_content + when: _olr_file_found.stat.exists + + - name: Reading /etc/oraInst.loc + slurp: + src: /etc/oraInst.loc + register: _oraInst_file_content + when: + - _oraInst_file_found.stat.exists + + - name: Reading /etc/oracle.ahf.loc + slurp: + src: /etc/oracle.ahf.loc + register: _ahf_file_content + when: + - _ahf_file_found.stat.exists + + # - name: CRS start + # become: true + # shell: | + # {{ _olr_file_content.content | b64decode | regex_findall('crs_home=(.+)') | first }}/bin/crsctl start crs -wait + # register: crsctl_start_crs + # failed_when: + # - crsctl_start_crs.rc != 0 + # - "'CRS-4640' not in crsctl_start_crs.stdout" + # # CRS-4640: Oracle High Availability Services is already active + + - name: Get scan configuration + become: true + shell: "{{ _olr_file_content.content | b64decode | regex_findall('crs_home=(.+)') | first }}/bin/srvctl config scan" + register: _srvctl_config_scan + when: + - _olr_file_found.stat.exists + + - name: Set facts from _etc_file_fact + ansible.builtin.set_fact: + cacheable: false + oracle_facts: "{{ oracle_facts | default({}) | combine(_system | items2dict) }}" + changed_when: _oraInst_file_found.stat.exists + register: _set_oracle_facts + vars: + _system: + - key: system + value: + inventory_loc: "{% if _oraInst_file_found.stat.exists %}{{ _oraInst_file_content.content | b64decode | regex_findall('inventory_loc=(.+)') | first }}{% else %}{{ false | bool }}{% endif %}" + inst_group: "{% if _oraInst_file_found.stat.exists %}{{ _oraInst_file_content.content | b64decode | regex_findall('inst_group=(.+)') | first }}{% else %}{{ false | bool }}{% endif %}" + oracle_ahf_loc: "{% if _ahf_file_found.stat.exists %}{{ _ahf_file_content.content | b64decode | regex_search('(.+)ahf') }}{% else %}{{ false | bool }}{% endif %}" + dbaascli: "{% if _dbaascli_found.stat.exists %}{{true|bool}}{% else %}{{ false | bool }}{% endif %}" + scan_name: "{% if _olr_file_found.stat.exists %}{{ _srvctl_config_scan.stdout | regex_search('SCAN name: (.+),' , '\\1') | first | split(',') | first }}{% else %}{{ false | bool }}{% endif %}" + scan_ips: "{% if _olr_file_found.stat.exists %}{{ _srvctl_config_scan.stdout | regex_findall('IPv4 VIP: (.+)') | join(',') }}{% else %}{{ false | bool }}{% endif %}" + crs: "{% if _olr_file_found.stat.exists %}{{ true|bool }}{% else %}{{ false | bool }}{% endif %}" + tnslsnr_port: "{{ ansible_facts.tcp_listen | selectattr ('name', 'equalto', 'tnslsnr' ) | selectattr ('address', 'equalto', ansible_default_ipv4['address'] ) | map(attribute='port') | min | default(ansible_facts.tcp_listen | selectattr ('name', 'equalto', 'tnslsnr' ) | selectattr ('address', 'equalto', '0.0.0.0' ) | map(attribute='port') | min) }}" + + # - name: Record system facts + # delegate_to: localhost + # when: _set_oracle_facts is success + # ansible.builtin.lineinfile: + # path: "{{ playbook_dir }}/host_vars/{{ inventory_hostname }}" + # regexp: "^{{ item.parameter }}" + # line: "{{ item.parameter }}: {{ item.value }}" + # create: true + # loop: + # - { parameter: "oracle_facts" , value: "" } + # - { parameter: " system" , value: "" } + # - { parameter: " inventory_loc" , value: "{{ oracle_facts.system.inventory_loc }}" } + # - { parameter: " inst_group" , value: "{{ oracle_facts.system.inst_group }}" } + # - { parameter: " oracle_ahf_loc" , value: "{{ oracle_facts.system.oracle_ahf_loc }}" } + # - { parameter: " dbaascli" , value: "{{ oracle_facts.system.dbaascli }}" } + # - { parameter: " scan_name" , value: "{{ oracle_facts.system.scan_name }}" } + # - { parameter: " crs" , value: "{{ oracle_facts.system.crs_on }}" } + # - { parameter: "ansible_python_interpreter" , value: "{{ oracle_facts.system.oracle_ahf_loc }}/common/venv/bin/python3" } + + rescue: + + # default is => Fail execution of Playbook + - name: Fail execution of system + ansible.builtin.fail: + msg: >- + Set oracle_facts_system_ignore_failed=true in inventory/group_vars/dbservers to disable this fail task. + when: + - not oracle_facts_system_ignore_failed | default(false) + + - name: Write empty facts to system(rescue from failure above) + ansible.builtin.set_fact: + cacheable: false + oracle_facts: "{{ oracle_facts | default({}) | combine(_system | items2dict) }}" + vars: + _system: + - key: system + value: + state: failed + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/main.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/main.yml new file mode 100644 index 0000000..a3ce000 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/main.yml @@ -0,0 +1,145 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + + +- name: Gather Oracle facts + when: database_list is defined + tags: + - always + - oracle_facts + block: + + - name: Execute control_node prerequisites + ansible.builtin.include_tasks: control_node/prerequisites/main.yml + + - name: Validate Ansible/Jinja2 version, Ansible collections, role variables, and supported distributions + ansible.builtin.include_tasks: control_node/assert/main.yml + + - name: Gather managed_hosts facts + ansible.builtin.include_tasks: managed_nodes/prerequisites/main.yml + + # - name: Gather oracle_home facts + # ansible.builtin.include_tasks: managed_nodes/oracle_home.yml + + - name: Assert managed_hosts + ansible.builtin.include_tasks: managed_nodes/assert/main.yml + + - name: dbservers + import_tasks: dbservers/main.yml + + # - name: Gather sbservers facts + # ansible.builtin.include_tasks: sbservers/main.yml + # when: "'sbservers' in group_names" + + # - pause: + # seconds: 1 + # prompt: | + # ================================================== + # {% if oracle_facts is defined %} + # {{ oracle_facts.grid | to_nice_yaml }} + # {% endif %} + # ----------------- + # {% if database_facts is defined %} + # {{ database_facts | to_nice_yaml }} + # ================================================== + # {% endif %} + # tags: [print_action] + + # - name: DBaasCLI - Gather database facts + # ansible.builtin.include_tasks: dbaascli_database_getDetails.yml + # with_items: "{{ db_name_list }}" + # loop_control: + # loop_var: db_name + # when: + # - oracle_facts.server.dbservers + # - db_name_list is defined + # - oracle_facts.system.dbaascli + + # - name: DBaasCA - Gather database facts + # ansible.builtin.include_tasks: dbaasca_database_getDetails.yml + # with_items: "{{ db_name_list }}" + # loop_control: + # loop_var: db_name + # when: + # - db_name is defined + # - oracle_facts.server.dbservers + # - db_name_list is defined + # - not oracle_facts.system.dbaascli + + # - name: DBaasCLI - Gather database facts + # ansible.builtin.include_tasks: dbaascli_database_getDetails.yml + # with_items: "{{ db_name_list }}" + # loop_control: + # loop_var: db_name + # when: + # - db_name is defined + # - oracle_facts.server.dbservers + # - db_name_list is defined + # - oracle_facts.system.dbaascli + + # - name: Gather system facts + # ansible.builtin.include_tasks: system.yml + + # - name: Assert system + # ansible.builtin.import_role: + # name: oracle_meta + # tasks_from: system.yml + + # - name: Gather grid facts + # ansible.builtin.include_tasks: grid.yml + + # - name: Assert grid + # ansible.builtin.import_role: + # name: oracle_meta + # tasks_from: grid.yml + + # - name: Gather oracle_home facts + # ansible.builtin.include_tasks: oracle_home.yml + + # - name: DBaasCA - Gather database facts + # ansible.builtin.include_tasks: dbaasca_database_getDetails.yml + # with_items: "{{ db_name_list }}" + # loop_control: + # loop_var: db_name + # when: + # - db_name is defined + # - oracle_facts.server.dbservers + # - db_name_list is defined + # - not oracle_facts.system.dbaascli + + # - name: DBaasCLI - Gather database facts + # ansible.builtin.include_tasks: dbaascli_database_getDetails.yml + # with_items: "{{ db_name_list }}" + # loop_control: + # loop_var: db_name + # when: + # - db_name is defined + # - oracle_facts.server.dbservers + # - db_name_list is defined + # - oracle_facts.system.dbaascli + + # - name: Gather sbservers facts + # ansible.builtin.include_tasks: sbservers.yml + # when: "'sbservers' in group_names" + + # - name: Gather gghservers facts + # ansible.builtin.include_tasks: gghservers.yml + # when: "'gghservers' in group_names" + + # - name: Assert gghservers + # ansible.builtin.import_role: + # name: oracle_meta + # tasks_from: gghub.yml + # when: "'gghservers' in group_names" + + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/managed_nodes/assert/main.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/managed_nodes/assert/main.yml new file mode 100644 index 0000000..6e86bf3 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/managed_nodes/assert/main.yml @@ -0,0 +1,75 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Assert oracle_meta_assert_hosts + when: + - oracle_meta_assert_hosts | default(true) + tags: + - always + - oracle_assert + block: + + - name: Save missing_list fact under Ansible controller + ansible.builtin.set_fact: + missing_list: "{{ hostvars | dict2items | json_query(missing_query) }}" + vars: + missing_query: "[?value.missing==`true`].key" + delegate_to: localhost + delegate_facts: true + run_once: true + + # - name: assert server + # ansible.builtin.assert: + # quiet: true + # that: + # - orafac.job_success | bool + # - not orafac.missing | bool + # with_items: + # - "{{ ansible_facts.oracle_facts.server }}" + # loop_control: + # label: "{{ orafac.server | default('') }}" + # loop_var: orafac + + - name: Assert server missing + ansible.builtin.assert: + quiet: true + that: + - hostvars['localhost']['missing_list'] | length == 0 + fail_msg: "missing_list: {{ hostvars['localhost']['missing_list'] }}" + + when: + - oracle_meta_assert_server | default(true) | bool + + - name: Verify whether you are using a supported Linux distribution + ansible.builtin.assert: + quiet: true + that: + - ansible_facts['distribution'] | lower in oracle_supported_distributions.keys() | list + - ansible_facts['distribution_major_version'] in oracle_supported_distributions[ansible_facts['distribution'] | lower]['versions'] | string + - ansible_facts['architecture'] in oracle_supported_distributions[ansible_facts['distribution'] | lower]['architectures'] + # success_msg: Your distribution, {{ oracle_supported_distributions[ansible_facts['distribution'] | lower]['name'] }} {{ ansible_facts['distribution_version'] }} ({{ ansible_facts['architecture'] }}), is supported by this Ansible playbook. + fail_msg: + - Your distribution, {{ oracle_supported_distributions[ansible_facts['distribution'] | lower]['name'] }} {{ ansible_facts['distribution_version'] }} ({{ ansible_facts['architecture'] }}), is not supported by this Ansible playbook. + - Please upgrade to Linux distribution to {{ oracle_supported_distributions | trim }} + - Check the README for more details. + + rescue: + + # default is => Fail execution of Playbook + - name: Fail execution of oracle_meta_assert_hosts + ansible.builtin.fail: + msg: >- + Set oracle_meta_assert_hosts=False in inventory/group_vars/all to disable this fail task. + when: + - oracle_meta_assert_hosts | default(true) | bool + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/managed_nodes/prerequisites/main.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/managed_nodes/prerequisites/main.yml new file mode 100644 index 0000000..e575349 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/managed_nodes/prerequisites/main.yml @@ -0,0 +1,87 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Gather Server Facts + block: + + - name: Clear gathered facts from all currently targeted hosts + ansible.builtin.meta: clear_facts + + - name: Gather server default minimum amount of facts and weed out unavailable hosts + ansible.builtin.setup: + # gather_subset: + # - "!all" + # - "mounts" + + - name: Set remaining hosts as not missing + ansible.builtin.set_fact: + cacheable: false + oracle_facts: "{{ oracle_facts | default({}) | combine(_server | items2dict) }}" + missing: false + job_success: true + vars: + _server: + - key: server + value: + job_success: True + missing: False + dbservers: "{% if 'dbservers' in group_names %}True{% else %}False{% endif %}" + sbservers: "{% if 'sbservers' in group_names %}True{% else %}False{% endif %}" + appservers: "{% if 'appservers' in group_names %}True{% else %}False{% endif %}" + webservers: "{% if 'webservers' in group_names %}True{% else %}False{% endif %}" + gsmservers: "{% if 'gsmservers' in group_names %}True{% else %}False{% endif %}" + gghserver: "{% if 'gghserver' in group_names %}True{% else %}False{% endif %}" + + - name: Set db_timezone fact + set_fact: + db_timezone: "{{ ansible_facts.date_time.tz_offset }}" + delegate_to: localhost + delegate_facts: true + when: oracle_facts.server.dbservers + + - name: Create stage_dir.managed directory + become: true + file: + path: "{{ stage_dir.managed }}.{{ item }}" + state: directory + mode: '0755' + owner: "{{ oracle_user }}" + group: "{{ oracle_group }}" + with_items: + - workdir + - tmp + - software + + rescue: + + # default is => Fail execution of Playbook + - name: Fail execution of system + ansible.builtin.fail: + msg: >- + Set oracle_fact_host_ignore_failed=true in inventory/group_vars/dbservers to disable this fail task. + when: + - not oracle_fact_host_ignore_failed | default(false) + + - name: Write empty facts to host (rescue from failure above) + ansible.builtin.set_fact: + cacheable: false + oracle_facts: "{{ oracle_facts | default({}) | combine(_server | items2dict) }}" + missing: false + job_success: true + vars: + _server: + - key: server + value: + job_success: False + missing: True + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/sbservers/main.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/sbservers/main.yml new file mode 100644 index 0000000..e015637 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tasks/sbservers/main.yml @@ -0,0 +1,78 @@ +--- +# +# Oracle Database as a Service +# +# Copyright (c) 2022 Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at +# https://oss.oracle.com/licenses/upl. +# +# Description: Playbook to gather Oracle resources on Oracle Exadata Database Service, BaseDB and on-prem. +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + +- name: Gather sbservers facts + become: true + block: + + - name: Install lxml + become: true + pip: + name: lxml + + - name: Find Swingbench home + find: + paths: "{{ ansible_base_managed }}" + file_type: file + patterns: "sbutil" + age_stamp: mtime + recurse: true + register: _swingbench_home + + - name: Find JDK Development Kit home + find: + paths: "{{ ansible_base_managed }}" + file_type: directory + patterns: "jdk-*" + age_stamp: mtime + register: _jdk_home + + - name: Write sbservers facts + ansible.builtin.set_fact: + jdk_home: "{{ (_jdk_home.files|sort(attribute='mtime', reverse=true)|first).path }}" + swingbench_home: "{{ (_swingbench_home.files|sort(attribute='mtime', reverse=true)|first).path | dirname | dirname }}" + swingbench_version: "{{ (_swingbench_home.files|sort(attribute='mtime', reverse=true)|first).path | dirname | dirname | basename }}" + when: + - _swingbench_home.matched > 0 + - _jdk_home.matched > 0 + + # - name: Find oraInst.loc file + # stat: + # path: /etc/oraInst.loc + # register: _oraInst_found + + # - name: Reading oraInst.loc file + # slurp: + # src: /etc/oraInst.loc + # register: _inventory_loc + # when: _oraInst_found.stat.exists + + # - name: Set inventory_loc fact + # set_fact: + # inventory_loc: "{{ _inventory_loc['content'] | b64decode | regex_search('inventory_loc=(.+)', '\\1') | first }}" + # when: _oraInst_found.stat.exists + + # - name: Read inventory_loc + # community.general.xml: + # path: "{{ inventory_loc }}/ContentsXML/inventory.xml" + # xpath: /INVENTORY/HOME_LIST/HOME + # content: attribute + # register: _inventory_xml + + # - name: Find installed Oracle Homes + # set_fact: + # oracle_home: "{{ ___LOC | sort(reverse=true) | first }}" + # vars: + # __xml_command_results: "{{ _inventory_xml.matches | map(attribute='HOME') }}" + # ___LOC: "{{ __xml_command_results | map(attribute='LOC') }}" + +... \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tests/inventory b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tests/inventory new file mode 100644 index 0000000..03ca42f --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tests/inventory @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +localhost + diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/tests/test.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tests/test.yml new file mode 100644 index 0000000..bba746c --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/tests/test.yml @@ -0,0 +1,6 @@ +#SPDX-License-Identifier: MIT-0 +--- +- hosts: localhost + remote_user: root + roles: + - oracle_facts diff --git a/playbooks/dbaas-ansible-collection/roles/oracle_facts/vars/main.yml b/playbooks/dbaas-ansible-collection/roles/oracle_facts/vars/main.yml new file mode 100644 index 0000000..02b1cae --- /dev/null +++ b/playbooks/dbaas-ansible-collection/roles/oracle_facts/vars/main.yml @@ -0,0 +1,5 @@ +#SPDX-License-Identifier: MIT-0 +--- +# vars file for oracle_facts + +# dbUniqueName: "{{ vars[db_name + '_dbUniqueName'] }}" \ No newline at end of file diff --git a/playbooks/dbaas-ansible-collection/test-requirements.txt b/playbooks/dbaas-ansible-collection/test-requirements.txt new file mode 100644 index 0000000..8967ce9 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/test-requirements.txt @@ -0,0 +1,4 @@ +# TO-DO: add python packages that are required for testing this collection +pytest-ansible +pytest-xdist +molecule diff --git a/playbooks/dbaas-ansible-collection/tests/.gitignore b/playbooks/dbaas-ansible-collection/tests/.gitignore new file mode 100644 index 0000000..ea1472e --- /dev/null +++ b/playbooks/dbaas-ansible-collection/tests/.gitignore @@ -0,0 +1 @@ +output/ diff --git a/playbooks/dbaas-ansible-collection/tests/integration/__init__.py b/playbooks/dbaas-ansible-collection/tests/integration/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/playbooks/dbaas-ansible-collection/tests/integration/targets/hello_world/tasks/main.yml b/playbooks/dbaas-ansible-collection/tests/integration/targets/hello_world/tasks/main.yml new file mode 100644 index 0000000..e844b6c --- /dev/null +++ b/playbooks/dbaas-ansible-collection/tests/integration/targets/hello_world/tasks/main.yml @@ -0,0 +1,9 @@ +--- +- name: Test the Hello World filter plugin + ansible.builtin.set_fact: + msg: "{{ 'ansible-creator' | oracle.dbaas.hello_world }}" + +- name: Assert that the filter worked + ansible.builtin.assert: + that: + - msg == 'Hello, ansible-creator' diff --git a/playbooks/dbaas-ansible-collection/tests/integration/test_integration.py b/playbooks/dbaas-ansible-collection/tests/integration/test_integration.py new file mode 100644 index 0000000..5c61261 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/tests/integration/test_integration.py @@ -0,0 +1,15 @@ +"""Tests for molecule scenarios.""" + +from __future__ import absolute_import, division, print_function + +from pytest_ansible.molecule import MoleculeScenario + + +def test_integration(molecule_scenario: MoleculeScenario) -> None: + """Run molecule for each scenario. + + Args: + molecule_scenario: The molecule scenario object + """ + proc = molecule_scenario.test() + assert proc.returncode == 0 diff --git a/playbooks/dbaas-ansible-collection/tests/unit/.keep b/playbooks/dbaas-ansible-collection/tests/unit/.keep new file mode 100644 index 0000000..e69de29 diff --git a/playbooks/dbaas-ansible-collection/tests/unit/__init__.py b/playbooks/dbaas-ansible-collection/tests/unit/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/playbooks/dbaas-ansible-collection/tests/unit/test_basic.py b/playbooks/dbaas-ansible-collection/tests/unit/test_basic.py new file mode 100644 index 0000000..4fe4d95 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/tests/unit/test_basic.py @@ -0,0 +1,6 @@ +"""Unit tests for oracle.dbaas.""" + + +def test_basic() -> None: + """Dummy unit test that always passes.""" + assert True diff --git a/playbooks/dbaas-ansible-collection/tools/ansible/install_ansible.sh b/playbooks/dbaas-ansible-collection/tools/ansible/install_ansible.sh new file mode 100644 index 0000000..646afb9 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/tools/ansible/install_ansible.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# +# +set -eu +set -o pipefail + +workdir=$(dirname -- "$( readlink -f -- "$0"; )";) + +install_python() +{ + if test -f /etc/oracle-release ; then + # https://yum.oracle.com/oracle-linux-python.html + sudo dnf -y module install python39 + sudo dnf -y install python39-pip + + # install libselinux-python3 for ansible + sudo dnf install -y python3-libselinux + fi +} + +setup_venv() +{ + /usr/bin/python3.9 -m venv ~/venv/ansible-oracle + + # shellcheck source=/dev/null + . ~/venv/ansible-oracle/bin/activate + pip install --upgrade pip +} + +setup_ansible() +{ + echo "Install Ansible with pip3" + echo "$workdir" + pip3 install -r "$workdir/requirements_ansible.txt" +} + +cd "$workdir" +echo "working directory: $(pwd)" + +install_python +setup_venv +setup_ansible diff --git a/playbooks/dbaas-ansible-collection/tools/dev/install_collection.sh b/playbooks/dbaas-ansible-collection/tools/dev/install_collection.sh new file mode 100644 index 0000000..cbb4e5f --- /dev/null +++ b/playbooks/dbaas-ansible-collection/tools/dev/install_collection.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# Install the ansible-oracle collection from current source +# +set -eu + +# shellcheck disable=SC2086 +WORKTDIR="$(dirname ${BASH_SOURCE[0]})/../.." +COLLECTION_OUTDIR=/tmp/ansible-oracle-collection + +cd "${WORKTDIR}" +echo "Working in $(pwd)" +test -s "${COLLECTION_OUTDIR}" || mkdir "${COLLECTION_OUTDIR}" + +COLLECTION_VERSION=$(grep "^version: " galaxy.yml | cut -d" " -f2) +COLLECTION_ARCHIVE="${COLLECTION_OUTDIR}/opitzconsulting-ansible_oracle-${COLLECTION_VERSION}.tar.gz" +echo "COLLECTION_ARCHIVE: ${COLLECTION_ARCHIVE}" + +echo "Building Collection" +ansible-galaxy collection build -v --force --output-path "${COLLECTION_OUTDIR}" + +echo "Installing Collection" +ansible-galaxy collection install -v --force "${COLLECTION_ARCHIVE}" + +echo "Removing Collectionarchiv" +rm -f "${COLLECTION_ARCHIVE}" diff --git a/playbooks/dbaas-ansible-collection/tools/dev/install_dev.sh b/playbooks/dbaas-ansible-collection/tools/dev/install_dev.sh new file mode 100644 index 0000000..1584bc5 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/tools/dev/install_dev.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +set -eu +set -o pipefail + +if [ "$#" -ne 1 ] ; then + echo "Execute install_dev.sh with Python executable" + echo "Example:" + echo "./install_dev.sh python3.10" + echo "" + echo "Make sure that venv for used python binary is installed before starting the script!" + exit 1 +fi + +PYTHONBIN="${1}" +echo "Using Python for venv: ${PYTHONBIN}" + +basedir=$(dirname -- "$0") + +########################## +##### ansible-oracle ##### +########################## + +echo "venv for ansible-oracle" +venv_dir=~/venv/ansible-oracle +test -d "${venv_dir}/bin/activate" 2>/dev/null || "${PYTHONBIN}" -m venv "${venv_dir}" + +# shellcheck source=/dev/null +source "${venv_dir}"/bin/activate + +echo "install pip modules" +pip --require-virtualenv install -q -r "${basedir}/requirements_dev.txt" +pip list + +########################## +##### ansible-doctor ##### +########################## + +echo "venv for ansible-doctor" +venv_dir=~/venv/ansible-doctor +test -d "${venv_dir}" 2>/dev/null || python3 -m venv "${venv_dir}" + +# shellcheck source=/dev/null +source "${venv_dir}"/bin/activate + +echo "install pip modules" +pip --require-virtualenv install -q -r "${basedir}/requirements_doctor.txt" +pip list + +############################### +##### antsibull-changelog ##### +############################### + +echo "venv for antsibull-changelog" +venv_dir=~/venv/antsibull +test -d "${venv_dir}" 2>/dev/null || python3 -m venv "${venv_dir}" + +# shellcheck source=/dev/null +source "${venv_dir}"/bin/activate + +echo "install pip modules" +pip --require-virtualenv install -q -r "${basedir}/requirements_antsibull.txt" +pip list diff --git a/playbooks/dbaas-ansible-collection/tools/dev/requirements_antsibull.txt b/playbooks/dbaas-ansible-collection/tools/dev/requirements_antsibull.txt new file mode 100644 index 0000000..7db30cc --- /dev/null +++ b/playbooks/dbaas-ansible-collection/tools/dev/requirements_antsibull.txt @@ -0,0 +1,18 @@ +# +# This file is needed for antsibull-changelog +# +# create python-venv: +# python3 -m venv ~/venv/antsibull +# +# install with: +# . ~/venv/antsibull/bin/activate +# pip --require-virtualenv -v install -r tools/dev/requirements_ansibull.txt +# +# execute antsibull-changelog: +# ~/venv/antsibull/bin/antsibull-changelog +# +# older version of ansible is needed for ansible-oracle +# otherwise the ansible-doc gets errors due to problems with ansible-oracle-modules +# They need some refactoring... +ansible-core==2.15.9 +antsibull-changelog==0.29.0 diff --git a/playbooks/dbaas-ansible-collection/tools/dev/requirements_dev.txt b/playbooks/dbaas-ansible-collection/tools/dev/requirements_dev.txt new file mode 100644 index 0000000..ab655e7 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/tools/dev/requirements_dev.txt @@ -0,0 +1,27 @@ +# +# This file is for all developer who wants to use the usual tools in ansible-oracle. +# +# pip modules for ansible-oracle development +# Important: +# Make sure to use Python >= 3.9 for ansible-lint. +# +# create python-venv: +# python3 -m venv ~/venv/ansible-oracle +# +# install with: +# . ~/venv/ansible-oracle/bin/activate +# pip --require-virtualenv -v install -r tools/dev/requirements_dev.txt +# +ansible-core<2.17 +ansible-builder==3.1.0 +ansible-lint==24.7.0 +ansible-navigator==24.8.0 +pre-commit==3.4.0 + +# docker is needed by molecule +docker==6.1.3 +molecule==24.8.0 +molecule-plugins[docker]==23.5.3 + +# xmltodict is needed for ansible.utils.keep_keys +xmltodict==0.13.0 diff --git a/playbooks/dbaas-ansible-collection/tools/dev/requirements_doctor.txt b/playbooks/dbaas-ansible-collection/tools/dev/requirements_doctor.txt new file mode 100644 index 0000000..da8c8a3 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/tools/dev/requirements_doctor.txt @@ -0,0 +1,18 @@ +# +# This file is needed for ansible-doctor +# Due to dependency issues between ansible-lint and ansible-doctor, +# a dedicated venv is needed for ansible-doctor. +# See following issue for reason: +# https://github.com/thegeeklab/ansible-doctor/issues/495 +# +# create python-venv: +# python3 -m venv ~/venv/ansible-doctor +# +# install with: +# . ~/venv/ansible-doctor/bin/activate +# pip --require-virtualenv -v install -r tools/dev/requirements_doctor.txt +# +# execute ansible-doctor: +# ~/venv/ansible-doctor/bin/ansible-doctor +# +ansible-doctor==4.0.1 diff --git a/playbooks/dbaas-ansible-collection/tox-ansible.ini b/playbooks/dbaas-ansible-collection/tox-ansible.ini new file mode 100644 index 0000000..5e1f4b3 --- /dev/null +++ b/playbooks/dbaas-ansible-collection/tox-ansible.ini @@ -0,0 +1,10 @@ +[ansible] + +skip = + py3.7 + py3.8 + 2.9 + 2.10 + 2.11 + 2.12 + 2.13