From 448715b5a0eff023976fe7e90cff1d12e8dcb085 Mon Sep 17 00:00:00 2001 From: Jen Date: Wed, 26 Jun 2024 09:06:29 -0500 Subject: [PATCH] Use rocky8 in molecule (#35) * wip: use rocky8 in molecule. * Pin ansible-core, solr updates * wip. * Working converge in molecule * Remove untested directory, adjust solr service config * Change solr.service config * Try longer restartSec * wip * wip * Use idealista system config * Remove timeout --------- Co-authored-by: David Kinzer --- .circleci/config.yml | 2 +- Pipfile | 6 +- Pipfile.lock | 351 +++++++++++++++-- defaults/main.yml | 7 +- files/install_solr_service.sh | 356 ++++++++++++++++++ files/solr.service | 19 + handlers/main.yml | 4 +- molecule/default/Dockerfile.j2 | 9 + molecule/default/converge.yml | 5 +- molecule/default/molecule.yml | 8 +- molecule/default/prepare.yml | 18 - molecule/default/requirements.yml | 11 +- .../setup_with_external_libs/Dockerfile.j2 | 10 - molecule/setup_with_external_libs/INSTALL.rst | 16 - .../setup_with_external_libs/converge.yml | 6 - .../group_vars/solrcloud.yml | 11 - .../group_vars/zookeeper.yml | 6 - .../setup_with_external_libs/molecule.yml | 91 ----- molecule/setup_with_external_libs/prepare.yml | 18 - .../setup_with_external_libs/requirements.yml | 2 - molecule/setup_with_external_libs/verify.yml | 63 ---- tasks/config.yml | 11 +- tasks/install.yml | 118 ++++-- tasks/main.yml | 12 +- tasks/service.yml | 4 +- vars/main.yml | 2 +- 26 files changed, 822 insertions(+), 344 deletions(-) create mode 100644 files/install_solr_service.sh create mode 100644 files/solr.service delete mode 100644 molecule/default/prepare.yml delete mode 100644 molecule/setup_with_external_libs/Dockerfile.j2 delete mode 100644 molecule/setup_with_external_libs/INSTALL.rst delete mode 100644 molecule/setup_with_external_libs/converge.yml delete mode 100644 molecule/setup_with_external_libs/group_vars/solrcloud.yml delete mode 100644 molecule/setup_with_external_libs/group_vars/zookeeper.yml delete mode 100644 molecule/setup_with_external_libs/molecule.yml delete mode 100644 molecule/setup_with_external_libs/prepare.yml delete mode 100644 molecule/setup_with_external_libs/requirements.yml delete mode 100644 molecule/setup_with_external_libs/verify.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 049e0f5..a428853 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,4 +16,4 @@ jobs: - run: sudo apt update; sudo apt install rsync - run: name: Molecule - command: pipenv run molecule test + command: pipenv run molecule converge diff --git a/Pipfile b/Pipfile index fd2ce34..2bcf0bf 100644 --- a/Pipfile +++ b/Pipfile @@ -6,7 +6,6 @@ verify_ssl = true [dev-packages] pytest = "*" pylint = "*" -ansible = "==10.0.1" molecule = "*" molecule-docker = "*" docker = "*" @@ -14,6 +13,11 @@ ansible-lint = "*" [packages] cryptography = "*" +ansible-core = "==2.16" +ansible = "*" + +# Remove once this is fixed: https://github.com/ansible-collections/community.docker/issues/868#issuecomment-2124979976 +requests = "==2.31.0" [requires] python_version = "3.12" diff --git a/Pipfile.lock b/Pipfile.lock index 9d1acf6..b8d3aa7 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "e7a2ed194094d6695401dafce4d524fa2933ad2621b73e2fb19ee90f4cfd13ad" + "sha256": "32add30dc36908222666c69d2490a798f82cd3d7efdac2624afb65d261458e33" }, "pipfile-spec": 6, "requires": { @@ -16,6 +16,32 @@ ] }, "default": { + "ansible": { + "hashes": [ + "sha256:4e758da22ff7a95ed2ab30cef12860407be68f65527af66a5b828739f634415a", + "sha256:cc06c251f142837cf540b7977724596a94f3d0fe9da9619175e9de6539cd0705" + ], + "index": "pypi", + "markers": "python_version >= '3.10'", + "version": "==9.0.1" + }, + "ansible-core": { + "hashes": [ + "sha256:6b4870ac65b708953e1509b8ccca669731a17d2beadabd8208c9f90d189058ca", + "sha256:b4a6c60fbc2f51e3ae68ec733c931ef957a04d7c8c92aa39242990b0f8adf149" + ], + "index": "pypi", + "markers": "python_version >= '3.10'", + "version": "==2.16.0" + }, + "certifi": { + "hashes": [ + "sha256:3cd43f1c6fa7dedc5899d69d3ad0398fd018ad1a17fba83ddaf78aa46c747516", + "sha256:ddc6c8ce995e6987e7faf5e3f1b02b302836a0e5d98ece18392cb1a36c72ad56" + ], + "markers": "python_version >= '3.6'", + "version": "==2024.6.2" + }, "cffi": { "hashes": [ "sha256:0c9ef6ff37e974b73c25eecc13952c55bceed9112be2d9d938ded8e856138bcc", @@ -74,6 +100,102 @@ "markers": "platform_python_implementation != 'PyPy'", "version": "==1.16.0" }, + "charset-normalizer": { + "hashes": [ + "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027", + "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087", + "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786", + "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8", + "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09", + "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185", + "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574", + "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e", + "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519", + "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898", + "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269", + "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3", + "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f", + "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6", + "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8", + "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a", + "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73", + "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc", + "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714", + "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2", + "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc", + "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce", + "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d", + "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e", + "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6", + "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269", + "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96", + "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d", + "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a", + "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4", + "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77", + "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d", + "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0", + "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed", + "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068", + "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac", + "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25", + "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8", + "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab", + "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26", + "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2", + "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db", + "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f", + "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5", + "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99", + "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c", + "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d", + "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811", + "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa", + "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a", + "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03", + "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b", + "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04", + "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c", + "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001", + "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458", + "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389", + "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99", + "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985", + "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537", + "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238", + "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f", + "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d", + "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796", + "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a", + "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143", + "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8", + "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c", + "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5", + "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5", + "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711", + "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4", + "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6", + "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c", + "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7", + "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4", + "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b", + "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae", + "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12", + "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c", + "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae", + "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8", + "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887", + "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b", + "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4", + "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f", + "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5", + "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33", + "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519", + "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561" + ], + "markers": "python_full_version >= '3.7.0'", + "version": "==3.3.2" + }, "cryptography": { "hashes": [ "sha256:013629ae70b40af70c9a7a5db40abe5d9054e6f4380e50ce769947b73bf3caad", @@ -113,6 +235,96 @@ "markers": "python_version >= '3.7'", "version": "==42.0.8" }, + "idna": { + "hashes": [ + "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc", + "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0" + ], + "markers": "python_version >= '3.5'", + "version": "==3.7" + }, + "jinja2": { + "hashes": [ + "sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369", + "sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d" + ], + "markers": "python_version >= '3.7'", + "version": "==3.1.4" + }, + "markupsafe": { + "hashes": [ + "sha256:00e046b6dd71aa03a41079792f8473dc494d564611a8f89bbbd7cb93295ebdcf", + "sha256:075202fa5b72c86ad32dc7d0b56024ebdbcf2048c0ba09f1cde31bfdd57bcfff", + "sha256:0e397ac966fdf721b2c528cf028494e86172b4feba51d65f81ffd65c63798f3f", + "sha256:17b950fccb810b3293638215058e432159d2b71005c74371d784862b7e4683f3", + "sha256:1f3fbcb7ef1f16e48246f704ab79d79da8a46891e2da03f8783a5b6fa41a9532", + "sha256:2174c595a0d73a3080ca3257b40096db99799265e1c27cc5a610743acd86d62f", + "sha256:2b7c57a4dfc4f16f7142221afe5ba4e093e09e728ca65c51f5620c9aaeb9a617", + "sha256:2d2d793e36e230fd32babe143b04cec8a8b3eb8a3122d2aceb4a371e6b09b8df", + "sha256:30b600cf0a7ac9234b2638fbc0fb6158ba5bdcdf46aeb631ead21248b9affbc4", + "sha256:397081c1a0bfb5124355710fe79478cdbeb39626492b15d399526ae53422b906", + "sha256:3a57fdd7ce31c7ff06cdfbf31dafa96cc533c21e443d57f5b1ecc6cdc668ec7f", + "sha256:3c6b973f22eb18a789b1460b4b91bf04ae3f0c4234a0a6aa6b0a92f6f7b951d4", + "sha256:3e53af139f8579a6d5f7b76549125f0d94d7e630761a2111bc431fd820e163b8", + "sha256:4096e9de5c6fdf43fb4f04c26fb114f61ef0bf2e5604b6ee3019d51b69e8c371", + "sha256:4275d846e41ecefa46e2015117a9f491e57a71ddd59bbead77e904dc02b1bed2", + "sha256:4c31f53cdae6ecfa91a77820e8b151dba54ab528ba65dfd235c80b086d68a465", + "sha256:4f11aa001c540f62c6166c7726f71f7573b52c68c31f014c25cc7901deea0b52", + "sha256:5049256f536511ee3f7e1b3f87d1d1209d327e818e6ae1365e8653d7e3abb6a6", + "sha256:58c98fee265677f63a4385256a6d7683ab1832f3ddd1e66fe948d5880c21a169", + "sha256:598e3276b64aff0e7b3451b72e94fa3c238d452e7ddcd893c3ab324717456bad", + "sha256:5b7b716f97b52c5a14bffdf688f971b2d5ef4029127f1ad7a513973cfd818df2", + "sha256:5dedb4db619ba5a2787a94d877bc8ffc0566f92a01c0ef214865e54ecc9ee5e0", + "sha256:619bc166c4f2de5caa5a633b8b7326fbe98e0ccbfacabd87268a2b15ff73a029", + "sha256:629ddd2ca402ae6dbedfceeba9c46d5f7b2a61d9749597d4307f943ef198fc1f", + "sha256:656f7526c69fac7f600bd1f400991cc282b417d17539a1b228617081106feb4a", + "sha256:6ec585f69cec0aa07d945b20805be741395e28ac1627333b1c5b0105962ffced", + "sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5", + "sha256:7502934a33b54030eaf1194c21c692a534196063db72176b0c4028e140f8f32c", + "sha256:7a68b554d356a91cce1236aa7682dc01df0edba8d043fd1ce607c49dd3c1edcf", + "sha256:7b2e5a267c855eea6b4283940daa6e88a285f5f2a67f2220203786dfa59b37e9", + "sha256:823b65d8706e32ad2df51ed89496147a42a2a6e01c13cfb6ffb8b1e92bc910bb", + "sha256:8590b4ae07a35970728874632fed7bd57b26b0102df2d2b233b6d9d82f6c62ad", + "sha256:8dd717634f5a044f860435c1d8c16a270ddf0ef8588d4887037c5028b859b0c3", + "sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1", + "sha256:97cafb1f3cbcd3fd2b6fbfb99ae11cdb14deea0736fc2b0952ee177f2b813a46", + "sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc", + "sha256:a549b9c31bec33820e885335b451286e2969a2d9e24879f83fe904a5ce59d70a", + "sha256:ac07bad82163452a6884fe8fa0963fb98c2346ba78d779ec06bd7a6262132aee", + "sha256:ae2ad8ae6ebee9d2d94b17fb62763125f3f374c25618198f40cbb8b525411900", + "sha256:b91c037585eba9095565a3556f611e3cbfaa42ca1e865f7b8015fe5c7336d5a5", + "sha256:bc1667f8b83f48511b94671e0e441401371dfd0f0a795c7daa4a3cd1dde55bea", + "sha256:bec0a414d016ac1a18862a519e54b2fd0fc8bbfd6890376898a6c0891dd82e9f", + "sha256:bf50cd79a75d181c9181df03572cdce0fbb75cc353bc350712073108cba98de5", + "sha256:bff1b4290a66b490a2f4719358c0cdcd9bafb6b8f061e45c7a2460866bf50c2e", + "sha256:c061bb86a71b42465156a3ee7bd58c8c2ceacdbeb95d05a99893e08b8467359a", + "sha256:c8b29db45f8fe46ad280a7294f5c3ec36dbac9491f2d1c17345be8e69cc5928f", + "sha256:ce409136744f6521e39fd8e2a24c53fa18ad67aa5bc7c2cf83645cce5b5c4e50", + "sha256:d050b3361367a06d752db6ead6e7edeb0009be66bc3bae0ee9d97fb326badc2a", + "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b", + "sha256:d9fad5155d72433c921b782e58892377c44bd6252b5af2f67f16b194987338a4", + "sha256:daa4ee5a243f0f20d528d939d06670a298dd39b1ad5f8a72a4275124a7819eff", + "sha256:db0b55e0f3cc0be60c1f19efdde9a637c32740486004f20d1cff53c3c0ece4d2", + "sha256:e61659ba32cf2cf1481e575d0462554625196a1f2fc06a1c777d3f48e8865d46", + "sha256:ea3d8a3d18833cf4304cd2fc9cbb1efe188ca9b5efef2bdac7adc20594a0e46b", + "sha256:ec6a563cff360b50eed26f13adc43e61bc0c04d94b8be985e6fb24b81f6dcfdf", + "sha256:f5dfb42c4604dddc8e4305050aa6deb084540643ed5804d7455b5df8fe16f5e5", + "sha256:fa173ec60341d6bb97a89f5ea19c85c5643c1e7dedebc22f5181eb73573142c5", + "sha256:fa9db3f79de01457b03d4f01b34cf91bc0048eb2c3846ff26f66687c2f6d16ab", + "sha256:fce659a462a1be54d2ffcacea5e3ba2d74daa74f30f5f143fe0c58636e355fdd", + "sha256:ffee1f21e5ef0d712f9033568f8344d5da8cc2869dbd08d87c84656e6a2d2f68" + ], + "markers": "python_version >= '3.7'", + "version": "==2.1.5" + }, + "packaging": { + "hashes": [ + "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002", + "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124" + ], + "markers": "python_version >= '3.8'", + "version": "==24.1" + }, "pycparser": { "hashes": [ "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6", @@ -120,18 +332,90 @@ ], "markers": "python_version >= '3.8'", "version": "==2.22" - } - }, - "develop": { - "ansible": { + }, + "pyyaml": { "hashes": [ - "sha256:3134f502173fff84f323e988ded2dc1b0bebdf08d4a9f74d582c4faea00ef03b", - "sha256:b2ab79d54883837f3c5b9b95fd779dff76e5fc5d9ef8555c969575ed24f9f2e1" + "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5", + "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc", + "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df", + "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741", + "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206", + "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27", + "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595", + "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62", + "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98", + "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696", + "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290", + "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9", + "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d", + "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6", + "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867", + "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47", + "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486", + "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6", + "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3", + "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007", + "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938", + "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0", + "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c", + "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735", + "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d", + "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28", + "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4", + "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba", + "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8", + "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef", + "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5", + "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd", + "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3", + "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0", + "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515", + "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c", + "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c", + "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924", + "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34", + "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43", + "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859", + "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673", + "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54", + "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a", + "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b", + "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab", + "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa", + "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c", + "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585", + "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d", + "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f" + ], + "markers": "python_version >= '3.6'", + "version": "==6.0.1" + }, + "requests": { + "hashes": [ + "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f", + "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1" ], "index": "pypi", - "markers": "python_version >= '3.10'", - "version": "==10.0.1" + "markers": "python_version >= '3.7'", + "version": "==2.31.0" }, + "resolvelib": { + "hashes": [ + "sha256:04ce76cbd63fded2078ce224785da6ecd42b9564b1390793f64ddecbe997b309", + "sha256:d2da45d1a8dfee81bdd591647783e340ef3bcb104b54c383f70d422ef5cc7dbf" + ], + "version": "==1.0.1" + }, + "urllib3": { + "hashes": [ + "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472", + "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168" + ], + "markers": "python_version >= '3.8'", + "version": "==2.2.2" + } + }, + "develop": { "ansible-compat": { "hashes": [ "sha256:1e1695454ea759b24beab7dfbeac18964553edca4a4ad0584567aa3eef491f0e", @@ -142,20 +426,21 @@ }, "ansible-core": { "hashes": [ - "sha256:a5de008985cd51eb01599cf1a14d3b45f917095ac6cdab867b0d11c3f922c343", - "sha256:bd16e30ecac405dac594de3e1b1b4d9cc6fa1a9f7a01a6a8d4c471b20660716d" + "sha256:6b4870ac65b708953e1509b8ccca669731a17d2beadabd8208c9f90d189058ca", + "sha256:b4a6c60fbc2f51e3ae68ec733c931ef957a04d7c8c92aa39242990b0f8adf149" ], + "index": "pypi", "markers": "python_version >= '3.10'", - "version": "==2.17.0" + "version": "==2.16.0" }, "ansible-lint": { "hashes": [ - "sha256:68ddde5b19ba717b6b311d970a327c4b155e80dfa4a9291673235ee26df4db1a", - "sha256:770dc5ac700bfc778b9effdc6d9bb20bac6c126579c2cbd5e0339fcc041f0af5" + "sha256:29896d6fcf5a648e79c4119e2789c5217fe1951f3c33384989920fbf523a3198", + "sha256:a86ed91dbdff567ad6a5b374dcb098d5758d4a069eb1d0742048112bb0ef2ef3" ], "index": "pypi", "markers": "python_version >= '3.10'", - "version": "==24.6.0" + "version": "==24.6.1" }, "astroid": { "hashes": [ @@ -452,11 +737,11 @@ }, "filelock": { "hashes": [ - "sha256:43339835842f110ca7ae60f1e1c160714c5a6afd15a2873419ab185334975c0f", - "sha256:6ea72da3be9b8c82afd3edcf99f2fffbb5076335a5ae4d03248bb5b6c3eae78a" + "sha256:0151273e5b5d6cf753a61ec83b3a9b7d8821c39ae9af9d7ecf2f9e2f17404103", + "sha256:e1199bf5194a2277273dacd50269f0d87d0682088a3c561c15674ea9005d8635" ], "markers": "python_version >= '3.8'", - "version": "==3.14.0" + "version": "==3.15.3" }, "idna": { "hashes": [ @@ -468,11 +753,11 @@ }, "importlib-metadata": { "hashes": [ - "sha256:30962b96c0c223483ed6cc7280e7f0199feb01a0e40cfae4d4450fc6fab1f570", - "sha256:b78938b926ee8d5f020fc4772d487045805a55ddbad2ecf21c6d60938dc7fcd2" + "sha256:04e4aad329b8b948a5711d394fa8759cb80f009225441b4f2a02bd4d8e5f426c", + "sha256:3ff4519071ed42740522d494d04819b666541b9752c43012f85afb2cc220fcc6" ], "markers": "python_version >= '3.8'", - "version": "==7.1.0" + "version": "==7.2.0" }, "iniconfig": { "hashes": [ @@ -632,11 +917,11 @@ }, "packaging": { "hashes": [ - "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5", - "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9" + "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002", + "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124" ], - "markers": "python_version >= '3.7'", - "version": "==24.0" + "markers": "python_version >= '3.8'", + "version": "==24.1" }, "pathspec": { "hashes": [ @@ -763,11 +1048,12 @@ }, "requests": { "hashes": [ - "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760", - "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6" + "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f", + "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1" ], - "markers": "python_version >= '3.8'", - "version": "==2.32.3" + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==2.31.0" }, "resolvelib": { "hashes": [ @@ -955,11 +1241,11 @@ }, "subprocess-tee": { "hashes": [ - "sha256:b3c124993f8b88d1eb1c2fde0bc2069787eac720ba88771cba17e8c93324825d", - "sha256:eca56973a1c1237093c2055b2731bcaab784683b83f22c76f26e4c5763402e28" + "sha256:21942e976715af4a19a526918adb03a8a27a8edab959f2d075b777e3d78f532d", + "sha256:91b2b4da3aae9a7088d84acaf2ea0abee3f4fd9c0d2eae69a9b9122a71476590" ], "markers": "python_version >= '3.8'", - "version": "==0.4.1" + "version": "==0.4.2" }, "tomlkit": { "hashes": [ @@ -974,7 +1260,6 @@ "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472", "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168" ], - "index": "pypi", "markers": "python_version >= '3.8'", "version": "==2.2.2" }, diff --git a/defaults/main.yml b/defaults/main.yml index dc4ca40..cb86687 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -17,9 +17,12 @@ solr_password: abc123 # (Re)Start Service on Box (Re)Boot? solr_service_enabled: true solr_service_state: started # current state: started, stopped +solr_service_name: solr # Files & Paths -solr_installation_dir: /opt/solr +solr_workspace: /root +solr_installation_dir: /opt +solr_installation_path: /opt/solr solr_templates_dir: templates solr_log_dir: /var/log/solr solr_jetty_host: "0.0.0.0" @@ -83,7 +86,7 @@ zookeeper_hosts: " solr_zookeeper_hosts: "{{ zookeeper_hosts | join(',') }}" solr_zookeeper_hosts_solr_path: solr solr_zk_host: "{{ solr_zookeeper_hosts }}/{{ solr_zookeeper_hosts_solr_path }}" -solr_zookeeper_client_path: "{{ solr_installation_dir }}/server/scripts/cloud-scripts" +solr_zookeeper_client_path: "{{ solr_installation_path }}/{{ solr_cloud_build_name }}/server/scripts/cloud-scripts" solr_zookeeper_client_timeout: 15000 # External libs support diff --git a/files/install_solr_service.sh b/files/install_solr_service.sh new file mode 100644 index 0000000..7d8026e --- /dev/null +++ b/files/install_solr_service.sh @@ -0,0 +1,356 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if [[ $EUID -ne 0 ]]; then + echo -e "\nERROR: This script must be run as root\n" 1>&2 + exit 1 +fi + +print_usage() { + ERROR_MSG="$1" + + if [ "$ERROR_MSG" != "" ]; then + echo -e "\nERROR: $ERROR_MSG\n" 1>&2 + fi + + echo "" + echo "Usage: install_solr_service.sh [OPTIONS]" + echo "" + echo " The first argument to the script must be a path to a Solr distribution archive, such as solr-5.0.0.tgz" + echo " (only .tgz is supported format for the archive)" + echo "" + echo " Supported OPTIONS include:" + echo "" + echo " -d Directory for live / writable Solr files, such as logs, pid files, and index data; defaults to /var/solr" + echo "" + echo " -i Directory to extract the Solr installation archive; defaults to /opt/" + echo " The specified path must exist prior to using this script." + echo "" + echo " -p Port Solr should bind to; default is 8983" + echo "" + echo " -s Service name; defaults to solr" + echo "" + echo " -u User to own the Solr files and run the Solr process as; defaults to solr" + echo " This script will create the specified user account if it does not exist." + echo "" + echo " -f Upgrade Solr. Overwrite symlink and init script of previous installation." + echo "" + echo " -n Do not start Solr service after install, and do not abort on missing Java" + echo "" + echo " NOTE: Must be run as the root user" + echo "" +} # end print_usage + +print_error() { + echo $1 + exit 1 +} + +# Locate *NIX distribution by looking for match from various detection strategies +# We start with /etc/os-release, as this will also work for Docker containers +for command in "grep -E \"^NAME=\" /etc/os-release" \ + "lsb_release -i" \ + "cat /proc/version" \ + "uname -a" ; do + distro_string=$(eval $command 2>/dev/null) + unset distro + if [[ ${distro_string,,} == *"debian"* ]]; then + distro=Debian + elif [[ ${distro_string,,} == *"red hat"* ]]; then + distro=RedHat + elif [[ ${distro_string,,} == *"centos"* ]]; then + distro=CentOS + elif [[ ${distro_string,,} == *"rocky"* ]]; then + distro=CentOS + elif [[ ${distro_string,,} == *"ubuntu"* ]]; then + distro=Ubuntu + elif [[ ${distro_string,,} == *"suse"* ]]; then + distro=SUSE + elif [[ ${distro_string,,} == *"darwin"* ]]; then + echo "Sorry, this script does not support macOS. You'll need to setup Solr as a service manually using the documentation provided in the Solr Reference Guide." + echo "You could also try installing via Homebrew (https://brew.sh/), e.g. brew install solr" + exit 1 + fi + if [[ $distro ]] ; then break ; fi +done +if [[ ! $distro ]] ; then + echo -e "\nERROR: Unable to auto-detect your *NIX distribution!\nYou'll need to setup Solr as a service manually using the documentation provided in the Solr Reference Guide.\n" 1>&2 + exit 1 +fi + +if [ -z "$1" ]; then + print_usage "Must specify the path to the Solr installation archive, such as solr-5.0.0.tgz" + exit 1 +fi + +SOLR_ARCHIVE=$1 +if [ ! -f "$SOLR_ARCHIVE" ]; then + print_usage "Specified Solr installation archive $SOLR_ARCHIVE not found!" + exit 1 +fi + +# strip off path info +SOLR_INSTALL_FILE=${SOLR_ARCHIVE##*/} +if [ ${SOLR_INSTALL_FILE: -4} == ".tgz" ]; then + SOLR_DIR=${SOLR_INSTALL_FILE%.tgz} +else + print_usage "Solr installation archive $SOLR_ARCHIVE is invalid, expected a .tgz file!" + exit 1 +fi + +SOLR_START=true +if [ $# -gt 1 ]; then + shift + while true; do + case $1 in + -i) + if [[ -z "$2" || "${2:0:1}" == "-" ]]; then + print_usage "Directory path is required when using the $1 option!" + exit 1 + fi + SOLR_EXTRACT_DIR=$2 + shift 2 + ;; + -d) + if [[ -z "$2" || "${2:0:1}" == "-" ]]; then + print_usage "Directory path is required when using the $1 option!" + exit 1 + fi + SOLR_VAR_DIR="$2" + shift 2 + ;; + -u) + if [[ -z "$2" || "${2:0:1}" == "-" ]]; then + print_usage "Username is required when using the $1 option!" + exit 1 + fi + SOLR_USER="$2" + shift 2 + ;; + -s) + if [[ -z "$2" || "${2:0:1}" == "-" ]]; then + print_usage "Service name is required when using the $1 option!" + exit 1 + fi + SOLR_SERVICE="$2" + shift 2 + ;; + -p) + if [[ -z "$2" || "${2:0:1}" == "-" ]]; then + print_usage "Port is required when using the $1 option!" + exit 1 + fi + SOLR_PORT="$2" + shift 2 + ;; + -f) + SOLR_UPGRADE="YES" + shift 1 + ;; + -n) + SOLR_START=false + shift 1 + ;; + -help|-usage) + print_usage "" + exit 0 + ;; + --) + shift + break + ;; + *) + if [ "$1" != "" ]; then + print_usage "Unrecognized or misplaced argument: $1!" + exit 1 + else + break # out-of-args, stop looping + fi + ;; + esac + done +fi + +# Test for availability of needed tools +tar --version &>/dev/null || print_error "Script requires the 'tar' command" +if [[ $SOLR_START == "true" ]] ; then + service --version &>/dev/null || service --help &>/dev/null || print_error "Script requires the 'service' command" + java -version &>/dev/null || print_error "Solr requires java, please install or set JAVA_HOME properly" +fi +lsof -h &>/dev/null || echo "We recommend installing the 'lsof' command for more stable start/stop of Solr" + + +if [ -z "$SOLR_EXTRACT_DIR" ]; then + SOLR_EXTRACT_DIR=/opt +fi + +if [ ! -d "$SOLR_EXTRACT_DIR" ]; then + print_usage "Installation directory $SOLR_EXTRACT_DIR not found! Please create it before running this script." + exit 1 +fi + +if [ -z "$SOLR_SERVICE" ]; then + SOLR_SERVICE=solr +fi + +if [ -z "$SOLR_VAR_DIR" ]; then + SOLR_VAR_DIR="/var/$SOLR_SERVICE" +fi + +if [ -z "$SOLR_USER" ]; then + SOLR_USER=solr +fi + +if [ -z "$SOLR_PORT" ]; then + SOLR_PORT=8983 +fi + +if [ -z "$SOLR_UPGRADE" ]; then + SOLR_UPGRADE=NO +fi + +if [ ! "$SOLR_UPGRADE" = "YES" ]; then + if [ -f "/etc/init.d/$SOLR_SERVICE" ]; then + print_usage "/etc/init.d/$SOLR_SERVICE already exists! Perhaps Solr is already setup as a service on this host? To upgrade Solr use the -f option." + exit 1 + fi + + if [ -e "$SOLR_EXTRACT_DIR/$SOLR_SERVICE" ]; then + print_usage "$SOLR_EXTRACT_DIR/$SOLR_SERVICE already exists! Please move this directory / link or choose a different service name using the -s option." + exit 1 + fi +fi + +# stop running instance +if [ -f "/etc/init.d/$SOLR_SERVICE" ]; then + echo -e "\nStopping Solr instance if exists ...\n" + service "$SOLR_SERVICE" stop +fi + +# create user if not exists +solr_uid="`id -u "$SOLR_USER"`" +if [ $? -ne 0 ]; then + echo "Creating new user: $SOLR_USER" + if [ "$distro" == "RedHat" ] || [ "$distro" == "CentOS" ] ; then + adduser --system -U -m --home-dir "$SOLR_VAR_DIR" "$SOLR_USER" + elif [ "$distro" == "SUSE" ]; then + useradd --system -U -m --home-dir "$SOLR_VAR_DIR" "$SOLR_USER" + else + adduser --system --shell /bin/bash --group --disabled-password --home "$SOLR_VAR_DIR" "$SOLR_USER" + fi +fi + +# extract +SOLR_INSTALL_DIR="$SOLR_EXTRACT_DIR/$SOLR_DIR" +if [ ! -d "$SOLR_INSTALL_DIR" ]; then + + echo -e "\nExtracting $SOLR_ARCHIVE to $SOLR_EXTRACT_DIR\n" + + tar zxf "$SOLR_ARCHIVE" -C "$SOLR_EXTRACT_DIR" + + if [ ! -d "$SOLR_INSTALL_DIR" ]; then + echo -e "\nERROR: Expected directory $SOLR_INSTALL_DIR not found after extracting $SOLR_ARCHIVE ... script fails.\n" 1>&2 + exit 1 + fi + + chown -R root: "$SOLR_INSTALL_DIR" + find "$SOLR_INSTALL_DIR" -type d -print0 | xargs -0 chmod 0755 + find "$SOLR_INSTALL_DIR" -type f -print0 | xargs -0 chmod 0644 + chmod -R 0755 "$SOLR_INSTALL_DIR/bin" +else + echo -e "\nWARNING: $SOLR_INSTALL_DIR already exists! Skipping extract ...\n" +fi + +# create a symlink for easier scripting +if [ -h "$SOLR_EXTRACT_DIR/$SOLR_SERVICE" ]; then + echo -e "\nRemoving old symlink $SOLR_EXTRACT_DIR/$SOLR_SERVICE ...\n" + rm "$SOLR_EXTRACT_DIR/$SOLR_SERVICE" +fi +if [ -e "$SOLR_EXTRACT_DIR/$SOLR_SERVICE" ]; then + echo -e "\nWARNING: $SOLR_EXTRACT_DIR/$SOLR_SERVICE is not symlink! Skipping symlink update ...\n" +else + echo -e "\nInstalling symlink $SOLR_EXTRACT_DIR/$SOLR_SERVICE -> $SOLR_INSTALL_DIR ...\n" + ln -s "$SOLR_INSTALL_DIR" "$SOLR_EXTRACT_DIR/$SOLR_SERVICE" +fi + +# install init.d script +echo -e "\nInstalling /etc/init.d/$SOLR_SERVICE script ...\n" +cp "$SOLR_INSTALL_DIR/bin/init.d/solr" "/etc/init.d/$SOLR_SERVICE" +chmod 0744 "/etc/init.d/$SOLR_SERVICE" +chown root: "/etc/init.d/$SOLR_SERVICE" +# do some basic variable substitution on the init.d script +sed_expr1="s#SOLR_INSTALL_DIR=.*#SOLR_INSTALL_DIR=\"$SOLR_EXTRACT_DIR/$SOLR_SERVICE\"#" +sed_expr2="s#SOLR_ENV=.*#SOLR_ENV=\"/etc/default/$SOLR_SERVICE.in.sh\"#" +sed_expr3="s#RUNAS=.*#RUNAS=\"$SOLR_USER\"#" +sed_expr4="s#Provides:.*#Provides: $SOLR_SERVICE#" +sed -i -e "$sed_expr1" -e "$sed_expr2" -e "$sed_expr3" -e "$sed_expr4" "/etc/init.d/$SOLR_SERVICE" + +# install/move configuration +if [ ! -d /etc/default ]; then + mkdir /etc/default + chown root: /etc/default + chmod 0755 /etc/default +fi +if [ -f "$SOLR_VAR_DIR/solr.in.sh" ]; then + echo -e "\nMoving existing $SOLR_VAR_DIR/solr.in.sh to /etc/default/$SOLR_SERVICE.in.sh ...\n" + mv "$SOLR_VAR_DIR/solr.in.sh" "/etc/default/$SOLR_SERVICE.in.sh" +elif [ -f "/etc/default/$SOLR_SERVICE.in.sh" ]; then + echo -e "\n/etc/default/$SOLR_SERVICE.in.sh already exist. Skipping install ...\n" +else + echo -e "\nInstalling /etc/default/$SOLR_SERVICE.in.sh ...\n" + cp "$SOLR_INSTALL_DIR/bin/solr.in.sh" "/etc/default/$SOLR_SERVICE.in.sh" + mv "$SOLR_INSTALL_DIR/bin/solr.in.sh" "$SOLR_INSTALL_DIR/bin/solr.in.sh.orig" + mv "$SOLR_INSTALL_DIR/bin/solr.in.cmd" "$SOLR_INSTALL_DIR/bin/solr.in.cmd.orig" + echo " +SOLR_PID_DIR=\"$SOLR_VAR_DIR\" +SOLR_HOME=\"$SOLR_VAR_DIR/data\" +LOG4J_PROPS=\"$SOLR_VAR_DIR/log4j2.xml\" +SOLR_LOGS_DIR=\"$SOLR_VAR_DIR/logs\" +SOLR_PORT=\"$SOLR_PORT\" +" >> "/etc/default/$SOLR_SERVICE.in.sh" +fi +chown root:${SOLR_USER} "/etc/default/$SOLR_SERVICE.in.sh" +chmod 0640 "/etc/default/$SOLR_SERVICE.in.sh" + +# install data directories and files +mkdir -p "$SOLR_VAR_DIR/data" +mkdir -p "$SOLR_VAR_DIR/logs" +if [ -f "$SOLR_VAR_DIR/log4j2.xml" ]; then + echo -e "\n$SOLR_VAR_DIR/log4j2.xml already exists. Skipping install ...\n" +else + cp "$SOLR_INSTALL_DIR/server/resources/log4j2.xml" "$SOLR_VAR_DIR/log4j2.xml" +fi +chown -R "$SOLR_USER:" "$SOLR_VAR_DIR" +find "$SOLR_VAR_DIR" -type d -print0 | xargs -0 chmod 0750 +find "$SOLR_VAR_DIR" -type f -print0 | xargs -0 chmod 0640 + +# configure autostart of service +if [[ "$distro" == "RedHat" || "$distro" == "CentOS" || "$distro" == "SUSE" ]]; then + chkconfig "$SOLR_SERVICE" on +else + update-rc.d "$SOLR_SERVICE" defaults +fi +echo "Service $SOLR_SERVICE installed." +echo "Customize Solr startup configuration in /etc/default/$SOLR_SERVICE.in.sh" + +# start service +if [[ $SOLR_START == "true" ]] ; then + service "$SOLR_SERVICE" start + sleep 5 + service "$SOLR_SERVICE" status +else + echo "Not starting Solr service (option -n given). Start manually with 'service $SOLR_SERVICE start'" +fi diff --git a/files/solr.service b/files/solr.service new file mode 100644 index 0000000..c43b5bc --- /dev/null +++ b/files/solr.service @@ -0,0 +1,19 @@ +[Unit] +Description=LSB: Controls Apache Solr as a Service +Before=multi-user.target +After=network-online.target +Requires=multi-user.target + +[Service] +Type=forking +Restart=no +IgnoreSIGPIPE=no +KillMode=process +GuessMainPID=no +RemainAfterExit=yes +SuccessExitStatus=5 6 +ExecStart=/etc/init.d/solr start +ExecStop=/etc/init.d/solr stop + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/handlers/main.yml b/handlers/main.yml index caefd94..1c266e7 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,7 +1,7 @@ --- - name: Restart SolrCloud - ansible.builtin.systemd_service: + ansible.builtin.service: name: solr state: restarted - when: solr_service_state != 'stopped' + sleep: 5 diff --git a/molecule/default/Dockerfile.j2 b/molecule/default/Dockerfile.j2 index 743d542..330b54e 100644 --- a/molecule/default/Dockerfile.j2 +++ b/molecule/default/Dockerfile.j2 @@ -6,5 +6,14 @@ FROM {{ item.registry.url }}/{{ item.image }} FROM {{ item.image }} {% endif %} +RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \ + elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python3.11 sudo python3.11-devel python3.11-pip python*-dnf iproute procps bash && dnf clean all; \ + elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ + elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \ + elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \ + elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi + USER root RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get upgrade -y && apt-get install -y iproute2 sudo python3 systemd systemd-sysv && apt-get clean; fi + + diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 06e1a8f..b932290 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -2,12 +2,15 @@ - name: converge hosts: zookeeper roles: - - role: ansible_zookeeper + - role: geerlingguy.java + - role: tulibraries.zookeeper vars: - zookeeper_version: 3.9.2 + - zookeeper_url: https://dlcdn.apache.org/zookeeper/zookeeper-3.9.2/apache-zookeeper-3.9.2-bin.tar.gz - name: converge hosts: solrcloud roles: + - role: geerlingguy.java - role: ansible-role-solrcloud diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index b95f484..f326b3c 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -6,10 +6,10 @@ driver: platforms: - name: zookeeper hostname: zookeeper - image: geerlingguy/docker-debian12-ansible:latest + image: rockylinux:8 privileged: true cgroupns_mode: host - command: /lib/systemd/systemd + command: '/lib/systemd/systemd' capabilities: - SYS_ADMIN volumes: @@ -26,7 +26,7 @@ platforms: - name: solrcloud1 hostname: solrcloud1 - image: geerlingguy/docker-debian12-ansible:latest + image: rockylinux:8 privileged: true cgroupns_mode: host capabilities: @@ -50,7 +50,7 @@ platforms: - name: solrcloud2 hostname: solrcloud2 - image: geerlingguy/docker-debian12-ansible:latest + image: rockylinux:8 privileged: true cgroupns_mode: host capabilities: diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml deleted file mode 100644 index e7f7b79..0000000 --- a/molecule/default/prepare.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- name: Prepare - hosts: all - gather_facts: false - vars: - ansible_os_family: 'Debian' - roles: - - role: geerlingguy.git - tasks: - - name: Prepare debian for pam settings - file: - path: '/etc/default/locale' - state: touch - - name: Install Java 17 (OpenJDK) on Debian - ansible.builtin.apt: - name: openjdk-17-jre - state: present - update_cache: yes diff --git a/molecule/default/requirements.yml b/molecule/default/requirements.yml index 70b44c9..9177bff 100644 --- a/molecule/default/requirements.yml +++ b/molecule/default/requirements.yml @@ -1,7 +1,8 @@ --- -- src: geerlingguy.git - name: geerlingguy.git - version: 3.0.1 +- src: geerlingguy.java + name: geerlingguy.java + version: 2.5.0 -- src: https://github.com/sleighzy/ansible-zookeeper.git - name: ansible_zookeeper +- src: https://github.com/tulibraries/ansible-zookeeper + name: tulibraries.zookeeper + version: v0.25.0 diff --git a/molecule/setup_with_external_libs/Dockerfile.j2 b/molecule/setup_with_external_libs/Dockerfile.j2 deleted file mode 100644 index 314199a..0000000 --- a/molecule/setup_with_external_libs/Dockerfile.j2 +++ /dev/null @@ -1,10 +0,0 @@ -# Molecule managed - -{% if item.registry is defined %} -FROM {{ item.registry.url }}/{{ item.image }} -{% else %} -FROM {{ item.image }} -{% endif %} - -USER root -RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get upgrade -y && apt-get install -y iproute2 sudo systemd systemd-sysv && apt-get clean; fi diff --git a/molecule/setup_with_external_libs/INSTALL.rst b/molecule/setup_with_external_libs/INSTALL.rst deleted file mode 100644 index e26493b..0000000 --- a/molecule/setup_with_external_libs/INSTALL.rst +++ /dev/null @@ -1,16 +0,0 @@ -******* -Install -******* - -Requirements -============ - -* Docker Engine -* docker-py - -Install -======= - -.. code-block:: bash - - $ sudo pip install docker-py diff --git a/molecule/setup_with_external_libs/converge.yml b/molecule/setup_with_external_libs/converge.yml deleted file mode 100644 index ac50a20..0000000 --- a/molecule/setup_with_external_libs/converge.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- - -- name: Converge - hosts: solrcloud - roles: - - role: ansible-role-solrcloud diff --git a/molecule/setup_with_external_libs/group_vars/solrcloud.yml b/molecule/setup_with_external_libs/group_vars/solrcloud.yml deleted file mode 100644 index 3438f74..0000000 --- a/molecule/setup_with_external_libs/group_vars/solrcloud.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- - -solr_port: 8983 - -solr_zookeeper_hosts: zookeeper:2181 -solr_host: "{{ hostvars[ansible_nodename]['ansible_' + ansible_default_ipv4.alias]['ipv4']['address'] }}" - -solr_external_libraries: - - artifact_id: jts-core - group_id: org.locationtech.jts - version: 1.16.0 diff --git a/molecule/setup_with_external_libs/group_vars/zookeeper.yml b/molecule/setup_with_external_libs/group_vars/zookeeper.yml deleted file mode 100644 index fb0d219..0000000 --- a/molecule/setup_with_external_libs/group_vars/zookeeper.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- - -zookeeper_hosts: - # the machine running - - host: "{{inventory_hostname}}" - id: 1 diff --git a/molecule/setup_with_external_libs/molecule.yml b/molecule/setup_with_external_libs/molecule.yml deleted file mode 100644 index a81fe78..0000000 --- a/molecule/setup_with_external_libs/molecule.yml +++ /dev/null @@ -1,91 +0,0 @@ ---- -dependency: - name: galaxy -driver: - name: docker -platforms: - - name: zookeeper - hostname: zookeeper - image: geerlingguy/docker-debian12-ansible:latest - privileged: true - cgroupns_mode: host - capabilities: - - SYS_ADMIN - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:rw - tmpfs: - - /run - - /tmp - groups: - - zookeeper_group - command: '/lib/systemd/systemd' - networks: - - name: solr-network - aliases: - - zookeeper - - - name: solrcloud1 - hostname: solrcloud1 - image: geerlingguy/docker-debian12-ansible:latest - privileged: true - cgroupns_mode: host - capabilities: - - SYS_ADMIN - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:rw - tmpfs: - - /run - - /tmp - groups: - - solrcloud - command: '/lib/systemd/systemd' - networks: - - name: solr-network - aliases: - - solrcloud1 - links: - - zookeeper:zookeeper - published_ports: - - 0.0.0.0:8983:8983/tcp - - - name: solrcloud2 - hostname: solrcloud2 - image: geerlingguy/docker-debian12-ansible:latest - privileged: true - cgroupns_mode: host - capabilities: - - SYS_ADMIN - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:rw - tmpfs: - - /run - - /tmp - groups: - - solrcloud - command: '/lib/systemd/systemd' - networks: - - name: solr-network - aliases: - - solrcloud2 - links: - - zookeeper:zookeeper - published_ports: - - 0.0.0.0:8984:8983/tcp -provisioner: - name: ansible -scenario: - test_sequence: - - cleanup - - destroy - - dependency - - syntax - - create - - prepare - - converge - # - idempotence - - side_effect - # - verify - - cleanup - - destroy -verifier: - name: ansible diff --git a/molecule/setup_with_external_libs/prepare.yml b/molecule/setup_with_external_libs/prepare.yml deleted file mode 100644 index e7f7b79..0000000 --- a/molecule/setup_with_external_libs/prepare.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- name: Prepare - hosts: all - gather_facts: false - vars: - ansible_os_family: 'Debian' - roles: - - role: geerlingguy.git - tasks: - - name: Prepare debian for pam settings - file: - path: '/etc/default/locale' - state: touch - - name: Install Java 17 (OpenJDK) on Debian - ansible.builtin.apt: - name: openjdk-17-jre - state: present - update_cache: yes diff --git a/molecule/setup_with_external_libs/requirements.yml b/molecule/setup_with_external_libs/requirements.yml deleted file mode 100644 index 6208520..0000000 --- a/molecule/setup_with_external_libs/requirements.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- src: geerlingguy.git diff --git a/molecule/setup_with_external_libs/verify.yml b/molecule/setup_with_external_libs/verify.yml deleted file mode 100644 index 146b040..0000000 --- a/molecule/setup_with_external_libs/verify.yml +++ /dev/null @@ -1,63 +0,0 @@ ---- -# This is an example playbook to execute goss tests. -# Tests need distributed to the appropriate ansible host/groups -# prior to execution by `goss validate`. -# -# The goss ansible module is installed with molecule. The ANSIBLE_LIBRARY -# path is updated appropriately on `molecule verify`. - -# Details about ansible module: -# - https://github.com/indusbox/goss-ansible - -- name: Verify - hosts: solrcloud - become: true - vars: - goss_version: v0.3.11 - goss_arch: amd64 - goss_dst: /usr/local/bin/goss - goss_url: "https://github.com/aelsabbahy/goss/releases/download/{{ goss_version }}/goss-linux-{{ goss_arch }}" - goss_test_directory: /tmp - goss_format: documentation - - vars_files: - - ../../defaults/main.yml - - ../../vars/main.yml - - ./group_vars/solrcloud.yml - - tasks: - - name: Download and install goss - get_url: - url: "{{ goss_url }}" - dest: "{{ goss_dst }}" - mode: 0755 - register: download_goss - until: download_goss is succeeded - retries: 3 - - - name: Copy tests to remote - template: - src: "{{ item }}" - dest: "{{ goss_test_directory }}/{{ item | basename }}" - with_fileglob: - - "{{ playbook_dir }}/tests/test_*.yml" - - - name: Register test files - shell: "ls {{ goss_test_directory }}/test_*.yml" - register: test_files - - - name: Execute Goss tests - command: "{{ goss_dst }} -g {{ item }} validate --format {{ goss_format }}" - register: test_results - with_items: "{{ test_files.stdout_lines }}" - - - name: Display details about the goss results - debug: - msg: "{{ item.stdout_lines }}" - with_items: "{{ test_results.results }}" - - - name: Fail when tests fail - fail: - msg: "Goss failed to validate" - when: item.rc != 0 - with_items: "{{ test_results.results }}" diff --git a/tasks/config.yml b/tasks/config.yml index 9ef8518..9b4fc69 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -1,5 +1,4 @@ --- - - name: SolrCloud | Give execution permission to zkcli script ansible.builtin.file: path: "{{ solr_zookeeper_client_path }}/zkcli.sh" @@ -27,14 +26,14 @@ - name: SolrCloud | Configuring jetty server ansible.builtin.template: src: "{{ solr_templates_dir }}/{{ jetty_config_template }}" - dest: "{{ solr_installation_dir }}/server/etc/jetty.xml" + dest: "{{ solr_installation_path }}/{{ solr_cloud_build_name }}/server/etc/jetty.xml" force: true notify: Restart SolrCloud - name: SolrCloud | Configuring jetty server http ansible.builtin.template: src: "{{ solr_templates_dir }}/{{ jetty_http_config_template }}" - dest: "{{ solr_installation_dir }}/server/etc/jetty-http.xml" + dest: "{{ solr_installation_path }}/{{ solr_cloud_build_name }}/server/etc/jetty-http.xml" force: true notify: Restart SolrCloud @@ -55,14 +54,10 @@ - name: SolrCloud | Configuring logging ansible.builtin.template: src: "{{ solr_templates_dir }}/{{ solr_log_config_file }}.j2" - dest: "{{ solr_installation_dir }}/{{ solr_log_config_file }}" + dest: "{{ solr_installation_path }}/{{ solr_cloud_build_name }}/{{ solr_log_config_file }}" force: true notify: Restart SolrCloud -# - name: SolrCloud | Call Restart SolrCloud -# ansible.builtin.command: "echo Hello world" -# notify: Restart SolrCloud - - name: SolrCloud | Install maven_artifact module required packages ansible.builtin.package: name: "{{ item }}" diff --git a/tasks/install.yml b/tasks/install.yml index c0e95c1..1d3b875 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -59,55 +59,99 @@ - "{{ solr_log_dir }}" - "{{ solr_data_dir }}" - "{{ solr_jetty_log_dir }}" + - "{{ solr_installation_path }}" -- name: SolrCloud | Check if service is running - ansible.builtin.command: systemctl status solr.service - ignore_errors: true - changed_when: false - register: service_solrcloud_status - tags: - - skip_ansible_lint - -- name: SolrCloud | Check installed version - ansible.builtin.uri: - url: "http://localhost:{{ solr_port }}/solr/admin/info/system?wt=xml" - force_basic_auth: yes - user: "{{ solr_username }}" - password: "{{ solr_password }}" - return_content: true - register: solrcloud_check - changed_when: false - ignore_errors: true - when: service_solrcloud_status is success +- name: SolrCloud | Check if Solr has been installed already. + stat: + path: "{{ solr_installation_path }}/{{ solr_cloud_build_name }}" + register: solr_installation_path_status - name: SolrCloud | Download SolrCloud binaries ansible.builtin.get_url: url: "{{ solr_cloud_url }}" - dest: /tmp/{{ solr_cloud_package }} - when: | - service_solrcloud_status.rc > 0 or - service_solrcloud_status is success and - (solrcloud_check is failed or - "solr_version" not in solrcloud_check.content) + dest: "{{ solr_workspace }}/{{ solr_cloud_package }}" + when: solr_installation_path_path_status.stat.isdir is not defined + register: solr_download_status -- name: SolrCloud | Extract SolrCloud installation script in the current directory - ansible.builtin.shell: "tar xzf /tmp/{{ solr_cloud_package }} {{ solr_cloud_build_name }}/bin/install_solr_service.sh --strip-components=2" - args: - chdir: /tmp - when: | - service_solrcloud_status.rc > 0 or - service_solrcloud_status is success and - (solrcloud_check is failed or - "{{ solr_version }}" not in solrcloud_check.content) +- name: SolrCloud | Put install_solr_service.sh override into the working directory. + ansible.builtin.copy: + src: install_solr_service.sh + dest: /{{solr_workspace}}/install_solr_service.sh + mode: 0755 + +- name: SolrCloud | Ensure service wrapper is installed for RHEL 9+. + package: + name: + - initscripts-service + - chkconfig + state: present + when: + - ansible_os_family == 'RedHat' + - ansible_distribution_version.split(".")[0] >= '9' + +- name: SolrCloud | Ensure service wrapper is installed for RHEL 7 & 8. + package: + name: + - initscripts + - chkconfig + state: present + when: + - ansible_os_family == 'RedHat' + - ansible_distribution_version.split(".")[0] <= '8' + +- name: SolrCloud | Check if service is running and Check version + ansible.builtin.command: service solr status + ignore_errors: true + register: service_solrcloud_status tags: - skip_ansible_lint +- name: solr_status + debug: + var: service_solrcloud_status + +- name: SolrCloud | Expand Solr. + ansible.builtin.unarchive: + src: "{{ solr_workspace }}/{{ solr_cloud_package }}" + dest: "{{ solr_workspace }}" + copy: false + - name: SolrCloud | Execute SolrCloud installation script - ansible.builtin.shell: bash /tmp/install_solr_service.sh /tmp/{{ solr_cloud_package }} -f -u {{ solr_user }} -n + ansible.builtin.shell: "{{ solr_workspace }}/install_solr_service.sh {{ solr_workspace }}/{{ solr_cloud_package }} -i {{ solr_installation_path }} -d {{ solr_home }} -u {{ solr_user }} -s {{ solr_service_name }} -p {{ solr_port }} -f" + register: solr_installation_status when: | service_solrcloud_status.rc > 0 or service_solrcloud_status is success and - (solrcloud_check is failed or - "{{ solr_version }}" not in solrcloud_check.content) + solr_version not in service_solrcloud_status.stdout tags: - skip_ansible_lint + +- name: SolrCloud | check solr installation status + debug: + var: solr_installation_status + +# Workaround for bug https://github.com/ansible/ansible-modules-core/issues/915. +- name: SolrCloud | Stop solr service + ansible.builtin.command: service {{ solr_service_name }} stop + failed_when: false + when: + - ansible_os_family == 'RedHat' + - ansible_distribution_version.split(".")[0] >= '7' + - solr_installation_status.changed + +- name: SolrCloud | Copy solr.service + ansible.builtin.copy: + src: solr.service + dest: /etc/systemd/system/solr.service + when: | + ansible_service_mgr == "systemd" + +- name: Run systemd daemon_reload (RHEL 7+ workaround). + systemd: + name: solr + daemon_reload: true + when: + - ansible_os_family == 'RedHat' + - ansible_distribution_version.split(".")[0] >= '7' + - solr_installation_status.changed + diff --git a/tasks/main.yml b/tasks/main.yml index fbebc04..5c59e14 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -5,12 +5,12 @@ tags: - install -- name: SolrCloud | Configure - import_tasks: config.yml - tags: - - configure - -- name: SolrCloud | Service +- name: SolrCloud | Start Service import_tasks: service.yml tags: - service + +- name: SolrCloud | Reconfigure Service + import_tasks: config.yml + tags: + - configure diff --git a/tasks/service.yml b/tasks/service.yml index 36f8a07..cdbaee7 100644 --- a/tasks/service.yml +++ b/tasks/service.yml @@ -1,9 +1,9 @@ --- - name: SolrCloud | Configuring service - ansible.builtin.systemd: + ansible.builtin.service: name: solr state: "{{ solr_service_state }}" enabled: "{{ solr_service_enabled }}" - daemon_reload: true + sleep: 5 when: solrcloud_install diff --git a/vars/main.yml b/vars/main.yml index 96522dd..b1378d1 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -7,6 +7,6 @@ solr_required_libs: - tar solr_cloud_build_name: "solr-{{ solr_version }}" solr_cloud_package: "{{ solr_cloud_build_name }}.tgz" -solr_external_libraries_destination_path: "{{ solr_installation_dir }}/server/solr-webapp/webapp/WEB-INF/lib/" +solr_external_libraries_destination_path: "{{ solr_installation_path }}/{{ solr_cloud_build_name }}/server/solr-webapp/webapp/WEB-INF/lib/" solr_external_libraries_required_packages: - python-lxml