From 7e80e1c7d62c0028456cfa7b6ec1842412920cbe Mon Sep 17 00:00:00 2001 From: Andrey Gubarev Date: Thu, 15 Feb 2018 09:10:49 +0300 Subject: [PATCH 1/5] add pipfile --- Pipfile | 32 +++ Pipfile.lock | 635 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 667 insertions(+) create mode 100644 Pipfile create mode 100644 Pipfile.lock diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..99c55bb --- /dev/null +++ b/Pipfile @@ -0,0 +1,32 @@ +[[source]] + +url = "https://pypi.python.org/simple" +verify_ssl = true +name = "pypi" + + +[packages] + +molecule = "*" +ansible = "==2.3.3.0" +enum = "*" +"flake8" = "*" +docker = "*" +pbr = "*" +funcsigs = "*" +"backports.functools-lru-cache" = "*" +configparser = "*" +"enum34" = "*" +ipaddress = "*" +docker-py = "*" +"backports.ssl-match-hostname" = "*" +python-vagrant = "*" + + +[dev-packages] + + + +[requires] + +python_version = "2.7" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..0a27280 --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,635 @@ +{ + "_meta": { + "hash": { + "sha256": "a754608bba9d81dcf0e1abc7c474fecc469487d8b6d63b42254e988afcbac1e5" + }, + "host-environment-markers": { + "implementation_name": "cpython", + "implementation_version": "0", + "os_name": "posix", + "platform_machine": "x86_64", + "platform_python_implementation": "CPython", + "platform_release": "17.4.0", + "platform_system": "Darwin", + "platform_version": "Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64", + "python_full_version": "2.7.14", + "python_version": "2.7", + "sys_platform": "darwin" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "2.7" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.python.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "ansible": { + "hashes": [ + "sha256:da2a715f6ca14a76001cc0f4bd1e44024328b3c2dad2c946dc9c7ed2d7c30afa" + ], + "version": "==2.3.3.0" + }, + "ansible-lint": { + "hashes": [ + "sha256:7ce9122e80ceed063e13c47c7430dbc541838a47cf560d3bcd87a0982a429877" + ], + "version": "==3.4.19" + }, + "anyconfig": { + "hashes": [ + "sha256:5729dbeb5d801df2e9c65fbf3eef1018894baa6938539d113dbfd43264baa581" + ], + "version": "==0.9.1" + }, + "arrow": { + "hashes": [ + "sha256:a558d3b7b6ce7ffc74206a86c147052de23d3d4ef0e17c210dd478c53575c4cd" + ], + "version": "==0.12.1" + }, + "asn1crypto": { + "hashes": [ + "sha256:2f1adbb7546ed199e3c90ef23ec95c5cf3585bac7d11fb7eb562a3fe89c64e87", + "sha256:9d5c20441baf0cb60a4ac34cc447c6c189024b6b4c6cd7877034f4965c464e49" + ], + "version": "==0.24.0" + }, + "attrs": { + "hashes": [ + "sha256:a17a9573a6f475c99b551c0e0a812707ddda1ec9653bed04c13841404ed6f450", + "sha256:1c7960ccfd6a005cd9f7ba884e6316b5e430a3f1a6c37c5f87d8b43f83b54ec9" + ], + "version": "==17.4.0" + }, + "backports.functools-lru-cache": { + "hashes": [ + "sha256:f0b0e4eba956de51238e17573b7087e852dfe9854afd2e9c873f73fc0ca0a6dd", + "sha256:9d98697f088eb1b0fa451391f91afb5e3ebde16bbdb272819fd091151fda4f1a" + ], + "version": "==1.5" + }, + "backports.ssl-match-hostname": { + "hashes": [ + "sha256:502ad98707319f4a51fa2ca1c677bd659008d27ded9f6380c79e8932e38dcdf2" + ], + "version": "==3.5.0.1" + }, + "bcrypt": { + "hashes": [ + "sha256:f9210820ee4818d84658ed7df16a7f30c9fba7d8b139959950acef91745cc0f7", + "sha256:b1e8491c6740f21b37cca77bc64677696a3fb9f32360794d57fa8477b7329eda", + "sha256:9eced8962ce3b7124fe20fd358cf8c7470706437fa064b9874f849ad4c5866fc", + "sha256:346d6f84ff0b493dbc90c6b77136df83e81f903f0b95525ee80e5e6d5e4eef84", + "sha256:0f317e4ffbdd15c3c0f8ab5fbd86aa9aabc7bea18b5cc5951b456fe39e9f738c", + "sha256:f7fd3ed3745fe6e81e28dc3b3d76cce31525a91f32a387e1febd6b982caf8cdb", + "sha256:3b4c23300c4eded8895442c003ae9b14328ae69309ac5867e7530de8bdd7875d", + "sha256:34dd60b90b0f6de94a89e71fcd19913a30e83091c8468d0923a93a0cccbfbbff", + "sha256:2788c32673a2ad0062bea850ab73cffc0dba874db10d7a3682b6f2f280553f20", + "sha256:6efd9ca20aefbaf2e7e6817a2c6ed4a50ff6900fafdea1bcb1d0e9471743b144", + "sha256:f2fe545d27a619a552396533cddf70d83cecd880a611cdfdbb87ca6aec52f66b", + "sha256:e22f0997622e1ceec834fd25947dc2ee2962c2133ea693d61805bc867abaf7ea", + "sha256:c906bdb482162e9ef48eea9f8c0d967acceb5c84f2d25574c7d2a58d04861df1", + "sha256:43d1960e7db14042319c46925892d5fa99b08ff21d57482e6f5328a1aca03588", + "sha256:321d4d48be25b8d77594d8324c0585c80ae91ac214f62db9098734e5e7fb280f", + "sha256:ae35dbcb6b011af6c840893b32399252d81ff57d52c13e12422e16b5fea1d0fb", + "sha256:09a3b8c258b815eadb611bad04ca15ec77d86aa9ce56070e1af0d5932f17642a", + "sha256:988cac675e25133d01a78f2286189c1f01974470817a33eaf4cfee573cfb72a5", + "sha256:cb18ffdc861dbb244f14be32c47ab69604d0aca415bee53485fcea4f8e93d5ef", + "sha256:8629ea6a8a59f865add1d6a87464c3c676e60101b8d16ef404d0a031424a8491", + "sha256:a005ed6163490988711ff732386b08effcbf8df62ae93dd1e5bda0714fad8afb", + "sha256:d86da365dda59010ba0d1ac45aa78390f56bf7f992e65f70b3b081d5e5257b09", + "sha256:8569844a5d8e1fdde4d7712a05ab2e6061343ac34af6e7e3d7935b2bd1907bfd", + "sha256:0872eeecdf9a429c1420158500eedb323a132bc5bf3339475151c52414729e70", + "sha256:01477981abf74e306e8ee31629a940a5e9138de000c6b0898f7f850461c4a0a5", + "sha256:49e96267cd9be55a349fd74f9852eb9ae2c427cd7f6455d0f1765d7332292832", + "sha256:9a6fedda73aba1568962f7543a1f586051c54febbc74e87769bad6a4b8587c39", + "sha256:054d6e0acaea429e6da3613fcd12d05ee29a531794d96f6ab959f29a39f33391", + "sha256:67ed1a374c9155ec0840214ce804616de49c3df9c5bc66740687c1c9b1cd9e8d" + ], + "version": "==3.1.4" + }, + "binaryornot": { + "hashes": [ + "sha256:b8b71173c917bddcd2c16070412e369c3ed7f0528926f70cac18a6c97fd563e4", + "sha256:359501dfc9d40632edc9fac890e19542db1a287bbcfa58175b66658392018061" + ], + "version": "==0.4.4" + }, + "certifi": { + "hashes": [ + "sha256:14131608ad2fd56836d33a71ee60fa1c82bc9d2c8d98b7bdbc631fe1b3cd1296", + "sha256:edbc3f203427eef571f79a7692bb160a2b0f7ccaa31953e99bd17e307cf63f7d" + ], + "version": "==2018.1.18" + }, + "cffi": { + "hashes": [ + "sha256:5d0d7023b72794ea847725680e2156d1d01bc698a9007fccce46d03c904fe093", + "sha256:86903c0afab4a3390170aca61f753f5adad8ffff947030719ee44dedc5b68403", + "sha256:7d35678a54da0d3f1bc30e3a58a232043753d57c691875b5a75e4e062793bc9a", + "sha256:824cac33906be5c8e976f0d950924d88ec058989ef9cd2f77f5cd53cec417635", + "sha256:6ca52651f6bd4b8647cb7dee15c82619de3e13490f8e0bc0620830a2245b51d1", + "sha256:a183959a4b1e01d6172aeed356e2523ec8682596075aa6cf0003fe08da959a49", + "sha256:9532c5bc0108bd0fe43c0eb3faa2ef98a2db60fc0d4019f106b88d46803dd663", + "sha256:96652215ef328262b5f1d5647632bd342ac6b31dfbc495b21f1ab27cb06d621d", + "sha256:6c99d19225e3135f6190a3bfce2a614cae8eaa5dcaf9e0705d4ccb79a3959a3f", + "sha256:12cbf4c04c1ad07124bfc9e928c01e282feac9ec7dd72a18042d4fc56456289a", + "sha256:69c37089ccf10692361c8d14dbf4138b00b46741ffe9628755054499f06ed548", + "sha256:b8d1454ef627098dc76ccfd6211a08065e6f84efe3754d8d112049fec3768e71", + "sha256:cd13f347235410c592f6e36395ee1c136a64b66534f10173bfa4df1dc88f47d0", + "sha256:0640f12f04f257c4467075a804a4920a5d07ef91e11c525fc65d715c08231c81", + "sha256:89a8d05b96bdeca8fdc89c5fa9469a357d30f6c066262e92c0c8d2e4d3c53cae", + "sha256:a67c430a9bde73ae85b0c885fcf41b556760e42ea74c16dc70431a349989b448", + "sha256:7a831170b621e98f45ed1d5758325be19619a593924127a0a47af9a72a117319", + "sha256:796d0379102e6da5215acfcd20e8e69cca9d97309215b4ce088fe175b1c2f586", + "sha256:0fe3b3d571543a4065059d1d3d6d39f4ca6da0f2207ad13547094522e32ead46", + "sha256:678135090c311780382b1dd3f828f715583ea8a69687ed053c047d3cec6625d6", + "sha256:f4992cd7b4c867f453d44c213ee29e8fd484cf81cfece4b6e836d0982b6fa1cf", + "sha256:6d191fb20138fe1948727b20e7b96582b7b7e676135eabf72d910e10bf7bfa65", + "sha256:ec208ca16e57904dd7f4c7568665f80b1f7eb7e3214be014560c28def219060d", + "sha256:b3653644d6411bf4bd64c1f2ca3cb1b093f98c68439ade5cef328609bbfabf8c", + "sha256:f4719d0bafc5f0a67b2ec432086d40f653840698d41fa6e9afa679403dea9d78", + "sha256:87f837459c3c78d75cb4f5aadf08a7104db15e8c7618a5c732e60f252279c7a6", + "sha256:df9083a992b17a28cd4251a3f5c879e0198bb26c9e808c4647e0a18739f1d11d" + ], + "markers": "platform_python_implementation != 'PyPy'", + "version": "==1.11.4" + }, + "chardet": { + "hashes": [ + "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691", + "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae" + ], + "version": "==3.0.4" + }, + "click": { + "hashes": [ + "sha256:29f99fc6125fbc931b758dc053b3114e55c77a6e4c6c3a2674a2dc986016381d", + "sha256:f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b" + ], + "version": "==6.7" + }, + "click-completion": { + "hashes": [ + "sha256:079fb138887d4de12a0b7fbebf8d92d396b7c1a9c49f63475d9f3909d2588976" + ], + "version": "==0.2.1" + }, + "colorama": { + "hashes": [ + "sha256:a4c0f5bc358a62849653471e309dcc991223cf86abafbec17cd8f41327279e89", + "sha256:e043c8d32527607223652021ff648fbb394d5e19cba9f1a698670b338c9d782b", + "sha256:f4945bf52ae49da0728fe730a33c18744803752fc948f154f29dc0c4f9f2f9cc" + ], + "version": "==0.3.7" + }, + "configparser": { + "hashes": [ + "sha256:5308b47021bc2340965c371f0f058cc6971a04502638d4244225c49d80db273a" + ], + "version": "==3.5.0" + }, + "cookiecutter": { + "hashes": [ + "sha256:7d95c48717c725580b4ea6d80a7256479990ab8309003e60695ea1877c296fc9", + "sha256:3fcb10dbfe4da02bf779a88f96109c1a28ff68f42d87587788f841735820249c" + ], + "version": "==1.5.1" + }, + "cryptography": { + "hashes": [ + "sha256:69285f5615507b6625f89ea1048addd1d9218585fb886eb90bdebb1d2b2d26f5", + "sha256:6cb1224da391fa90f1be524eafb375b62baf8d3df9690b32e8cc475ccfccee5e", + "sha256:4f385ee7d39ee1ed74f1d6b1da03d0734ea82855a7b28a9e6e88c4091bc58664", + "sha256:a5f2c681fd040ed648513939a1dd2242af19bd5e9e79e53b6dcfa33bdae61217", + "sha256:fc2208d95d9ecc8032f5e38330d5ace2e3b0b998e42b08c30c35b2ab3a4a3bc8", + "sha256:0d39a93cf25edeae1f796bbc5960e587f34513a852564f6345ea4491a86c5997", + "sha256:41f94194ae78f83fd94ca94fb8ad65f92210a76a2421169ffa5c33c3ec7605f4", + "sha256:7a2409f1564c84bcf2563d379c9b6148c5bc6b0ae46e109f6a7b4bebadf551df", + "sha256:55555d784cfdf9033e81f044c0df04babed2aa141213765d960d233b0139e353", + "sha256:9a47a80f65f4feaaf8415a40c339806c7d7d867152ddccc6ca87f707c8b7b565", + "sha256:6fb22f63e17813f3d1d8e30dd1e249e2c34233ba1d3de977fd31cb5db764c7d0", + "sha256:ee245f185fae723133511e2450be08a66c2eebb53ad27c0c19b228029f4748a5", + "sha256:9a2945efcff84830c8e237ab037d0269380d75d400a89cc9e5628e52647e21be", + "sha256:2cfcee8829c5dec55597826d52c26bc26e7ce39adb4771584459d0636b0b7108", + "sha256:33b564196dcd563e309a0b07444e31611368afe3a3822160c046f5e4c3b5cdd7", + "sha256:18d0b0fc21f39b35ea469a82584f55eeecec1f65a92d85af712c425bdef627b3", + "sha256:d18df9cf3f3212df28d445ea82ce702c4d7a35817ef7a38ee38879ffa8f7e857", + "sha256:b984523d28737e373c7c35c8b6db6001537609d47534892de189bebebaa42a47", + "sha256:27a208b9600166976182351174948e128818e7fc95cbdba18143f3106a211546", + "sha256:28e4e9a97713aa47b5ef9c5003def2eb58aec89781ef3ef82b1c2916a8b0639b", + "sha256:a3c180d12ffb1d8ee5b33a514a5bcb2a9cc06cc89aa74038015591170c82f55d", + "sha256:8487524a1212223ca6dc7e2c8913024618f7ff29855c98869088e3818d5f6733", + "sha256:e4d967371c5b6b2e67855066471d844c5d52d210c36c28d49a8507b96e2c5291" + ], + "version": "==2.1.4" + }, + "docker": { + "hashes": [ + "sha256:cdf9e280e423664660dea9b9fd7d8292059ce597ca7cc662d4601a6f0814c214", + "sha256:994e0ab827ff9b09ee4ee47ccbaec824eada0a7946fb082482895567aa2c79ae" + ], + "version": "==3.0.1" + }, + "docker-py": { + "hashes": [ + "sha256:35b506e95861914fa5ad57a6707e3217b4082843b883be246190f57013948aba", + "sha256:4c2a75875764d38d67f87bc7d03f7443a3895704efc57962bdf6500b8d4bc415" + ], + "version": "==1.10.6" + }, + "docker-pycreds": { + "hashes": [ + "sha256:408ae6ec2b97345e02cbb3a05e0055443a27969e5b61d6773c733b534a40845b", + "sha256:c7ab85de2894baff6ee8f15160cbbfa2fd3a04e56f0372c5793d24060687b299" + ], + "version": "==0.2.2" + }, + "enum": { + "hashes": [ + "sha256:54e78526b166982b36884613f35a76d9a6711c49810d3ec1a05b10c9b31f938e" + ], + "version": "==0.4.6" + }, + "enum34": { + "hashes": [ + "sha256:6bd0f6ad48ec2aa117d3d141940d484deccda84d4fcd884f5c3d93c23ecd8c79", + "sha256:644837f692e5f550741432dd3f223bbb9852018674981b1664e5dc339387588a", + "sha256:8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1", + "sha256:2d81cbbe0e73112bdfe6ef8576f2238f2ba27dd0d55752a776c41d38b7da2850" + ], + "version": "==1.1.6" + }, + "fasteners": { + "hashes": [ + "sha256:564a115ff9698767df401efca29620cbb1a1c2146b7095ebd304b79cc5807a7c", + "sha256:427c76773fe036ddfa41e57d89086ea03111bbac57c55fc55f3006d027107e18" + ], + "version": "==0.14.1" + }, + "flake8": { + "hashes": [ + "sha256:83905eadba99f73fbfe966598aaf1682b3eb6755d2263c5b33a4e8367d60b0d1", + "sha256:b907a26dcf5580753d8f80f1be0ec1d5c45b719f7bac441120793d1a70b03f12" + ], + "version": "==3.3.0" + }, + "funcsigs": { + "hashes": [ + "sha256:330cc27ccbf7f1e992e69fef78261dc7c6569012cf397db8d3de0234e6c937ca", + "sha256:a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50" + ], + "version": "==1.0.2" + }, + "future": { + "hashes": [ + "sha256:e39ced1ab767b5936646cedba8bcce582398233d6a627067d4c6a454c90cfedb" + ], + "version": "==0.16.0" + }, + "git-url-parse": { + "hashes": [ + "sha256:bf0a20c48e8552fea1218b52714be84fa31b0d73c58897e70b765d5e7a26f4cb", + "sha256:5cec43946d06d1a35e90567473d9ffe929c38ff25fd01a1858331cd0aa265e44", + "sha256:75d1cf1e19534678711e1a9293e6fb978461a5f734adf941cd468a802d08bbb2" + ], + "version": "==1.0.2" + }, + "idna": { + "hashes": [ + "sha256:8c7309c718f94b3a625cb648ace320157ad16ff131ae0af362c9f21b80ef6ec4", + "sha256:2c6a5de3089009e3da7c5dde64a141dbc8551d5b7f6cf4ed7c2568d0cc520a8f" + ], + "version": "==2.6" + }, + "ipaddress": { + "hashes": [ + "sha256:200d8686011d470b5e4de207d803445deee427455cd0cb7c982b68cf82524f81" + ], + "version": "==1.0.19" + }, + "jinja2": { + "hashes": [ + "sha256:2231bace0dfd8d2bf1e5d7e41239c06c9e0ded46e70cc1094a0aa64b0afeb054", + "sha256:ddaa01a212cd6d641401cb01b605f4a4d9f37bfc93043d7f760ec70fb99ff9ff" + ], + "version": "==2.9.6" + }, + "jinja2-time": { + "hashes": [ + "sha256:d3eab6605e3ec8b7a0863df09cc1d23714908fa61aa6986a845c20ba488b4efa", + "sha256:d14eaa4d315e7688daa4969f616f226614350c48730bfa1692d2caebd8c90d40" + ], + "version": "==0.2.0" + }, + "markupsafe": { + "hashes": [ + "sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665" + ], + "version": "==1.0" + }, + "marshmallow": { + "hashes": [ + "sha256:f16c8959ee7a1dbdb794d2bc171aeb2c3d6105a32318b5128e95ae538dca395b", + "sha256:2f72131c0d01079b2f306d0ffe1e59b2ef42a3b247f8d87a283a2abb67fb1911" + ], + "version": "==2.13.5" + }, + "mccabe": { + "hashes": [ + "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", + "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" + ], + "version": "==0.6.1" + }, + "molecule": { + "hashes": [ + "sha256:a5bbb6fbe91e1177a2ab99c13f40ffea8bc62de17e2f04b36f766a9ff46247a3", + "sha256:b527b52f8d7f8fc743a75be1e210f368678fd4e04a90be91fa985fc602668717" + ], + "version": "==2.8.2" + }, + "monotonic": { + "hashes": [ + "sha256:0bcd2b14e3b7ee7cfde796e408176ceffa01d89646f2e532964ef2aae0c9fa3e", + "sha256:a02611d5b518cd4051bf22d21bd0ae55b3a03f2d2993a19b6c90d9d168691f84" + ], + "version": "==1.4" + }, + "paramiko": { + "hashes": [ + "sha256:8851e728e8b7590989e68e3936c48ee3ca4dad91d29e3d7ff0305b6c5fc582db", + "sha256:486f637f0a33a4792e0e567be37426c287efaa8c4c4a45e3216f9ce7fd70b1fc" + ], + "version": "==2.4.0" + }, + "pathspec": { + "hashes": [ + "sha256:72c495d1bbe76674219e307f6d1c6062f2e1b0b483a5e4886435127d0df3d0d3" + ], + "version": "==0.5.5" + }, + "pbr": { + "hashes": [ + "sha256:dfc304262e881066bc675a59a348733af17bee1d57084d9e2a0c96b952a82db7", + "sha256:d7e8917458094002b9a2e0030ba60ba4c834c456071f2d0c1ccb5265992ada91" + ], + "version": "==3.0.1" + }, + "pexpect": { + "hashes": [ + "sha256:f853b52afaf3b064d29854771e2db509ef80392509bde2dd7a6ecf2dfc3f0018", + "sha256:3d132465a75b57aa818341c6521392a06cc660feb3988d7f1074f39bd23c9a92" + ], + "version": "==4.2.1" + }, + "pluggy": { + "hashes": [ + "sha256:7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff" + ], + "version": "==0.6.0" + }, + "poyo": { + "hashes": [ + "sha256:230ec11c2f35a23410c1f0e474f09fa4e203686f40ab3adca7b039c845d8c325", + "sha256:103b4ee3e1c7765098fe1cabe43f828db2e2a6079646561a2117e1a809f352d6" + ], + "version": "==0.4.1" + }, + "psutil": { + "hashes": [ + "sha256:db473f0d45a56d422502043f3755385fcfd83f5bb0947bc807fcad689230f37f", + "sha256:dcd9d3131f83480648da40d2c39403657c63a81e56e4e8d8e905bf65c133d59c", + "sha256:3f79a044db0aae96592ef42be459e37095d0c2cebcae4fd7baf486d37a85a8cd", + "sha256:838c66c123cb024bf8c8d2fec902b38c51f75b27988f4487d81383d1d3d8a8ce", + "sha256:a155875d2fedb614c2cd687fe47953d03a47f76eb39bd5756931b288b685655f", + "sha256:a989876ac0cc7942ef9481b96d3bfc02777dc798d4a7a1b4e8f0f284228f3434", + "sha256:32616c5736f1de446e77865305e7f56905c718991f820c8286436adea8192f32", + "sha256:50c8ddc3a6d1cda1de6d7aaf1af10896832c6d686fc7d0fe3d01c1eb51e6f521", + "sha256:e8b65a80e978af9bf10be423442155032c589b7042b4a26edc410dc36819d65e", + "sha256:7a5c0973bd4c1de98d9b225bd4303a0718d31e31d6e2342e825c3e656f7056df", + "sha256:44746540c0fab5b95401520d29eb9ffe84b3b4a235bd1d1971cbe36e1f38dd13", + "sha256:147093b75b8874e55e6b26c540544d40e98845bc4ee74dc6054c881fd2a3eed9", + "sha256:3d3c5c117e55c486a53ef796cc715035bf4f56419cc32dbd124fe26e9289ad1e", + "sha256:0c74c6a494b650966b88da256cab4e507f483c53e85b9b10d3ff9c38f059330b", + "sha256:b5583d1c2c858056d39bd148ed25839c4f1b76fec8fb2cb9b564c82997a21266", + "sha256:1da0aa70d66612588d77daed7784e623aac1fd038681c3acd0e1c76b2b2f0819", + "sha256:70732850abd11f4d9fa46f0e110af21030e0a6088204f332d335921b36e66305", + "sha256:5d2f076788d71d2e1c7276f1e5a1bc255f29c2e80eb8879a9ffc633c5bf69481", + "sha256:fecda42b274dc618278bd9139e8493c9459d2174376f82b65ba929557f10e880", + "sha256:92e3500dfaf7a5502ebaf4a7472e2afb9ff0cb36b4e5dc1977b3c774f58332db", + "sha256:ed09521d49ee177f1205ed9791ad62263feacd2fe1cc20d1d33cf37923f240ea" + ], + "version": "==5.2.2" + }, + "ptyprocess": { + "hashes": [ + "sha256:e8c43b5eee76b2083a9badde89fd1bbce6c8942d1045146e100b7b5e014f4f1a", + "sha256:e64193f0047ad603b71f202332ab5527c5e52aa7c8b609704fc28c0dc20c4365" + ], + "version": "==0.5.2" + }, + "py": { + "hashes": [ + "sha256:8cca5c229d225f8c1e3085be4fcf306090b00850fefad892f9d96c7b6e2f310f", + "sha256:ca18943e28235417756316bfada6cd96b23ce60dd532642690dcfdaba988a76d" + ], + "version": "==1.5.2" + }, + "pyasn1": { + "hashes": [ + "sha256:f81c96761fca60d64b1c9b79ec2e40cf9495a745cf570613079ef324aeb9672b", + "sha256:7d626683e3d792cccc608da02498aff37ab4f3dafd8905d6bf755d11f9b26b43", + "sha256:e85895087905c65b5b594eb91f7522664c85545b147d5f4d4e7b1b07da8dcbdc", + "sha256:5a0db897b311d265cde49615cf783f1c78613138605cdd0f907ecfa5b2aba3ee", + "sha256:d5cd6ed995dba16fad0c521cfe31cd2d68400b53fcc2bce93326829be73ab6d1", + "sha256:a7efe807c4b83a859e2735c692b92ed7b567cfddc4163763412920041d876c2b", + "sha256:b5a9ca48055b9a20f6d1b3d68e38692e5431c86a0f99ea602e61294e891fee5b", + "sha256:c07d6e587b2f928366b1f67c09bda026a3e6fcc99e80a744dc67f8fca3895626", + "sha256:d84c2aea3cf43780e9e6a19f4e4dddee9f6976519020e64e47c57e5c7a8c3dd2", + "sha256:758cb50abddc03e4563fd9e7f03db56e3e87b58c0bd01247360326e5c0c7ffa5", + "sha256:0d7f6e959fe53f3960a23d73f35e1fce61348b30915b6664309ca756de7c1f89", + "sha256:d258b0a71994f7770599835249cece1caef3c70def868c4915e6e5ca49b67d15" + ], + "version": "==0.4.2" + }, + "pycodestyle": { + "hashes": [ + "sha256:6c4245ade1edfad79c3446fadfc96b0de2759662dc29d07d80a6f27ad1ca6ba9", + "sha256:682256a5b318149ca0d2a9185d365d8864a768a28db66a84a2ea946bcc426766" + ], + "version": "==2.3.1" + }, + "pycparser": { + "hashes": [ + "sha256:99a8ca03e29851d96616ad0404b4aad7d9ee16f25c9f9708a11faf2810f7b226" + ], + "version": "==2.18" + }, + "pycrypto": { + "hashes": [ + "sha256:f2ce1e989b272cfcb677616763e0a2e7ec659effa67a88aa92b3a65528f60a3c" + ], + "version": "==2.6.1" + }, + "pyflakes": { + "hashes": [ + "sha256:cc5eadfb38041f8366128786b4ca12700ed05bbf1403d808e89d57d67a3875a7", + "sha256:aa0d4dff45c0cc2214ba158d29280f8fa1129f3e87858ef825930845146337f4" + ], + "version": "==1.5.0" + }, + "pynacl": { + "hashes": [ + "sha256:0bfa0d94d2be6874e40f896e0a67e290749151e7de767c5aefbad1121cad7512", + "sha256:1d33e775fab3f383167afb20b9927aaf4961b953d76eeb271a5703a6d756b65b", + "sha256:eb2acabbd487a46b38540a819ef67e477a674481f84a82a7ba2234b9ba46f752", + "sha256:14339dc233e7a9dda80a3800e64e7ff89d0878ba23360eea24f1af1b13772cac", + "sha256:cf6877124ae6a0698404e169b3ba534542cfbc43f939d46b927d956daf0a373a", + "sha256:eeee629828d0eb4f6d98ac41e9a3a6461d114d1d0aa111a8931c049359298da0", + "sha256:d0eb5b2795b7ee2cbcfcadacbe95a13afbda048a262bd369da9904fecb568975", + "sha256:11aa4e141b2456ce5cecc19c130e970793fa3a2c2e6fbb8ad65b28f35aa9e6b6", + "sha256:8ac1167195b32a8755de06efd5b2d2fe76fc864517dab66aaf65662cc59e1988", + "sha256:d795f506bcc9463efb5ebb0f65ed77921dcc9e0a50499dedd89f208445de9ecb", + "sha256:be71cd5fce04061e1f3d39597f93619c80cdd3558a6c9ba99a546f144a8d8101", + "sha256:2a42b2399d0428619e58dac7734838102d35f6dcdee149e0088823629bf99fbb", + "sha256:73a5a96fb5fbf2215beee2353a128d382dbca83f5341f0d3c750877a236569ef", + "sha256:d8aaf7e5d6b0e0ef7d6dbf7abeb75085713d0100b4eb1a4e4e857de76d77ac45", + "sha256:2dce05ac8b3c37b9e2f65eab56c544885607394753e9613fd159d5e2045c2d98", + "sha256:f5ce9e26d25eb0b2d96f3ef0ad70e1d3ae89b5d60255c462252a3e456a48c053", + "sha256:6453b0dae593163ffc6db6f9c9c1597d35c650598e2c39c0590d1757207a1ac2", + "sha256:fabf73d5d0286f9e078774f3435601d2735c94ce9e514ac4fb945701edead7e4", + "sha256:13bdc1fe084ff9ac7653ae5a924cae03bf4bb07c6667c9eb5b6eb3c570220776", + "sha256:8f505f42f659012794414fa57c498404e64db78f1d98dfd40e318c569f3c783b", + "sha256:04e30e5bdeeb2d5b34107f28cd2f5bbfdc6c616f3be88fc6f53582ff1669eeca", + "sha256:8abb4ef79161a5f58848b30ab6fb98d8c466da21fdd65558ce1d7afc02c70b5f", + "sha256:e0d38fa0a75f65f556fb912f2c6790d1fa29b7dd27a1d9cc5591b281321eaaa9" + ], + "version": "==1.2.1" + }, + "pytest": { + "hashes": [ + "sha256:95fa025cd6deb5d937e04e368a00552332b58cae23f63b76c8c540ff1733ab6d", + "sha256:6074ea3b9c999bd6d0df5fa9d12dd95ccd23550df2a582f5f5b848331d2e82ca" + ], + "version": "==3.4.0" + }, + "python-dateutil": { + "hashes": [ + "sha256:95511bae634d69bc7329ba55e646499a842bc4ec342ad54a8cdb65645a0aad3c", + "sha256:891c38b2a02f5bb1be3e4793866c8df49c7d19baabf9c1bad62547e0b4866aca" + ], + "version": "==2.6.1" + }, + "python-gilt": { + "hashes": [ + "sha256:ca6f4b9ff6819f1bc79181d06dd3f56c04ee1010271caf0f5b390957c6cde7f2", + "sha256:4b0f08d1dcbb72a7d5f652a32da293bfccaf338d61bd77f9e875388b3ccf604b", + "sha256:24e87871381a847a74e97516b605cde922e63a144d8bfa4343d2193b2e89cc9d" + ], + "version": "==1.1.0" + }, + "python-vagrant": { + "hashes": [ + "sha256:af9a8a9802d382d45dbea96aa3cfbe77c6e6ad65b3fe7b7c799d41ab988179c6" + ], + "version": "==0.5.15" + }, + "pyyaml": { + "hashes": [ + "sha256:3262c96a1ca437e7e4763e2843746588a965426550f3797a79fca9c6199c431f", + "sha256:16b20e970597e051997d90dc2cddc713a2876c47e3d92d59ee198700c5427736", + "sha256:e863072cdf4c72eebf179342c94e6989c67185842d9997960b3e69290b2fa269", + "sha256:bc6bced57f826ca7cb5125a10b23fd0f2fff3b7c4701d64c439a300ce665fff8", + "sha256:c01b880ec30b5a6e6aa67b09a2fe3fb30473008c85cd6a67359a1b15ed6d83a4", + "sha256:827dc04b8fa7d07c44de11fabbc888e627fa8293b695e0f99cb544fdfa1bf0d1", + "sha256:592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab", + "sha256:5f84523c076ad14ff5e6c037fe1c89a7f73a3e04cf0377cb4d017014976433f3", + "sha256:0c507b7f74b3d2dd4d1322ec8a94794927305ab4cebbe89cc47fe5e81541e6e8", + "sha256:b4c423ab23291d3945ac61346feeb9a0dc4184999ede5e7c43e1ffb975130ae6", + "sha256:ca233c64c6e40eaa6c66ef97058cdc80e8d0157a443655baa1b2966e812807ca", + "sha256:4474f8ea030b5127225b8894d626bb66c01cda098d47a2b0d3429b6700af9fd8", + "sha256:326420cbb492172dec84b0f65c80942de6cedb5233c413dd824483989c000608", + "sha256:5ac82e411044fb129bae5cfbeb3ba626acb2af31a8d17d175004b70862a741a7" + ], + "version": "==3.12" + }, + "requests": { + "hashes": [ + "sha256:6a1b267aa90cac58ac3a765d067950e7dbbf75b1da07e895d1f594193a40a38b", + "sha256:9c443e7324ba5b85070c4a818ade28bfabedf16ea10206da1132edaa6dda237e" + ], + "version": "==2.18.4" + }, + "sh": { + "hashes": [ + "sha256:ae3258c5249493cebe73cb4e18253a41ed69262484bad36fdb3efcb8ad8870bb", + "sha256:b52bf5833ed01c7b5c5fb73a7f71b3d98d48e9b9b8764236237bdc7ecae850fc" + ], + "version": "==1.12.14" + }, + "six": { + "hashes": [ + "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb", + "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9" + ], + "version": "==1.11.0" + }, + "tabulate": { + "hashes": [ + "sha256:1f07f6252b20cdc4ed744b598b5fa8362638988b50a62f3e2ad76c97fc02eef2", + "sha256:83a0b8e17c09f012090a50e1e97ae897300a72b35e0c86c0b53d3bd2ae86d8c6" + ], + "version": "==0.7.7" + }, + "testinfra": { + "hashes": [ + "sha256:87f22dbccf8f4b919974aba680b782afdb6a305ee53fbcdfa0a8bd494e75ca88", + "sha256:c44e6ff72b82457e63b60606707be008dc3107f40164130e365fc677ca3edc3f" + ], + "version": "==1.7.1" + }, + "tree-format": { + "hashes": [ + "sha256:b5056228dbedde1fb81b79f71fb0c23c98e9d365230df9b29af76e8d8003de11", + "sha256:a538523aa78ae7a4b10003b04f3e1b37708e0e089d99c9d3b9e1c71384c9a7f9" + ], + "version": "==0.1.2" + }, + "urllib3": { + "hashes": [ + "sha256:06330f386d6e4b195fbfc736b297f58c5a892e4440e54d294d7004e3a9bbea1b", + "sha256:cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f" + ], + "version": "==1.22" + }, + "websocket-client": { + "hashes": [ + "sha256:7a40abbd2534c91e667ca6507ccbb30d96816361840ef424dff49b24956fcdae", + "sha256:933f6bbf08b381f2adbca9e93d7e7958ba212b42c73acb310b18f0fbe74f3738" + ], + "version": "==0.46.0" + }, + "whichcraft": { + "hashes": [ + "sha256:cd0e10b58960ab877d9f273cd28788730936c3cdaceec2dafad97c7cf3067d46", + "sha256:9e0d51c9387cb7e9f28b7edb549e6a03da758f7784f991eb4397d7f7808c57fd" + ], + "version": "==0.4.1" + }, + "yamllint": { + "hashes": [ + "sha256:806b21828ca92fd6e9f20d8eccfa53035e38041854bb4d1b666f271a7788dbcf", + "sha256:048743567ca9511e19222233ebb53795586a2cede07b79e801577e0a9b4f173c" + ], + "version": "==1.8.1" + } + }, + "develop": {} +} From 46b6811200c3e85508634b71e3e6374a64b21da3 Mon Sep 17 00:00:00 2001 From: Andrey Gubarev Date: Thu, 15 Feb 2018 09:39:30 +0300 Subject: [PATCH 2/5] add molecule tests --- .gitignore | 4 ++ .yamllint | 13 ++++++ Pipfile.lock | 35 ++++++++------- defaults/main.yml | 14 +++--- molecule/default/Dockerfile.j2 | 9 ++++ molecule/default/INSTALL.rst | 16 +++++++ molecule/default/create.yml | 60 ++++++++++++++++++++++++++ molecule/default/destroy.yml | 27 ++++++++++++ molecule/default/molecule.yml | 20 +++++++++ molecule/default/playbook.yml | 5 +++ molecule/default/prepare.yml | 5 +++ molecule/default/tests/test_default.py | 14 ++++++ tasks/dnsmasq.yml | 4 +- tasks/main.yml | 19 +++++--- 14 files changed, 213 insertions(+), 32 deletions(-) create mode 100644 .gitignore create mode 100644 .yamllint create mode 100644 molecule/default/Dockerfile.j2 create mode 100644 molecule/default/INSTALL.rst create mode 100644 molecule/default/create.yml create mode 100644 molecule/default/destroy.yml create mode 100644 molecule/default/molecule.yml create mode 100644 molecule/default/playbook.yml create mode 100644 molecule/default/prepare.yml create mode 100644 molecule/default/tests/test_default.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fbe2095 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +molecule/default/.molecule/ +molecule/default/.cache/ +*.pyc +__pycache__ diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..3a2255e --- /dev/null +++ b/.yamllint @@ -0,0 +1,13 @@ +extends: default + +rules: + braces: + max-spaces-inside: 1 + level: error + brackets: + max-spaces-inside: 1 + level: error + line-length: disable + # NOTE(retr0h): Templates no longer fail this lint rule. + # Uncomment if running old Molecule templates. + # truthy: disable diff --git a/Pipfile.lock b/Pipfile.lock index 0a27280..248a1d4 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -9,9 +9,9 @@ "os_name": "posix", "platform_machine": "x86_64", "platform_python_implementation": "CPython", - "platform_release": "17.4.0", + "platform_release": "17.3.0", "platform_system": "Darwin", - "platform_version": "Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64", + "platform_version": "Darwin Kernel Version 17.3.0: Thu Nov 9 18:09:22 PST 2017; root:xnu-4570.31.3~1/RELEASE_X86_64", "python_full_version": "2.7.14", "python_version": "2.7", "sys_platform": "darwin" @@ -69,10 +69,10 @@ }, "backports.functools-lru-cache": { "hashes": [ - "sha256:f0b0e4eba956de51238e17573b7087e852dfe9854afd2e9c873f73fc0ca0a6dd", - "sha256:9d98697f088eb1b0fa451391f91afb5e3ebde16bbdb272819fd091151fda4f1a" + "sha256:4ba998e881f285c1d1b73f5b6e3766539b4e162320f9589334400c5ddc35198c", + "sha256:31f235852f88edc1558d428d890663c49eb4514ffec9f3650e7f3c9e4a12e36f" ], - "version": "==1.5" + "version": "==1.4" }, "backports.ssl-match-hostname": { "hashes": [ @@ -158,7 +158,6 @@ "sha256:87f837459c3c78d75cb4f5aadf08a7104db15e8c7618a5c732e60f252279c7a6", "sha256:df9083a992b17a28cd4251a3f5c879e0198bb26c9e808c4647e0a18739f1d11d" ], - "markers": "platform_python_implementation != 'PyPy'", "version": "==1.11.4" }, "chardet": { @@ -232,10 +231,10 @@ }, "docker": { "hashes": [ - "sha256:cdf9e280e423664660dea9b9fd7d8292059ce597ca7cc662d4601a6f0814c214", - "sha256:994e0ab827ff9b09ee4ee47ccbaec824eada0a7946fb082482895567aa2c79ae" + "sha256:c1d4e37b1ea03b2b6efdd0379640f6ea372fefe56efa65d4d17c34c6b9d54558", + "sha256:144248308e8ea31c4863c6d74e1b55daf97cc190b61d0fe7b7313ab920d6a76c" ], - "version": "==3.0.1" + "version": "==2.7.0" }, "docker-py": { "hashes": [ @@ -246,10 +245,10 @@ }, "docker-pycreds": { "hashes": [ - "sha256:408ae6ec2b97345e02cbb3a05e0055443a27969e5b61d6773c733b534a40845b", - "sha256:c7ab85de2894baff6ee8f15160cbbfa2fd3a04e56f0372c5793d24060687b299" + "sha256:58d2688f92de5d6f1a6ac4fe25da461232f0e0a4c1212b93b256b046b2d714a9", + "sha256:93833a2cf280b7d8abbe1b8121530413250c6cd4ffed2c1cf085f335262f7348" ], - "version": "==0.2.2" + "version": "==0.2.1" }, "enum": { "hashes": [ @@ -350,10 +349,10 @@ }, "molecule": { "hashes": [ - "sha256:a5bbb6fbe91e1177a2ab99c13f40ffea8bc62de17e2f04b36f766a9ff46247a3", - "sha256:b527b52f8d7f8fc743a75be1e210f368678fd4e04a90be91fa985fc602668717" + "sha256:c0384cca5c52ec32090b82bf38499ae86abd39d1f14222c11aae0f81fbcb985b", + "sha256:45978370691737056a6a43f67c18bab17ed41d6ebf99416d626e13ea93dde8a7" ], - "version": "==2.8.2" + "version": "==2.7.0" }, "monotonic": { "hashes": [ @@ -515,10 +514,10 @@ }, "pytest": { "hashes": [ - "sha256:95fa025cd6deb5d937e04e368a00552332b58cae23f63b76c8c540ff1733ab6d", - "sha256:6074ea3b9c999bd6d0df5fa9d12dd95ccd23550df2a582f5f5b848331d2e82ca" + "sha256:b84878865558194630c6147f44bdaef27222a9f153bbd4a08908b16bf285e0b1", + "sha256:53548280ede7818f4dc2ad96608b9f08ae2cc2ca3874f2ceb6f97e3583f25bc4" ], - "version": "==3.4.0" + "version": "==3.3.2" }, "python-dateutil": { "hashes": [ diff --git a/defaults/main.yml b/defaults/main.yml index 2b72e56..4b325c8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,8 +1,8 @@ --- consul_mode: "client" -consul_dnsmasq: yes -consul_service_enabled: no -consul_service_started: no +consul_dnsmasq: 'True' +consul_service_enabled: 'False' +consul_service_started: 'False' consul_src: https://releases.hashicorp.com/consul/0.9.3/consul_0.9.3_linux_amd64.zip consul_dest: /usr/local/bin @@ -17,7 +17,7 @@ consul_conf_client_addr: 0.0.0.0 consul_conf_bind_addr: 0.0.0.0 consul_conf_bootstrap_expect: 3 consul_conf_retry_join: ["provider=aws tag_key=Group tag_value=consul"] -consul_conf_enable_syslog: yes -consul_conf_leave_on_terminate: no -consul_conf_skip_leave_on_interrupt: yes -consul_conf_rejoin_after_leave: yes +consul_conf_enable_syslog: 'True' +consul_conf_leave_on_terminate: 'False' +consul_conf_skip_leave_on_interrupt: 'True' +consul_conf_rejoin_after_leave: 'True' diff --git a/molecule/default/Dockerfile.j2 b/molecule/default/Dockerfile.j2 new file mode 100644 index 0000000..f8b4e75 --- /dev/null +++ b/molecule/default/Dockerfile.j2 @@ -0,0 +1,9 @@ +# Molecule managed + +FROM {{ item.image }} + +RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get upgrade -y && apt-get install -y python sudo bash ca-certificates && apt-get clean; \ + elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python2-dnf bash && dnf clean all; \ + elif [ $(command -v yum) ]; then yum makecache fast && yum update -y && 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 update -y && 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; fi diff --git a/molecule/default/INSTALL.rst b/molecule/default/INSTALL.rst new file mode 100644 index 0000000..e26493b --- /dev/null +++ b/molecule/default/INSTALL.rst @@ -0,0 +1,16 @@ +******* +Install +******* + +Requirements +============ + +* Docker Engine +* docker-py + +Install +======= + +.. code-block:: bash + + $ sudo pip install docker-py diff --git a/molecule/default/create.yml b/molecule/default/create.yml new file mode 100644 index 0000000..10fac31 --- /dev/null +++ b/molecule/default/create.yml @@ -0,0 +1,60 @@ +--- +- name: Create + hosts: localhost + connection: local + gather_facts: false + no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}" + vars: + molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}" + molecule_ephemeral_directory: "{{ lookup('env', 'MOLECULE_EPHEMERAL_DIRECTORY') }}" + molecule_scenario_directory: "{{ lookup('env', 'MOLECULE_SCENARIO_DIRECTORY') }}" + molecule_yml: "{{ lookup('file', molecule_file) | molecule_from_yaml }}" + tasks: + - name: Create Dockerfiles from image names + template: + src: "{{ molecule_scenario_directory }}/Dockerfile.j2" + dest: "{{ molecule_ephemeral_directory }}/Dockerfile_{{ item.image | regex_replace('[^a-zA-Z0-9_]', '_') }}" + with_items: "{{ molecule_yml.platforms }}" + register: platforms + + - name: Discover local Docker images + docker_image_facts: + name: "molecule_local/{{ item.item.name }}" + with_items: "{{ platforms.results }}" + register: docker_images + + - name: Build an Ansible compatible image + docker_image: + path: "{{ molecule_ephemeral_directory }}" + name: "molecule_local/{{ item.item.image }}" + dockerfile: "{{ item.item.dockerfile | default(item.invocation.module_args.dest) }}" + force: "{{ item.item.force | default(true) }}" + with_items: "{{ platforms.results }}" + when: platforms.changed or docker_images.results | map(attribute='images') | select('equalto', []) | list | count >= 0 + + - name: Create molecule instance(s) + docker_container: + name: "{{ item.name }}" + hostname: "{{ item.name }}" + image: "molecule_local/{{ item.image }}" + state: started + recreate: false + log_driver: json-file + command: "{{ item.command | default('bash -c \"while true; do sleep 10000; done\"') }}" + privileged: "{{ item.privileged | default(omit) }}" + volumes: "{{ item.volumes | default(omit) }}" + capabilities: "{{ item.capabilities | default(omit) }}" + ports: "{{ item.exposed_ports | default(omit) }}" + ulimits: "{{ item.ulimits | default(omit) }}" + register: server + with_items: "{{ molecule_yml.platforms }}" + async: 7200 + poll: 0 + + - name: Wait for instance(s) creation to complete + async_status: + jid: "{{ item.ansible_job_id }}" + register: docker_jobs + until: docker_jobs.finished + retries: 300 + with_items: "{{ server.results }}" diff --git a/molecule/default/destroy.yml b/molecule/default/destroy.yml new file mode 100644 index 0000000..3ce7478 --- /dev/null +++ b/molecule/default/destroy.yml @@ -0,0 +1,27 @@ +--- +- name: Destroy + hosts: localhost + connection: local + gather_facts: false + no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}" + vars: + molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}" + molecule_yml: "{{ lookup('file', molecule_file) | molecule_from_yaml }}" + tasks: + - name: Destroy molecule instance(s) + docker_container: + name: "{{ item.name }}" + state: absent + force_kill: "{{ item.force_kill | default(true) }}" + register: server + with_items: "{{ molecule_yml.platforms }}" + async: 7200 + poll: 0 + + - name: Wait for instance(s) deletion to complete + async_status: + jid: "{{ item.ansible_job_id }}" + register: docker_jobs + until: docker_jobs.finished + retries: 300 + with_items: "{{ server.results }}" diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml new file mode 100644 index 0000000..443be06 --- /dev/null +++ b/molecule/default/molecule.yml @@ -0,0 +1,20 @@ +--- +dependency: + name: galaxy +driver: + name: docker +lint: + name: yamllint +platforms: + - name: instance + image: ubuntu:16.04 +provisioner: + name: ansible + lint: + name: ansible-lint +scenario: + name: default +verifier: + name: testinfra + lint: + name: flake8 diff --git a/molecule/default/playbook.yml b/molecule/default/playbook.yml new file mode 100644 index 0000000..f823940 --- /dev/null +++ b/molecule/default/playbook.yml @@ -0,0 +1,5 @@ +--- +- name: Converge + hosts: all + roles: + - role: ansible-role-consul diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml new file mode 100644 index 0000000..5358b3b --- /dev/null +++ b/molecule/default/prepare.yml @@ -0,0 +1,5 @@ +--- +- name: Prepare + hosts: all + gather_facts: false + tasks: [] diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py new file mode 100644 index 0000000..eedd64a --- /dev/null +++ b/molecule/default/tests/test_default.py @@ -0,0 +1,14 @@ +import os + +import testinfra.utils.ansible_runner + +testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( + os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') + + +def test_hosts_file(host): + f = host.file('/etc/hosts') + + assert f.exists + assert f.user == 'root' + assert f.group == 'root' diff --git a/tasks/dnsmasq.yml b/tasks/dnsmasq.yml index 0f5d039..2d69185 100644 --- a/tasks/dnsmasq.yml +++ b/tasks/dnsmasq.yml @@ -3,7 +3,7 @@ apt: name: dnsmasq state: present - update_cache: yes + update_cache: 'True' cache_valid_time: 3600 tags: - dnsmasq @@ -23,6 +23,6 @@ - name: enable dnsmasq service: name: dnsmasq - enabled: yes + enabled: 'True' tags: - dnsmasq diff --git a/tasks/main.yml b/tasks/main.yml index fd713ca..97238b4 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,9 +1,8 @@ --- - name: update apt-cache apt: - update_cache: yes + update_cache: 'True' cache_valid_time: 3600 - changed_when: no tags: - install @@ -22,7 +21,7 @@ src: "{{ consul_src }}" dest: "{{ consul_dest }}" mode: 0755 - remote_src: yes + remote_src: 'True' tags: - install @@ -56,7 +55,8 @@ tags: - install -- assert: +- name: assert consul mode + assert: that: - 'consul_mode in ("client", "server")' @@ -65,8 +65,17 @@ tags: - configuration -- set_fact: +- name: set datacenter to current region + set_fact: consul_datacenter: "{{ ansible_ec2_placement_region }}" + when: ansible_ec2_placement_region is defined + tags: + - configuration + +- name: set datacenter to default value + set_fact: + consul_datacenter: "{{ consul_conf_datacenter }}" + when: ansible_ec2_placement_region is undefined tags: - configuration From 15c159c354822e66c49db01b83d4c6379f7e0664 Mon Sep 17 00:00:00 2001 From: Andrey Gubarev Date: Thu, 15 Feb 2018 09:54:33 +0300 Subject: [PATCH 3/5] add ui config opt --- defaults/main.yml | 1 + handlers/main.yml | 1 + tasks/main.yml | 1 + templates/client.json.j2 | 1 + templates/server.json.j2 | 1 + 5 files changed, 5 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 4b325c8..24b9f53 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -17,6 +17,7 @@ consul_conf_client_addr: 0.0.0.0 consul_conf_bind_addr: 0.0.0.0 consul_conf_bootstrap_expect: 3 consul_conf_retry_join: ["provider=aws tag_key=Group tag_value=consul"] +consul_conf_ui: 'True' consul_conf_enable_syslog: 'True' consul_conf_leave_on_terminate: 'False' consul_conf_skip_leave_on_interrupt: 'True' diff --git a/handlers/main.yml b/handlers/main.yml index 08064c7..1dda921 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -3,3 +3,4 @@ service: name: dnsmasq state: restarted + when: lookup('env', 'MOLECULE_DRIVER_NAME') != 'docker' diff --git a/tasks/main.yml b/tasks/main.yml index 97238b4..f8c3fc4 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -111,6 +111,7 @@ service: name: consul enabled: "{{ consul_service_enabled }}" + when: lookup('env', 'MOLECULE_DRIVER_NAME') != 'docker' tags: - service diff --git a/templates/client.json.j2 b/templates/client.json.j2 index 5646218..d4cae14 100644 --- a/templates/client.json.j2 +++ b/templates/client.json.j2 @@ -1,5 +1,6 @@ { "server": false, + "ui": false, "data_dir": "{{ consul_data_dir }}", "pid_file": "{{ consul_data_dir }}/consul.pid", diff --git a/templates/server.json.j2 b/templates/server.json.j2 index 4e819ca..4ca2b90 100644 --- a/templates/server.json.j2 +++ b/templates/server.json.j2 @@ -1,5 +1,6 @@ { "server": true, + "ui": {{ consul_conf_ui | to_json }} "data_dir": "{{ consul_data_dir }}", "pid_file": "{{ consul_data_dir }}/consul.pid", From 714a47ea9d2be6f8559b30eb07fd9716c07844d2 Mon Sep 17 00:00:00 2001 From: Andrey Gubarev Date: Thu, 15 Feb 2018 10:11:21 +0300 Subject: [PATCH 4/5] drop truthy rule --- .yamllint | 4 +--- defaults/main.yml | 16 ++++++++-------- molecule/default/tests/test_default.py | 4 ++++ tasks/dnsmasq.yml | 4 ++-- tasks/main.yml | 4 ++-- templates/client.json.j2 | 8 ++++---- templates/server.json.j2 | 4 ++-- 7 files changed, 23 insertions(+), 21 deletions(-) diff --git a/.yamllint b/.yamllint index 3a2255e..ad0be76 100644 --- a/.yamllint +++ b/.yamllint @@ -8,6 +8,4 @@ rules: max-spaces-inside: 1 level: error line-length: disable - # NOTE(retr0h): Templates no longer fail this lint rule. - # Uncomment if running old Molecule templates. - # truthy: disable + truthy: disable diff --git a/defaults/main.yml b/defaults/main.yml index 24b9f53..702ffa2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,8 +1,8 @@ --- consul_mode: "client" -consul_dnsmasq: 'True' -consul_service_enabled: 'False' -consul_service_started: 'False' +consul_dnsmasq: yes +consul_service_enabled: no +consul_service_started: no consul_src: https://releases.hashicorp.com/consul/0.9.3/consul_0.9.3_linux_amd64.zip consul_dest: /usr/local/bin @@ -17,8 +17,8 @@ consul_conf_client_addr: 0.0.0.0 consul_conf_bind_addr: 0.0.0.0 consul_conf_bootstrap_expect: 3 consul_conf_retry_join: ["provider=aws tag_key=Group tag_value=consul"] -consul_conf_ui: 'True' -consul_conf_enable_syslog: 'True' -consul_conf_leave_on_terminate: 'False' -consul_conf_skip_leave_on_interrupt: 'True' -consul_conf_rejoin_after_leave: 'True' +consul_conf_ui: yes +consul_conf_enable_syslog: yes +consul_conf_leave_on_terminate: no +consul_conf_skip_leave_on_interrupt: yes +consul_conf_rejoin_after_leave: yes diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py index eedd64a..ed57429 100644 --- a/molecule/default/tests/test_default.py +++ b/molecule/default/tests/test_default.py @@ -12,3 +12,7 @@ def test_hosts_file(host): assert f.exists assert f.user == 'root' assert f.group == 'root' + + +def test_consul_configuration(host): + host.run_expect([0], 'consul validate /etc/consul.d') diff --git a/tasks/dnsmasq.yml b/tasks/dnsmasq.yml index 2d69185..0f5d039 100644 --- a/tasks/dnsmasq.yml +++ b/tasks/dnsmasq.yml @@ -3,7 +3,7 @@ apt: name: dnsmasq state: present - update_cache: 'True' + update_cache: yes cache_valid_time: 3600 tags: - dnsmasq @@ -23,6 +23,6 @@ - name: enable dnsmasq service: name: dnsmasq - enabled: 'True' + enabled: yes tags: - dnsmasq diff --git a/tasks/main.yml b/tasks/main.yml index f8c3fc4..ca6f184 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,7 @@ --- - name: update apt-cache apt: - update_cache: 'True' + update_cache: true cache_valid_time: 3600 tags: - install @@ -21,7 +21,7 @@ src: "{{ consul_src }}" dest: "{{ consul_dest }}" mode: 0755 - remote_src: 'True' + remote_src: true tags: - install diff --git a/templates/client.json.j2 b/templates/client.json.j2 index d4cae14..fb2f8e2 100644 --- a/templates/client.json.j2 +++ b/templates/client.json.j2 @@ -6,9 +6,9 @@ "pid_file": "{{ consul_data_dir }}/consul.pid", "datacenter": "{{ consul_datacenter }}", "retry_join": {{ consul_conf_retry_join | to_json }}, - "enable_syslog": {{ consul_conf_enable_syslog | to_json}}, + "enable_syslog": {{ consul_conf_enable_syslog | to_json }}, - "leave_on_terminate": {{ consul_conf_leave_on_terminate | to_json}}, - "skip_leave_on_interrupt": {{ consul_conf_skip_leave_on_interrupt | to_json}}, - "rejoin_after_leave": {{ consul_conf_rejoin_after_leave | to_json}} + "leave_on_terminate": {{ consul_conf_leave_on_terminate | to_json }}, + "skip_leave_on_interrupt": {{ consul_conf_skip_leave_on_interrupt | to_json }}, + "rejoin_after_leave": {{ consul_conf_rejoin_after_leave | to_json }} } diff --git a/templates/server.json.j2 b/templates/server.json.j2 index 4ca2b90..dce76f1 100644 --- a/templates/server.json.j2 +++ b/templates/server.json.j2 @@ -1,6 +1,6 @@ { "server": true, - "ui": {{ consul_conf_ui | to_json }} + "ui": {{ consul_conf_ui | to_json }}, "data_dir": "{{ consul_data_dir }}", "pid_file": "{{ consul_data_dir }}/consul.pid", @@ -14,5 +14,5 @@ "leave_on_terminate": {{ consul_conf_leave_on_terminate | to_json}}, "skip_leave_on_interrupt": {{ consul_conf_skip_leave_on_interrupt | to_json}}, - "rejoin_after_leave": {{ consul_conf_rejoin_after_leave | to_json}} + "rejoin_after_leave": {{ consul_conf_rejoin_after_leave | to_json }} } From d8eae04f1c0b69ca70d640d54fb310fd0f0c137b Mon Sep 17 00:00:00 2001 From: Andrey Gubarev Date: Thu, 15 Feb 2018 10:14:02 +0300 Subject: [PATCH 5/5] add handlers --- handlers/main.yml | 6 ++++++ tasks/dnsmasq.yml | 2 -- tasks/main.yml | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 1dda921..00ec3c2 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -4,3 +4,9 @@ name: dnsmasq state: restarted when: lookup('env', 'MOLECULE_DRIVER_NAME') != 'docker' + +- name: restart consul + service: + name: consul + state: restarted + when: lookup('env', 'MOLECULE_DRIVER_NAME') != 'docker' diff --git a/tasks/dnsmasq.yml b/tasks/dnsmasq.yml index 0f5d039..db22c10 100644 --- a/tasks/dnsmasq.yml +++ b/tasks/dnsmasq.yml @@ -3,8 +3,6 @@ apt: name: dnsmasq state: present - update_cache: yes - cache_valid_time: 3600 tags: - dnsmasq diff --git a/tasks/main.yml b/tasks/main.yml index ca6f184..c11f150 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -86,6 +86,7 @@ owner: root group: root mode: 0644 + notify: restart consul tags: - configuration