qb 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +12 -0
- data/.qb-options.yml +2 -0
- data/bin/qb +2 -0
- data/{scratch → dev/scratch}/case.rb +0 -0
- data/dev/setup.yml +4 -0
- data/exe/qb +65 -18
- data/lib/qb/version.rb +7 -1
- data/qb.gemspec +26 -1
- data/roles/nrser.blockinfile/CONTRIBUTING.md +19 -0
- data/roles/nrser.blockinfile/README.md +262 -0
- data/roles/nrser.blockinfile/library/blockinfile.py +354 -0
- data/roles/nrser.blockinfile/meta/main.yml +10 -0
- data/roles/nrser.blockinfile/tests/.gitignore +1 -0
- data/roles/nrser.blockinfile/tests/expected/test-basic/create.txt +5 -0
- data/roles/nrser.blockinfile/tests/expected/test-basic/insert.txt +6 -0
- data/roles/nrser.blockinfile/tests/expected/test-basic/marker.txt +5 -0
- data/roles/nrser.blockinfile/tests/expected/test-basic/remove.txt +2 -0
- data/roles/nrser.blockinfile/tests/expected/test-basic/update.txt +6 -0
- data/roles/nrser.blockinfile/tests/expected/test-block/block.txt +4 -0
- data/roles/nrser.blockinfile/tests/expected/test-block/content.txt +4 -0
- data/roles/nrser.blockinfile/tests/expected/test-follow/link0.txt +6 -0
- data/roles/nrser.blockinfile/tests/expected/test-follow/link1.txt +6 -0
- data/roles/nrser.blockinfile/tests/expected/test-follow/link2.txt +1 -0
- data/roles/nrser.blockinfile/tests/expected/test-follow/real0.txt +2 -0
- data/roles/nrser.blockinfile/tests/expected/test-follow/real1.txt +2 -0
- data/roles/nrser.blockinfile/tests/expected/test-follow/real2.txt +6 -0
- data/roles/nrser.blockinfile/tests/expected/test-insertab/insertafter.txt +8 -0
- data/roles/nrser.blockinfile/tests/expected/test-insertab/insertbefore.txt +8 -0
- data/roles/nrser.blockinfile/tests/expected/test-insertab/insertbof.txt +8 -0
- data/roles/nrser.blockinfile/tests/expected/test-insertab/inserteof.txt +8 -0
- data/roles/nrser.blockinfile/tests/expected/test-insertab/insertunmatched.txt +8 -0
- data/roles/nrser.blockinfile/tests/expected/test-insertab/updateafter.txt +8 -0
- data/roles/nrser.blockinfile/tests/expected/test-insertab/updatebefore.txt +8 -0
- data/roles/nrser.blockinfile/tests/expected/test-multiline/insert.txt +11 -0
- data/roles/nrser.blockinfile/tests/expected/test-multiline/remove.txt +2 -0
- data/roles/nrser.blockinfile/tests/expected/test-multiline/update.txt +12 -0
- data/roles/nrser.blockinfile/tests/expected/test-replace/index.html +6 -0
- data/roles/nrser.blockinfile/tests/expected/test-state/insert-present.txt +5 -0
- data/roles/nrser.blockinfile/tests/expected/test-state/insert.txt +5 -0
- data/roles/nrser.blockinfile/tests/expected/test-state/remove-absent.txt +2 -0
- data/roles/nrser.blockinfile/tests/expected/test-state/remove-present.txt +2 -0
- data/roles/nrser.blockinfile/tests/expected/test-state/remove.txt +2 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-basic/insert.txt +2 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-basic/marker.txt +1 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-basic/remove.txt +6 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-basic/update.txt +6 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-block/block.txt +1 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-block/content.txt +1 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-follow/link0.txt +1 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-follow/link1.txt +1 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-follow/link2.txt +1 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-follow/real0.txt +2 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-follow/real1.txt +2 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-follow/real2.txt +2 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-insertab/insertafter.txt +4 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-insertab/insertbefore.txt +4 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-insertab/insertbof.txt +4 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-insertab/inserteof.txt +4 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-insertab/insertunmatched.txt +4 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-insertab/updateafter.txt +8 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-insertab/updatebefore.txt +8 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-multiline/insert.txt +2 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-multiline/remove.txt +11 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-multiline/update.txt +12 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-replace/index.html +1 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-state/insert-present.txt +2 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-state/insert.txt +2 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-state/remove-absent.txt +6 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-state/remove-present.txt +6 -0
- data/roles/nrser.blockinfile/tests/fixtures/test-state/remove.txt +6 -0
- data/roles/nrser.blockinfile/tests/hosts +1 -0
- data/roles/nrser.blockinfile/tests/roles/yaegashi.blockinfile +1 -0
- data/roles/nrser.blockinfile/tests/run.sh +64 -0
- data/roles/nrser.blockinfile/tests/test-basic.yml +31 -0
- data/roles/nrser.blockinfile/tests/test-block.yml +16 -0
- data/roles/nrser.blockinfile/tests/test-follow.yml +21 -0
- data/roles/nrser.blockinfile/tests/test-insertab.yml +34 -0
- data/roles/nrser.blockinfile/tests/test-multiline.yml +51 -0
- data/roles/nrser.blockinfile/tests/test-replace.yml +21 -0
- data/roles/nrser.blockinfile/tests/test-state.yml +32 -0
- data/roles/nrser.rb/.gitignore +31 -0
- data/roles/nrser.rb/library/sync.rb +52 -0
- data/roles/nrser.rb/library/vars.rb +63 -0
- data/roles/{qb.meteor_react_component → nrser.rb}/meta/main.yml +1 -1
- data/roles/nrser.rbenv_gem/README.md +38 -0
- data/roles/nrser.rbenv_gem/VERSION +1 -0
- data/roles/nrser.rbenv_gem/defaults/main.yml +5 -0
- data/roles/nrser.rbenv_gem/handlers/main.yml +2 -0
- data/roles/nrser.rbenv_gem/meta/main.yml +9 -0
- data/roles/nrser.rbenv_gem/tasks/clone-repo.yml +24 -0
- data/roles/nrser.rbenv_gem/tasks/main.yml +46 -0
- data/roles/nrser.rbenv_gem/tasks/manage-source.yml +48 -0
- data/roles/nrser.rbenv_gem/tasks/manage-version.yml +45 -0
- data/roles/nrser.rbenv_gem/vars/main.yml +2 -0
- data/roles/qb.build_gem/tasks/main.yml +2 -1
- data/roles/qb.gitignore/defaults/main.yml +1 -1
- data/roles/qb.gitignore/files/gitignore/.github/PULL_REQUEST_TEMPLATE.md +11 -0
- data/roles/qb.gitignore/files/gitignore/Actionscript.gitignore +11 -0
- data/roles/qb.gitignore/files/gitignore/Ada.gitignore +5 -0
- data/roles/qb.gitignore/files/gitignore/Agda.gitignore +1 -0
- data/roles/qb.gitignore/files/gitignore/Android.gitignore +39 -0
- data/roles/qb.gitignore/files/gitignore/AppEngine.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/AppceleratorTitanium.gitignore +3 -0
- data/roles/qb.gitignore/files/gitignore/ArchLinuxPackages.gitignore +13 -0
- data/roles/qb.gitignore/files/gitignore/Autotools.gitignore +18 -0
- data/roles/qb.gitignore/files/gitignore/C++.gitignore +28 -0
- data/roles/qb.gitignore/files/gitignore/C.gitignore +32 -0
- data/roles/qb.gitignore/files/gitignore/CFWheels.gitignore +12 -0
- data/roles/qb.gitignore/files/gitignore/CMake.gitignore +6 -0
- data/roles/qb.gitignore/files/gitignore/CONTRIBUTING.md +34 -0
- data/roles/qb.gitignore/files/gitignore/CUDA.gitignore +6 -0
- data/roles/qb.gitignore/files/gitignore/CakePHP.gitignore +25 -0
- data/roles/qb.gitignore/files/gitignore/ChefCookbook.gitignore +9 -0
- data/roles/qb.gitignore/files/gitignore/Clojure.gitignore +1 -0
- data/roles/qb.gitignore/files/gitignore/CodeIgniter.gitignore +6 -0
- data/roles/qb.gitignore/files/gitignore/CommonLisp.gitignore +3 -0
- data/roles/qb.gitignore/files/gitignore/Composer.gitignore +6 -0
- data/roles/qb.gitignore/files/gitignore/Concrete5.gitignore +4 -0
- data/roles/qb.gitignore/files/gitignore/Coq.gitignore +3 -0
- data/roles/qb.gitignore/files/gitignore/CraftCMS.gitignore +3 -0
- data/roles/qb.gitignore/files/gitignore/D.gitignore +20 -0
- data/roles/qb.gitignore/files/gitignore/DM.gitignore +5 -0
- data/roles/qb.gitignore/files/gitignore/Dart.gitignore +27 -0
- data/roles/qb.gitignore/files/gitignore/Delphi.gitignore +66 -0
- data/roles/qb.gitignore/files/gitignore/Drupal.gitignore +36 -0
- data/roles/qb.gitignore/files/gitignore/EPiServer.gitignore +4 -0
- data/roles/qb.gitignore/files/gitignore/Eagle.gitignore +44 -0
- data/roles/qb.gitignore/files/gitignore/Elisp.gitignore +5 -0
- data/roles/qb.gitignore/files/gitignore/Elixir.gitignore +5 -0
- data/roles/qb.gitignore/files/gitignore/Elm.gitignore +4 -0
- data/roles/qb.gitignore/files/gitignore/Erlang.gitignore +10 -0
- data/roles/qb.gitignore/files/gitignore/ExpressionEngine.gitignore +19 -0
- data/roles/qb.gitignore/files/gitignore/ExtJs.gitignore +4 -0
- data/roles/qb.gitignore/files/gitignore/Fancy.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/Finale.gitignore +13 -0
- data/roles/qb.gitignore/files/gitignore/ForceDotCom.gitignore +4 -0
- data/roles/qb.gitignore/files/gitignore/Fortran.gitignore +1 -0
- data/roles/qb.gitignore/files/gitignore/FuelPHP.gitignore +21 -0
- data/roles/qb.gitignore/files/gitignore/GWT.gitignore +28 -0
- data/roles/qb.gitignore/files/gitignore/Gcov.gitignore +5 -0
- data/roles/qb.gitignore/files/gitignore/Gem.gitignore +3 -0
- data/roles/qb.gitignore/files/gitignore/GitBook.gitignore +16 -0
- data/roles/qb.gitignore/files/gitignore/Global/Anjuta.gitignore +3 -0
- data/roles/qb.gitignore/files/gitignore/Global/Archives.gitignore +27 -0
- data/roles/qb.gitignore/files/gitignore/Global/BricxCC.gitignore +4 -0
- data/roles/qb.gitignore/files/gitignore/Global/CVS.gitignore +4 -0
- data/roles/qb.gitignore/files/gitignore/Global/Calabash.gitignore +10 -0
- data/roles/qb.gitignore/files/gitignore/Global/Cloud9.gitignore +3 -0
- data/roles/qb.gitignore/files/gitignore/Global/CodeKit.gitignore +3 -0
- data/roles/qb.gitignore/files/gitignore/Global/DartEditor.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/Global/Dreamweaver.gitignore +7 -0
- data/roles/qb.gitignore/files/gitignore/Global/Dropbox.gitignore +4 -0
- data/roles/qb.gitignore/files/gitignore/Global/Eclipse.gitignore +51 -0
- data/roles/qb.gitignore/files/gitignore/Global/EiffelStudio.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/Global/Emacs.gitignore +41 -0
- data/roles/qb.gitignore/files/gitignore/Global/Ensime.gitignore +4 -0
- data/roles/qb.gitignore/files/gitignore/Global/Espresso.gitignore +1 -0
- data/roles/qb.gitignore/files/gitignore/Global/FlexBuilder.gitignore +3 -0
- data/roles/qb.gitignore/files/gitignore/Global/GPG.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/Global/IPythonNotebook.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/Global/JDeveloper.gitignore +13 -0
- data/roles/qb.gitignore/files/gitignore/Global/JetBrains.gitignore +44 -0
- data/roles/qb.gitignore/files/gitignore/Global/KDevelop4.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/Global/Kate.gitignore +3 -0
- data/roles/qb.gitignore/files/gitignore/Global/Lazarus.gitignore +30 -0
- data/roles/qb.gitignore/files/gitignore/Global/LibreOffice.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/Global/Linux.gitignore +10 -0
- data/roles/qb.gitignore/files/gitignore/Global/LyX.gitignore +4 -0
- data/roles/qb.gitignore/files/gitignore/Global/Matlab.gitignore +19 -0
- data/roles/qb.gitignore/files/gitignore/Global/Mercurial.gitignore +6 -0
- data/roles/qb.gitignore/files/gitignore/Global/MicrosoftOffice.gitignore +13 -0
- data/roles/qb.gitignore/files/gitignore/Global/ModelSim.gitignore +23 -0
- data/roles/qb.gitignore/files/gitignore/Global/Momentics.gitignore +8 -0
- data/roles/qb.gitignore/files/gitignore/Global/MonoDevelop.gitignore +8 -0
- data/roles/qb.gitignore/files/gitignore/Global/NetBeans.gitignore +7 -0
- data/roles/qb.gitignore/files/gitignore/Global/Ninja.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/Global/NotepadPP.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/Global/OSX.gitignore +24 -0
- data/roles/qb.gitignore/files/gitignore/Global/Otto.gitignore +1 -0
- data/roles/qb.gitignore/files/gitignore/Global/README.md +10 -0
- data/roles/qb.gitignore/files/gitignore/Global/Redcar.gitignore +1 -0
- data/roles/qb.gitignore/files/gitignore/Global/Redis.gitignore +3 -0
- data/roles/qb.gitignore/files/gitignore/Global/SBT.gitignore +9 -0
- data/roles/qb.gitignore/files/gitignore/Global/SVN.gitignore +1 -0
- data/roles/qb.gitignore/files/gitignore/Global/SlickEdit.gitignore +11 -0
- data/roles/qb.gitignore/files/gitignore/Global/SublimeText.gitignore +14 -0
- data/roles/qb.gitignore/files/gitignore/Global/SynopsysVCS.gitignore +36 -0
- data/roles/qb.gitignore/files/gitignore/Global/Tags.gitignore +16 -0
- data/roles/qb.gitignore/files/gitignore/Global/TextMate.gitignore +3 -0
- data/roles/qb.gitignore/files/gitignore/Global/TortoiseGit.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/Global/Vagrant.gitignore +1 -0
- data/roles/qb.gitignore/files/gitignore/Global/Vim.gitignore +10 -0
- data/roles/qb.gitignore/files/gitignore/Global/VirtualEnv.gitignore +12 -0
- data/roles/qb.gitignore/files/gitignore/Global/VisualStudioCode.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/Global/WebMethods.gitignore +14 -0
- data/roles/qb.gitignore/files/gitignore/Global/Windows.gitignore +18 -0
- data/roles/qb.gitignore/files/gitignore/Global/Xcode.gitignore +23 -0
- data/roles/qb.gitignore/files/gitignore/Global/XilinxISE.gitignore +67 -0
- data/roles/qb.gitignore/files/gitignore/Go.gitignore +24 -0
- data/roles/qb.gitignore/files/gitignore/Gradle.gitignore +14 -0
- data/roles/qb.gitignore/files/gitignore/Grails.gitignore +33 -0
- data/roles/qb.gitignore/files/gitignore/Haskell.gitignore +17 -0
- data/roles/qb.gitignore/files/gitignore/IGORPro.gitignore +5 -0
- data/roles/qb.gitignore/files/gitignore/Idris.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/Java.gitignore +12 -0
- data/roles/qb.gitignore/files/gitignore/Jboss.gitignore +19 -0
- data/roles/qb.gitignore/files/gitignore/Jekyll.gitignore +3 -0
- data/roles/qb.gitignore/files/gitignore/Joomla.gitignore +546 -0
- data/roles/qb.gitignore/files/gitignore/KiCad.gitignore +20 -0
- data/roles/qb.gitignore/files/gitignore/Kohana.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/LICENSE +19 -0
- data/roles/qb.gitignore/files/gitignore/LabVIEW.gitignore +16 -0
- data/roles/qb.gitignore/files/gitignore/Laravel.gitignore +16 -0
- data/roles/qb.gitignore/files/gitignore/Leiningen.gitignore +12 -0
- data/roles/qb.gitignore/files/gitignore/LemonStand.gitignore +21 -0
- data/roles/qb.gitignore/files/gitignore/Lilypond.gitignore +6 -0
- data/roles/qb.gitignore/files/gitignore/Lithium.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/Lua.gitignore +41 -0
- data/roles/qb.gitignore/files/gitignore/Magento.gitignore +104 -0
- data/roles/qb.gitignore/files/gitignore/Maven.gitignore +9 -0
- data/roles/qb.gitignore/files/gitignore/Mercury.gitignore +13 -0
- data/roles/qb.gitignore/files/gitignore/MetaProgrammingSystem.gitignore +16 -0
- data/roles/qb.gitignore/files/gitignore/Nanoc.gitignore +10 -0
- data/roles/qb.gitignore/files/gitignore/Nim.gitignore +1 -0
- data/roles/qb.gitignore/files/gitignore/Node.gitignore +34 -0
- data/roles/qb.gitignore/files/gitignore/OCaml.gitignore +20 -0
- data/roles/qb.gitignore/files/gitignore/Objective-C.gitignore +51 -0
- data/roles/qb.gitignore/files/gitignore/Opa.gitignore +13 -0
- data/roles/qb.gitignore/files/gitignore/OpenCart.gitignore +13 -0
- data/roles/qb.gitignore/files/gitignore/OracleForms.gitignore +8 -0
- data/roles/qb.gitignore/files/gitignore/Packer.gitignore +5 -0
- data/roles/qb.gitignore/files/gitignore/Perl.gitignore +20 -0
- data/roles/qb.gitignore/files/gitignore/Phalcon.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/PlayFramework.gitignore +15 -0
- data/roles/qb.gitignore/files/gitignore/Plone.gitignore +18 -0
- data/roles/qb.gitignore/files/gitignore/Prestashop.gitignore +32 -0
- data/roles/qb.gitignore/files/gitignore/Processing.gitignore +7 -0
- data/roles/qb.gitignore/files/gitignore/Python.gitignore +85 -0
- data/roles/qb.gitignore/files/gitignore/Qooxdoo.gitignore +5 -0
- data/roles/qb.gitignore/files/gitignore/Qt.gitignore +38 -0
- data/roles/qb.gitignore/files/gitignore/R.gitignore +25 -0
- data/roles/qb.gitignore/files/gitignore/README.md +79 -0
- data/roles/qb.gitignore/files/gitignore/ROS.gitignore +47 -0
- data/roles/qb.gitignore/files/gitignore/Rails.gitignore +38 -0
- data/roles/qb.gitignore/files/gitignore/RhodesRhomobile.gitignore +9 -0
- data/roles/qb.gitignore/files/gitignore/Ruby.gitignore +47 -0
- data/roles/qb.gitignore/files/gitignore/Rust.gitignore +15 -0
- data/roles/qb.gitignore/files/gitignore/SCons.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/Sass.gitignore +2 -0
- data/roles/qb.gitignore/files/gitignore/Scala.gitignore +17 -0
- data/roles/qb.gitignore/files/gitignore/Scheme.gitignore +7 -0
- data/roles/qb.gitignore/files/gitignore/Scrivener.gitignore +7 -0
- data/roles/qb.gitignore/files/gitignore/Sdcc.gitignore +8 -0
- data/roles/qb.gitignore/files/gitignore/SeamGen.gitignore +26 -0
- data/roles/qb.gitignore/files/gitignore/SketchUp.gitignore +1 -0
- data/roles/qb.gitignore/files/gitignore/Smalltalk.gitignore +18 -0
- data/roles/qb.gitignore/files/gitignore/Stella.gitignore +12 -0
- data/roles/qb.gitignore/files/gitignore/SugarCRM.gitignore +25 -0
- data/roles/qb.gitignore/files/gitignore/Swift.gitignore +63 -0
- data/roles/qb.gitignore/files/gitignore/Symfony.gitignore +43 -0
- data/roles/qb.gitignore/files/gitignore/SymphonyCMS.gitignore +6 -0
- data/roles/qb.gitignore/files/gitignore/TeX.gitignore +177 -0
- data/roles/qb.gitignore/files/gitignore/Terraform.gitignore +3 -0
- data/roles/qb.gitignore/files/gitignore/Textpattern.gitignore +11 -0
- data/roles/qb.gitignore/files/gitignore/TurboGears2.gitignore +20 -0
- data/roles/qb.gitignore/files/gitignore/Typo3.gitignore +20 -0
- data/roles/qb.gitignore/files/gitignore/Umbraco.gitignore +19 -0
- data/roles/qb.gitignore/files/gitignore/Unity.gitignore +30 -0
- data/roles/qb.gitignore/files/gitignore/UnrealEngine.gitignore +59 -0
- data/roles/qb.gitignore/files/gitignore/VVVV.gitignore +6 -0
- data/roles/qb.gitignore/files/gitignore/VisualStudio.gitignore +245 -0
- data/roles/qb.gitignore/files/gitignore/Waf.gitignore +4 -0
- data/roles/qb.gitignore/files/gitignore/WordPress.gitignore +18 -0
- data/roles/qb.gitignore/files/gitignore/Xojo.gitignore +11 -0
- data/roles/qb.gitignore/files/gitignore/Yeoman.gitignore +6 -0
- data/roles/qb.gitignore/files/gitignore/Yii.gitignore +6 -0
- data/roles/qb.gitignore/files/gitignore/ZendFramework.gitignore +25 -0
- data/roles/qb.gitignore/files/gitignore/Zephir.gitignore +26 -0
- data/roles/qb.gitignore/meta/qb +28 -0
- data/roles/qb.gitignore/tasks/main.yml +4 -15
- data/roles/qb.install_gem/meta/qb.yml +4 -0
- data/roles/qb.project/defaults/main.yml +3 -2
- data/roles/qb.project/files/ansible.cfg +3 -1
- data/roles/qb.project/meta/main.yml +1 -0
- data/roles/qb.project/meta/qb.yml +10 -2
- data/roles/qb.project/tasks/dev.yml +36 -0
- data/roles/qb.project/tasks/main.yml +9 -29
- data/roles/qb.project/tasks/setup.yml +24 -23
- data/roles/qb.project/templates/bootstrap.yml.j2 +20 -0
- data/roles/qb.project/templates/setup.yml.j2 +3 -1
- data/roles/qb.release_gem/defaults/main.yml +2 -0
- data/roles/qb.release_gem/meta/main.yml +7 -0
- data/roles/qb.release_gem/meta/qb.yml +21 -0
- data/roles/qb.release_gem/tasks/main.yml +84 -0
- metadata +280 -15
- data/requirements.yml +0 -7
- data/roles/qb.gitignore/.qb-options.yml +0 -3
- data/roles/qb.gitignore/meta/qb.yml +0 -8
- data/roles/qb.gitignore/vars/main.yml +0 -3
- data/roles/qb.meteor_react_component/defaults/main.yml +0 -8
- data/roles/qb.meteor_react_component/meta/qb.yml +0 -68
- data/roles/qb.meteor_react_component/tasks/main.yml +0 -44
- data/roles/qb.meteor_react_component/templates/component.jsx.j2 +0 -75
- data/roles/qb.meteor_react_component/templates/style.import.less.j2 +0 -4
- data/roles/qb.project/files/requirements.yml +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b467ba91d8b3b0749fc18e96dd7ef662e7e5b4ba
|
4
|
+
data.tar.gz: a1f902cab87c9bf6f3da4987229ece3938dcc2ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a8bf457e98e65e95dc121bd64e202a90e29991f3576686ec25d8426ccaaaf3d2e3ebcb3af4230a14de1f883678ba99571b39e381eb20a9652196b508d932141
|
7
|
+
data.tar.gz: 3b6a1a2a5773d60d0e3a16d87325a627ebf8138521bc5e4f5a99306aa1a0d818148621c985e03237b3fc7a798adef03769f63edba5c0a9a0a0be230d774ff261
|
data/.gitmodules
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
[submodule "roles/nrser.blockinfile"]
|
2
|
+
path = roles/nrser.blockinfile
|
3
|
+
url = git@github.com:nrser/ansible-role-blockinfile
|
4
|
+
[submodule "roles/nrser.rbenv_gem"]
|
5
|
+
path = roles/nrser.rbenv_gem
|
6
|
+
url = git@github.com:nrser/ansible-nrser.rbenv_gem.git
|
7
|
+
[submodule "roles/qb.gitignore/files/gitignore"]
|
8
|
+
path = roles/qb.gitignore/files/gitignore
|
9
|
+
url = git@github.com:nrser/gitignore.git
|
10
|
+
[submodule "roles/nrser.rb"]
|
11
|
+
path = roles/nrser.rb
|
12
|
+
url = git@github.com:nrser/ansible-nrser.rb.git
|
data/.qb-options.yml
CHANGED
data/bin/qb
CHANGED
File without changes
|
data/dev/setup.yml
CHANGED
data/exe/qb
CHANGED
@@ -17,7 +17,7 @@ require 'qb'
|
|
17
17
|
ROOT = QB::ROOT
|
18
18
|
ROLES_DIR = QB::ROLES_DIR
|
19
19
|
ROLES = Pathname.glob(ROLES_DIR + 'qb.*').map {|path| path.basename.to_s}
|
20
|
-
DEBUG_ARGS = ['-
|
20
|
+
DEBUG_ARGS = ['-D', '--debug']
|
21
21
|
TMP_DIR = ROOT + 'tmp'
|
22
22
|
|
23
23
|
# globals
|
@@ -38,7 +38,8 @@ def format msg, dump = {}
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def role? pathname
|
41
|
-
pathname.directory? &&
|
41
|
+
pathname.directory? &&
|
42
|
+
['qb.yml', 'qb'].any? {|fn| pathname.join('meta', fn).file?}
|
42
43
|
end
|
43
44
|
|
44
45
|
def role_matches
|
@@ -57,7 +58,7 @@ def set_debug! args
|
|
57
58
|
end
|
58
59
|
end
|
59
60
|
|
60
|
-
def parse!
|
61
|
+
def parse! role, var_prefix, vars, defaults, args
|
61
62
|
positional = vars.select do |var|
|
62
63
|
var['positional'] == true
|
63
64
|
end
|
@@ -73,8 +74,8 @@ def parse! role_arg, var_prefix, vars, defaults, args
|
|
73
74
|
options = {}
|
74
75
|
|
75
76
|
opt_parser = OptionParser.new do |opts|
|
76
|
-
# opts.banner = "qb #{
|
77
|
-
opts.banner = "qb #{
|
77
|
+
# opts.banner = "qb #{ role.name } [OPTIONS]#{ positional_banner }"
|
78
|
+
opts.banner = "qb #{ role.name } [OPTIONS] DIRECTORY"
|
78
79
|
|
79
80
|
vars.each do |var|
|
80
81
|
arg_name = var.fetch 'name'
|
@@ -96,6 +97,21 @@ def parse! role_arg, var_prefix, vars, defaults, args
|
|
96
97
|
ruby_type = case var['type']
|
97
98
|
when 'string'
|
98
99
|
String
|
100
|
+
when Hash
|
101
|
+
if var['type'].key? 'one_of'
|
102
|
+
klass = Class.new
|
103
|
+
opts.accept(klass) {|value|
|
104
|
+
if var['type']['one_of'].include? value
|
105
|
+
value
|
106
|
+
else
|
107
|
+
raise ArgumentError, "argument '#{ var['name'] }' must be " +
|
108
|
+
"one of: #{ var['type']['one_of'].join(', ') }"
|
109
|
+
end
|
110
|
+
}
|
111
|
+
klass
|
112
|
+
else
|
113
|
+
raise ArgumentError, "bad type: #{ var['type'].inspect }"
|
114
|
+
end
|
99
115
|
else
|
100
116
|
raise ArgumentError, "bad type: #{ var['type'].inspect }"
|
101
117
|
end
|
@@ -110,14 +126,30 @@ def parse! role_arg, var_prefix, vars, defaults, args
|
|
110
126
|
end
|
111
127
|
|
112
128
|
# description
|
113
|
-
if var.key? 'description'
|
114
|
-
|
129
|
+
description = if var.key? 'description'
|
130
|
+
var['description']
|
115
131
|
else
|
116
|
-
|
132
|
+
"set the #{ var_name } variable"
|
117
133
|
end
|
118
134
|
|
135
|
+
if var['type'].is_a?(Hash) && var['type'].key?('one_of')
|
136
|
+
lb = "\n" + "\t" * 5
|
137
|
+
description += " options:" +
|
138
|
+
"#{ lb }#{ var['type']['one_of'].join(lb) }"
|
139
|
+
end
|
140
|
+
|
141
|
+
on_args << description
|
142
|
+
|
119
143
|
if defaults.key? var_name
|
120
|
-
on_args <<
|
144
|
+
on_args << if var['type'] == 'boolean'
|
145
|
+
if defaults[var_name]
|
146
|
+
"default --#{ var['name'] }"
|
147
|
+
else
|
148
|
+
"default --no-#{ var['name'] }"
|
149
|
+
end
|
150
|
+
else
|
151
|
+
"default = #{ defaults[var_name] }"
|
152
|
+
end
|
121
153
|
end
|
122
154
|
|
123
155
|
debug "adding option", name: arg_name, on_args: on_args
|
@@ -158,9 +190,18 @@ def with_clean_env &block
|
|
158
190
|
end
|
159
191
|
end
|
160
192
|
|
193
|
+
def metadata
|
194
|
+
if QB.gemspec.metadata
|
195
|
+
"metadata:\n" + QB.gemspec.metadata.map {|key, value|
|
196
|
+
" #{ key }: #{ value }"
|
197
|
+
}.join("\n")
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
161
201
|
def help
|
162
202
|
puts <<-END
|
163
203
|
version: #{ QB::VERSION }
|
204
|
+
#{ metadata }
|
164
205
|
|
165
206
|
syntax:
|
166
207
|
|
@@ -209,12 +250,18 @@ def main args
|
|
209
250
|
{}
|
210
251
|
end
|
211
252
|
|
212
|
-
qb_meta =
|
253
|
+
qb_meta = if (role.path + 'meta' + 'qb').exist?
|
254
|
+
YAML.load Cmds.out! (role.path + 'meta' + 'qb').realpath.to_s
|
255
|
+
elsif (role.path + 'meta' + 'qb.yml').exist?
|
256
|
+
YAML.load (role.path + 'meta' + 'qb.yml').read
|
257
|
+
else
|
258
|
+
{}
|
259
|
+
end
|
213
260
|
|
214
261
|
vars = qb_meta['vars'] || []
|
215
262
|
var_prefix = qb_meta['var_prefix'] || role.namespaceless
|
216
263
|
|
217
|
-
options = parse!
|
264
|
+
options = parse! role, var_prefix, vars, defaults, args
|
218
265
|
|
219
266
|
debug options: options
|
220
267
|
|
@@ -313,13 +360,13 @@ def main args
|
|
313
360
|
|
314
361
|
Dir.chdir ROOT do
|
315
362
|
# install requirements
|
316
|
-
unless (TMP_DIR + 'roles').directory?
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
end
|
363
|
+
# unless (TMP_DIR + 'roles').directory?
|
364
|
+
# with_clean_env do
|
365
|
+
# Cmds.stream! "ANSIBLE_ROLES_PATH=<%= roles_path %> ansible-galaxy install --ignore-errors -r <%= req_path%>",
|
366
|
+
# req_path: (ROOT + 'requirements.yml'),
|
367
|
+
# roles_path: tmp_roles_path.to_s
|
368
|
+
# end
|
369
|
+
# end
|
323
370
|
with_clean_env do
|
324
371
|
Cmds.stream! "ANSIBLE_ROLES_PATH=<%= roles_path %> ansible-playbook <%= playbook_path %>",
|
325
372
|
roles_path: ansible_roles_path,
|
data/lib/qb/version.rb
CHANGED
data/qb.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'qb/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = QB::GEM_NAME
|
8
8
|
spec.version = QB::VERSION
|
9
9
|
spec.authors = ["nrser"]
|
10
10
|
spec.email = ["neil@ztkae.com"]
|
@@ -15,6 +15,20 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
|
19
|
+
# get an array of submodule dirs by executing 'pwd' inside each submodule
|
20
|
+
gem_dir = File.expand_path(File.dirname(__FILE__)) + "/"
|
21
|
+
`git submodule --quiet foreach pwd`.split($\).each do |submodule_path|
|
22
|
+
Dir.chdir(submodule_path) do
|
23
|
+
submodule_relative_path = submodule_path.sub gem_dir, ""
|
24
|
+
# issue git ls-files in submodule's directory and
|
25
|
+
# prepend the submodule path to create absolute file paths
|
26
|
+
`git ls-files`.split($\).each do |filename|
|
27
|
+
spec.files << "#{submodule_relative_path}/#{filename}"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
18
32
|
spec.bindir = "exe"
|
19
33
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
34
|
spec.require_paths = ["lib"]
|
@@ -25,4 +39,15 @@ Gem::Specification.new do |spec|
|
|
25
39
|
|
26
40
|
spec.add_dependency "cmds", ">= 0.0.9"
|
27
41
|
spec.add_dependency "nrser-extras", ">= 0.0.3"
|
42
|
+
|
43
|
+
if QB::VERSION.end_with? '.dev'
|
44
|
+
commit = `git rev-parse HEAD`.strip
|
45
|
+
|
46
|
+
spec.metadata = {
|
47
|
+
"built" => Time.now.to_s,
|
48
|
+
"branch" => `git rev-parse --abbrev-ref HEAD`.strip,
|
49
|
+
"commit" => commit,
|
50
|
+
"browse" => "https://github.com/nrser/qb/tree/#{ commit }",
|
51
|
+
}
|
52
|
+
end
|
28
53
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Contributing to blockinfile role/module
|
2
|
+
|
3
|
+
If you're going to contribute and make a pull request in the GitHub project,
|
4
|
+
please consider including some tests for features/fixes
|
5
|
+
you want to add in the PR.
|
6
|
+
|
7
|
+
# Module testing infrastructure
|
8
|
+
|
9
|
+
Run `bash run.sh` in tests dir.
|
10
|
+
It copies fixtures dir to testing (working) dir,
|
11
|
+
then for each of tests (tests/*.yml) it runs ansible-playbook twice
|
12
|
+
(the second run is for idempotency check)
|
13
|
+
and see difference between files in testing dir and ones in expected dir.
|
14
|
+
|
15
|
+
You can add your own tests by adding the following files and dirs:
|
16
|
+
- tests/test-the-feature.yml - A playbook to test "the feature."
|
17
|
+
- tests/fixtures/test-the-feature/... - Put fixtures to be tested.
|
18
|
+
- tests/expected/test-the-feature/... - Put expected results after running playbook.
|
19
|
+
|
@@ -0,0 +1,262 @@
|
|
1
|
+
# Ansible Role: blockinfile
|
2
|
+
|
3
|
+
This role contains no tasks, but provides blockinfile module
|
4
|
+
which might be useful when you want to maintain multi-line snippets
|
5
|
+
in config files in /etc.
|
6
|
+
|
7
|
+
Ansible Galaxy Page: [https://galaxy.ansible.com/list#/roles/1475](https://galaxy.ansible.com/list#/roles/1475)
|
8
|
+
|
9
|
+
**Request for review:**
|
10
|
+
[The pull request to ansible-modules-extras](https://github.com/ansible/ansible-modules-extras/pull/832)
|
11
|
+
has been made to include blockinfile module
|
12
|
+
in the official distribution of Ansible,
|
13
|
+
which enables you to use blockinfile as a standard module without this role!
|
14
|
+
|
15
|
+
If you use this module and feel it's useful,
|
16
|
+
please leave some endorsement comments on the PR.
|
17
|
+
I greatly appreciate if you're
|
18
|
+
[an eligible reviewer (existing module author)](https://github.com/ansible/ansible-modules-extras/blob/devel/REVIEWERS.md)
|
19
|
+
and could take some time to review the PR,
|
20
|
+
otherwise if you could ask reviewers of your acquiaintance for the review.
|
21
|
+
It needs two +1 votes from reviewers in order to be nominated for inclusion.
|
22
|
+
|
23
|
+
## blockinfile Module
|
24
|
+
|
25
|
+
This module will insert/update/remove a block of multi-line text
|
26
|
+
surrounded by the marker lines.
|
27
|
+
|
28
|
+
Example task:
|
29
|
+
|
30
|
+
```yaml
|
31
|
+
- blockinfile:
|
32
|
+
dest: /etc/network/interfaces
|
33
|
+
block: |
|
34
|
+
iface eth0 inet static
|
35
|
+
address 192.168.0.1
|
36
|
+
netmask 255.255.255.0
|
37
|
+
```
|
38
|
+
|
39
|
+
Text inserted/updated by the task in /etc/network/interfaces:
|
40
|
+
|
41
|
+
```
|
42
|
+
# BEGIN ANSIBLE MANAGED BLOCK
|
43
|
+
iface eth0 inet static
|
44
|
+
address 192.168.0.1
|
45
|
+
netmask 255.255.255.0
|
46
|
+
# END ANSIBLE MANAGED BLOCK
|
47
|
+
```
|
48
|
+
|
49
|
+
It uses marker lines `# {BEGIN/END} ANSIBLE MANAGED BLOCK` as default.
|
50
|
+
You can specify alternative marker lines by `marker` option
|
51
|
+
when you need to update files in other formats like HTML,
|
52
|
+
or run multiple blockinfile tasks on the same file.
|
53
|
+
|
54
|
+
### Options
|
55
|
+
|
56
|
+
If this section doesn't show nicely in Ansible Galaxy Page,
|
57
|
+
please refer to equivalent in
|
58
|
+
[GitHub Page](https://github.com/yaegashi/ansible-role-blockinfile#options).
|
59
|
+
|
60
|
+
> <table border=1 cellpadding=4>
|
61
|
+
<tr>
|
62
|
+
<th class="head">parameter</th>
|
63
|
+
<th class="head">required</th>
|
64
|
+
<th class="head">default</th>
|
65
|
+
<th class="head">choices</th>
|
66
|
+
<th class="head">comments</th>
|
67
|
+
</tr>
|
68
|
+
<tr>
|
69
|
+
<td>backup<br/><div style="font-size: small;"></div></td>
|
70
|
+
<td>no</td>
|
71
|
+
<td>no</td>
|
72
|
+
<td><ul><li>yes</li><li>no</li></ul></td>
|
73
|
+
<td><div>Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.</div></td></tr>
|
74
|
+
<tr>
|
75
|
+
<td>block<br/><div style="font-size: small;"></div></td>
|
76
|
+
<td>no</td>
|
77
|
+
<td></td>
|
78
|
+
<td><ul></ul></td>
|
79
|
+
<td><div>The text to insert inside the marker lines. If it's missing or an empty string, the block will be removed as if <code>state</code> were specified to <code>absent</code>.</div></br>
|
80
|
+
<div style="font-size: small;">aliases: content<div></td></tr>
|
81
|
+
<tr>
|
82
|
+
<td>create<br/><div style="font-size: small;"></div></td>
|
83
|
+
<td>no</td>
|
84
|
+
<td>no</td>
|
85
|
+
<td><ul><li>yes</li><li>no</li></ul></td>
|
86
|
+
<td><div>Create a new file if it doesn't exist.</div></td></tr>
|
87
|
+
<tr>
|
88
|
+
<td>dest<br/><div style="font-size: small;"></div></td>
|
89
|
+
<td>yes</td>
|
90
|
+
<td></td>
|
91
|
+
<td><ul></ul></td>
|
92
|
+
<td><div>The file to modify.</div></br>
|
93
|
+
<div style="font-size: small;">aliases: name, destfile<div></td></tr>
|
94
|
+
<tr>
|
95
|
+
<td>follow<br/><div style="font-size: small;"> (added in 1.8)</div></td>
|
96
|
+
<td>no</td>
|
97
|
+
<td>no</td>
|
98
|
+
<td><ul><li>yes</li><li>no</li></ul></td>
|
99
|
+
<td><div>This flag indicates that filesystem links, if they exist, should be followed.</div></td></tr>
|
100
|
+
<tr>
|
101
|
+
<td>group<br/><div style="font-size: small;"></div></td>
|
102
|
+
<td>no</td>
|
103
|
+
<td></td>
|
104
|
+
<td><ul></ul></td>
|
105
|
+
<td><div>name of the group that should own the file/directory, as would be fed to <em>chown</em></div></td></tr>
|
106
|
+
<tr>
|
107
|
+
<td>insertafter<br/><div style="font-size: small;"></div></td>
|
108
|
+
<td>no</td>
|
109
|
+
<td>EOF</td>
|
110
|
+
<td><ul><li>EOF</li><li>*regex*</li></ul></td>
|
111
|
+
<td><div>If specified, the block will be inserted after the last match of specified regular expression. A special value is available; <code>EOF</code> for inserting the block at the end of the file. If specified regular expresion has no matches, <code>EOF</code> will be used instead.</div></td></tr>
|
112
|
+
<tr>
|
113
|
+
<td>insertbefore<br/><div style="font-size: small;"></div></td>
|
114
|
+
<td>no</td>
|
115
|
+
<td></td>
|
116
|
+
<td><ul><li>BOF</li><li>*regex*</li></ul></td>
|
117
|
+
<td><div>If specified, the block will be inserted before the last match of specified regular expression. A special value is available; <code>BOF</code> for inserting the block at the beginning of the file. If specified regular expresion has no matches, the block will be inserted at the end of the file.</div></td></tr>
|
118
|
+
<tr>
|
119
|
+
<td>marker<br/><div style="font-size: small;"></div></td>
|
120
|
+
<td>no</td>
|
121
|
+
<td># {mark} ANSIBLE MANAGED BLOCK</td>
|
122
|
+
<td><ul></ul></td>
|
123
|
+
<td><div>The marker line template. "{mark}" will be replaced with "BEGIN" or "END".</div></td></tr>
|
124
|
+
<tr>
|
125
|
+
<td>mode<br/><div style="font-size: small;"></div></td>
|
126
|
+
<td>no</td>
|
127
|
+
<td></td>
|
128
|
+
<td><ul></ul></td>
|
129
|
+
<td><div>mode the file or directory should be. For those used to <em>/usr/bin/chmod</em> remember that modes are actually octal numbers (like 0644). Leaving off the leading zero will likely have unexpected results. As of version 1.8, the mode may be specified as a symbolic mode (for example, <code>u+rwx</code> or <code>u=rw,g=r,o=r</code>).</div></td></tr>
|
130
|
+
<tr>
|
131
|
+
<td>owner<br/><div style="font-size: small;"></div></td>
|
132
|
+
<td>no</td>
|
133
|
+
<td></td>
|
134
|
+
<td><ul></ul></td>
|
135
|
+
<td><div>name of the user that should own the file/directory, as would be fed to <em>chown</em></div></td></tr>
|
136
|
+
<tr>
|
137
|
+
<td>selevel<br/><div style="font-size: small;"></div></td>
|
138
|
+
<td>no</td>
|
139
|
+
<td>s0</td>
|
140
|
+
<td><ul></ul></td>
|
141
|
+
<td><div>level part of the SELinux file context. This is the MLS/MCS attribute, sometimes known as the <code>range</code>. <code>_default</code> feature works as for <em>seuser</em>.</div></td></tr>
|
142
|
+
<tr>
|
143
|
+
<td>serole<br/><div style="font-size: small;"></div></td>
|
144
|
+
<td>no</td>
|
145
|
+
<td></td>
|
146
|
+
<td><ul></ul></td>
|
147
|
+
<td><div>role part of SELinux file context, <code>_default</code> feature works as for <em>seuser</em>.</div></td></tr>
|
148
|
+
<tr>
|
149
|
+
<td>setype<br/><div style="font-size: small;"></div></td>
|
150
|
+
<td>no</td>
|
151
|
+
<td></td>
|
152
|
+
<td><ul></ul></td>
|
153
|
+
<td><div>type part of SELinux file context, <code>_default</code> feature works as for <em>seuser</em>.</div></td></tr>
|
154
|
+
<tr>
|
155
|
+
<td>seuser<br/><div style="font-size: small;"></div></td>
|
156
|
+
<td>no</td>
|
157
|
+
<td></td>
|
158
|
+
<td><ul></ul></td>
|
159
|
+
<td><div>user part of SELinux file context. Will default to system policy, if applicable. If set to <code>_default</code>, it will use the <code>user</code> portion of the policy if available</div></td></tr>
|
160
|
+
<tr>
|
161
|
+
<td>state<br/><div style="font-size: small;"></div></td>
|
162
|
+
<td>no</td>
|
163
|
+
<td>present</td>
|
164
|
+
<td><ul><li>present</li><li>absent</li></ul></td>
|
165
|
+
<td><div>Whether the block should be there or not.</div></td></tr>
|
166
|
+
<tr>
|
167
|
+
<td>validate<br/><div style="font-size: small;"></div></td>
|
168
|
+
<td>no</td>
|
169
|
+
<td>None</td>
|
170
|
+
<td><ul></ul></td>
|
171
|
+
<td><div>The validation command to run before copying into place. The path to the file to validate is passed in via '%s' which must be present as in the example below. The command is passed securely so shell features like expansion and pipes won't work.</div></td></tr>
|
172
|
+
</table>
|
173
|
+
|
174
|
+
### Examples
|
175
|
+
|
176
|
+
```yaml
|
177
|
+
- name: insert/update "Match User" configuation block in /etc/ssh/sshd_config
|
178
|
+
blockinfile:
|
179
|
+
dest: /etc/ssh/sshd_config
|
180
|
+
block: |
|
181
|
+
Match User ansible-agent
|
182
|
+
PasswordAuthentication no
|
183
|
+
```
|
184
|
+
|
185
|
+
```yaml
|
186
|
+
- name: insert/update eth0 configuration stanza in /etc/network/interfaces
|
187
|
+
(it might be better to copy files into /etc/network/interfaces.d/)
|
188
|
+
blockinfile:
|
189
|
+
dest: /etc/network/interfaces
|
190
|
+
block: |
|
191
|
+
iface eth0 inet static
|
192
|
+
address 192.168.0.1
|
193
|
+
netmask 255.255.255.0
|
194
|
+
```
|
195
|
+
|
196
|
+
```yaml
|
197
|
+
- name: insert/update HTML surrounded by custom markers after <body> line
|
198
|
+
blockinfile:
|
199
|
+
dest: /var/www/html/index.html
|
200
|
+
marker: "<!-- {mark} ANSIBLE MANAGED BLOCK -->"
|
201
|
+
insertafter: "<body>"
|
202
|
+
content: |
|
203
|
+
<h1>Welcome to {{ansible_hostname}}</h1>
|
204
|
+
<p>Last updated on {{ansible_date_time.iso8601}}</p>
|
205
|
+
```
|
206
|
+
|
207
|
+
```yaml
|
208
|
+
- name: remove HTML as well as surrounding markers
|
209
|
+
blockinfile:
|
210
|
+
dest: /var/www/html/index.html
|
211
|
+
marker: "<!-- {mark} ANSIBLE MANAGED BLOCK -->"
|
212
|
+
content: ""
|
213
|
+
```
|
214
|
+
|
215
|
+
## Requirements
|
216
|
+
|
217
|
+
None.
|
218
|
+
|
219
|
+
## Role Variables
|
220
|
+
|
221
|
+
None.
|
222
|
+
|
223
|
+
## Dependencies
|
224
|
+
|
225
|
+
None.
|
226
|
+
|
227
|
+
## Example Playbook
|
228
|
+
|
229
|
+
Complete playbook
|
230
|
+
that makes SSH password authentication for specific user prohibited,
|
231
|
+
then restarts sshd if needed.
|
232
|
+
|
233
|
+
```yaml
|
234
|
+
---
|
235
|
+
- hosts: all
|
236
|
+
remote_user: ansible-agent
|
237
|
+
sudo: yes
|
238
|
+
roles:
|
239
|
+
- yaegashi.blockinfile
|
240
|
+
tasks:
|
241
|
+
- name: Prohibit SSH password authentication for $SUDO_USER
|
242
|
+
blockinfile:
|
243
|
+
dest: /etc/ssh/sshd_config
|
244
|
+
backup: yes
|
245
|
+
content: |
|
246
|
+
Match User {{ansible_env.SUDO_USER}}
|
247
|
+
PasswordAuthentication no
|
248
|
+
notify: Restart sshd
|
249
|
+
handlers:
|
250
|
+
- name: Restart sshd
|
251
|
+
service
|
252
|
+
name: ssh
|
253
|
+
state: restarted
|
254
|
+
```
|
255
|
+
|
256
|
+
## License
|
257
|
+
|
258
|
+
GPLv3+
|
259
|
+
|
260
|
+
## Author Information
|
261
|
+
|
262
|
+
[YAEGASHI Takeshi](https://github.com/yaegashi)
|