qb 0.3.12 → 0.3.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +3 -1
- data/README.md +42 -26
- data/ansible.cfg +7 -0
- data/doc/common_issues/qb_run/slow_gather_facts.md +51 -0
- data/doc/getting_started.md +84 -0
- data/doc/intro.md +67 -0
- data/doc/notes/2018.01.06.ansible_devel_submodule.md +29 -0
- data/doc/qb_roles.md +155 -0
- data/doc/qb_roles/metadata/default_dir.md +116 -0
- data/exe/qb +16 -14
- data/lib/qb.rb +5 -20
- data/lib/qb/ansible/cmds/playbook.rb +3 -4
- data/lib/qb/ansible/env.rb +22 -2
- data/lib/qb/ansible/env/devel.rb +49 -0
- data/lib/qb/cli.rb +3 -1
- data/lib/qb/cli/help.rb +1 -1
- data/lib/qb/cli/list.rb +47 -0
- data/lib/qb/cli/run.rb +41 -15
- data/lib/qb/cli/setup.rb +35 -2
- data/lib/qb/options.rb +57 -30
- data/lib/qb/role.rb +32 -170
- data/lib/qb/role/default_dir.rb +231 -0
- data/lib/qb/role/errors.rb +18 -10
- data/lib/qb/role/name.rb +139 -0
- data/lib/qb/util/logging.rb +0 -7
- data/lib/qb/version.rb +1 -1
- data/library/stream +5 -0
- data/plugins/filter_plugins/string_plugins.py +2 -3
- data/plugins/filter_plugins/version_plugins.py +11 -0
- data/qb.gemspec +158 -62
- data/roles/nrser.blockinfile/library/blockinfile.py +14 -0
- data/roles/qb.git_repo/tasks/main.yml +3 -3
- data/roles/qb.npm_package/meta/main.yml +2 -2
- data/roles/qb.npm_package/meta/qb.yml +3 -3
- data/roles/qb.vars/meta/qb.yml +8 -7
- data/roles/qb.vars/tasks/main.yml +10 -1
- data/roles/qb/call/defaults/main.yml +2 -0
- data/roles/qb/call/meta/main.yml +8 -0
- data/roles/qb/call/meta/qb.yml +68 -0
- data/roles/qb/call/tasks/main.yml +92 -0
- data/roles/qb/gem/new/meta/qb.yml +1 -1
- data/roles/qb/gem/new/tasks/main.yml +3 -3
- data/roles/qb/gem/release/tasks/main.yml +3 -5
- data/roles/{qb.gitignore → qb/git/ignore}/defaults/main.yml +1 -1
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Actionscript.gitignore +2 -3
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Ada.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Agda.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Android.gitignore +3 -2
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/AppEngine.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/AppceleratorTitanium.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/ArchLinuxPackages.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Autotools.gitignore +9 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/C++.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/C.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/CFWheels.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/CMake.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/CONTRIBUTING.md +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/CUDA.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/CakePHP.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/ChefCookbook.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Clojure.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/CodeIgniter.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/CommonLisp.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Composer.gitignore +1 -1
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Concrete5.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Coq.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/CraftCMS.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/D.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/DM.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Dart.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Delphi.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Drupal.gitignore +3 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/EPiServer.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Eagle.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Elisp.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Elixir.gitignore +2 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Elm.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Erlang.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/ExpressionEngine.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/ExtJs.gitignore +2 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Fancy.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Finale.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/ForceDotCom.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Fortran.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/FuelPHP.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/GWT.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Gcov.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Gem.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/GitBook.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Anjuta.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Ansible.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Archives.gitignore +2 -2
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Bazaar.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/BricxCC.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/CVS.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Calabash.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Cloud9.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/CodeKit.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/DartEditor.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Dreamweaver.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Dropbox.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Eclipse.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/EiffelStudio.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Emacs.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Ensime.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Espresso.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/FlexBuilder.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/GPG.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/JDeveloper.gitignore +0 -0
- data/roles/qb/git/ignore/files/gitignore/Global/JEnv.gitignore +5 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/JetBrains.gitignore +2 -1
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/KDevelop4.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Kate.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Lazarus.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/LibreOffice.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Linux.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/LyX.gitignore +0 -0
- data/roles/qb/git/ignore/files/gitignore/Global/Matlab.gitignore +25 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Mercurial.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/MicrosoftOffice.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/ModelSim.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Momentics.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/MonoDevelop.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/NetBeans.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Ninja.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/NotepadPP.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Otto.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/README.md +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Redcar.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Redis.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/SBT.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/SVN.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/SlickEdit.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Stata.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/SublimeText.gitignore +5 -5
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/SynopsysVCS.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Tags.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/TextMate.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/TortoiseGit.gitignore +0 -0
- data/roles/qb/git/ignore/files/gitignore/Global/Vagrant.gitignore +5 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Vim.gitignore +6 -4
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/VirtualEnv.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/VisualStudioCode.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/WebMethods.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Windows.gitignore +4 -1
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Xcode.gitignore +9 -9
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/XilinxISE.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/macOS.gitignore +2 -1
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Go.gitignore +0 -3
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Gradle.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Grails.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Haskell.gitignore +2 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/IGORPro.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Idris.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Java.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Jboss.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Jekyll.gitignore +1 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Joomla.gitignore +1 -1
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Julia.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/KiCad.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Kohana.gitignore +0 -0
- data/roles/qb/git/ignore/files/gitignore/Kotlin.gitignore +1 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/LICENSE +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/LabVIEW.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Laravel.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Leiningen.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/LemonStand.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Lilypond.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Lithium.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Lua.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Magento.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Maven.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Mercury.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/MetaProgrammingSystem.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Nanoc.gitignore +1 -1
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Nim.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Node.gitignore +1 -1
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/OCaml.gitignore +3 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Objective-C.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Opa.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/OpenCart.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/OracleForms.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Packer.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Perl.gitignore +1 -1
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Phalcon.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/PlayFramework.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Plone.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Prestashop.gitignore +3 -1
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Processing.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/PureScript.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Python.gitignore +11 -5
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/QB.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Qooxdoo.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Qt.gitignore +8 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/R.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/README.md +2 -2
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/ROS.gitignore +2 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Rails.gitignore +4 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/RhodesRhomobile.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Ruby.gitignore +0 -16
- data/roles/qb/git/ignore/files/gitignore/RubyMotion.gitignore +30 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Rust.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/SCons.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Sass.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Scala.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Scheme.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Scrivener.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Sdcc.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/SeamGen.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/SketchUp.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Smalltalk.gitignore +4 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Stella.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/SugarCRM.gitignore +2 -2
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Swift.gitignore +1 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Symfony.gitignore +7 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/SymphonyCMS.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/TeX.gitignore +6 -1
- data/roles/qb/git/ignore/files/gitignore/Terraform.gitignore +9 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Textpattern.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/TurboGears2.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Typo3.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Umbraco.gitignore +7 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Unity.gitignore +7 -6
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/UnrealEngine.gitignore +2 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/VVVV.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/VisualStudio.gitignore +37 -6
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Waf.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/WordPress.gitignore +1 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Xojo.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Yeoman.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Yii.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/ZendFramework.gitignore +0 -1
- data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Zephir.gitignore +0 -0
- data/roles/{qb.gitignore → qb/git/ignore}/meta/main.yml +1 -1
- data/roles/{qb.gitignore → qb/git/ignore}/meta/qb +5 -0
- data/roles/{qb.gitignore → qb/git/ignore}/tasks/main.yml +9 -1
- data/roles/qb/github/pages/setup/defaults/main.yml +2 -0
- data/roles/qb/github/pages/setup/meta/main.yml +8 -0
- data/roles/qb/github/pages/setup/meta/qb.yml +68 -0
- data/roles/qb/github/pages/setup/tasks/main.yml +10 -0
- data/roles/{qb.project → qb/project}/.qb-options.yml +1 -1
- data/roles/{qb.project → qb/project}/defaults/main.yml +1 -1
- data/roles/{qb.project → qb/project}/files/ansible.cfg +0 -0
- data/roles/{qb.project → qb/project}/files/hosts +0 -0
- data/roles/qb/project/meta/main.yml +6 -0
- data/roles/{qb.project → qb/project}/meta/qb.yml +4 -2
- data/roles/{qb.project → qb/project}/qb/get_dir +0 -0
- data/roles/qb/project/tasks/dev.yml +53 -0
- data/roles/{qb.project → qb/project}/tasks/main.yml +3 -2
- data/roles/{qb.project → qb/project}/templates/.gitkeep +0 -0
- data/roles/qb/project/templates/README.md.j2 +4 -0
- data/roles/qb/project/templates/setup.qb.yml.j2 +52 -0
- data/roles/{qb.project → qb/project}/templates/setup.yml.j2 +0 -0
- data/roles/{qb.role → qb/role}/.qb-options.yml +0 -0
- data/roles/{qb.role → qb/role}/defaults/main.yml +4 -1
- data/roles/{qb.role → qb/role}/meta/main.yml +1 -1
- data/roles/{qb.role → qb/role}/meta/qb.yml +2 -2
- data/roles/qb/role/qb/meta/main.yml +1 -1
- data/roles/qb/role/qb/meta/qb.yml +1 -1
- data/roles/qb/role/qb/tasks/main.yml +4 -2
- data/roles/qb/role/qb/templates/qb.yml.j2 +1 -1
- data/roles/{qb.role → qb/role}/tasks/main.yml +3 -2
- data/roles/{qb.role → qb/role}/tasks/module.yml +0 -0
- data/roles/{qb.role → qb/role}/tasks/plugins/_filter_plugin.yml +0 -0
- data/roles/{qb.role → qb/role}/tasks/plugins/filter_plugins.yml +5 -5
- data/roles/{qb.role → qb/role}/templates/.gitkeep +0 -0
- data/roles/{qb.role → qb/role}/templates/README.md.j2 +0 -0
- data/roles/{qb.role → qb/role}/templates/defaults/main.yml.j2 +0 -0
- data/roles/{qb.role → qb/role}/templates/filter_plugins/filters.py.j2 +0 -0
- data/roles/{qb.role → qb/role}/templates/handlers/main.yml.j2 +0 -0
- data/roles/{qb.role → qb/role}/templates/library/module.rb.j2 +0 -0
- data/roles/{qb.role → qb/role}/templates/meta/main.yml.j2 +0 -0
- data/roles/{qb.role → qb/role}/templates/tasks/main.yml.j2 +0 -0
- data/roles/{qb.role → qb/role}/templates/vars/main.yml.j2 +0 -0
- data/roles/{qb.role → qb/role}/vars/main.yml +1 -1
- data/roles/qb/ruby/bundler/.qb-options.yml +4 -0
- data/roles/qb/ruby/bundler/defaults/main.yml +7 -0
- data/roles/qb/ruby/bundler/filter_plugins/bundler_filters.py +157 -0
- data/roles/qb/ruby/bundler/meta/main.yml +8 -0
- data/roles/qb/ruby/bundler/meta/qb.yml +69 -0
- data/roles/qb/ruby/bundler/tasks/gems.yml +12 -0
- data/roles/qb/ruby/bundler/tasks/main.yml +12 -0
- data/roles/qb/ruby/bundler/tasks/setup.yml +13 -0
- data/roles/qb/ruby/yard/defaults/args.yml +2 -0
- data/roles/qb/ruby/yard/defaults/main.yml +9 -0
- data/roles/qb/ruby/yard/meta/main.yml +8 -0
- data/roles/qb/ruby/yard/meta/qb.yml +71 -0
- data/roles/qb/ruby/yard/tasks/main.yml +28 -0
- metadata +290 -297
- data/roles/nrser.blockinfile/tests/.gitignore +0 -1
- data/roles/nrser.blockinfile/tests/expected/test-basic/create.txt +0 -5
- data/roles/nrser.blockinfile/tests/expected/test-basic/insert.txt +0 -6
- data/roles/nrser.blockinfile/tests/expected/test-basic/marker.txt +0 -5
- data/roles/nrser.blockinfile/tests/expected/test-basic/remove.txt +0 -2
- data/roles/nrser.blockinfile/tests/expected/test-basic/update.txt +0 -6
- data/roles/nrser.blockinfile/tests/expected/test-block/block.txt +0 -4
- data/roles/nrser.blockinfile/tests/expected/test-block/content.txt +0 -4
- data/roles/nrser.blockinfile/tests/expected/test-follow/link0.txt +0 -6
- data/roles/nrser.blockinfile/tests/expected/test-follow/link1.txt +0 -6
- data/roles/nrser.blockinfile/tests/expected/test-follow/link2.txt +0 -1
- data/roles/nrser.blockinfile/tests/expected/test-follow/real0.txt +0 -2
- data/roles/nrser.blockinfile/tests/expected/test-follow/real1.txt +0 -2
- data/roles/nrser.blockinfile/tests/expected/test-follow/real2.txt +0 -6
- data/roles/nrser.blockinfile/tests/expected/test-insertab/insertafter.txt +0 -8
- data/roles/nrser.blockinfile/tests/expected/test-insertab/insertbefore.txt +0 -8
- data/roles/nrser.blockinfile/tests/expected/test-insertab/insertbof.txt +0 -8
- data/roles/nrser.blockinfile/tests/expected/test-insertab/inserteof.txt +0 -8
- data/roles/nrser.blockinfile/tests/expected/test-insertab/insertunmatched.txt +0 -8
- data/roles/nrser.blockinfile/tests/expected/test-insertab/updateafter.txt +0 -8
- data/roles/nrser.blockinfile/tests/expected/test-insertab/updatebefore.txt +0 -8
- data/roles/nrser.blockinfile/tests/expected/test-multiline/insert.txt +0 -11
- data/roles/nrser.blockinfile/tests/expected/test-multiline/remove.txt +0 -2
- data/roles/nrser.blockinfile/tests/expected/test-multiline/update.txt +0 -12
- data/roles/nrser.blockinfile/tests/expected/test-replace/index.html +0 -6
- data/roles/nrser.blockinfile/tests/expected/test-state/insert-present.txt +0 -5
- data/roles/nrser.blockinfile/tests/expected/test-state/insert.txt +0 -5
- data/roles/nrser.blockinfile/tests/expected/test-state/remove-absent.txt +0 -2
- data/roles/nrser.blockinfile/tests/expected/test-state/remove-present.txt +0 -2
- data/roles/nrser.blockinfile/tests/expected/test-state/remove.txt +0 -2
- data/roles/nrser.blockinfile/tests/fixtures/test-basic/insert.txt +0 -2
- data/roles/nrser.blockinfile/tests/fixtures/test-basic/marker.txt +0 -1
- data/roles/nrser.blockinfile/tests/fixtures/test-basic/remove.txt +0 -6
- data/roles/nrser.blockinfile/tests/fixtures/test-basic/update.txt +0 -6
- data/roles/nrser.blockinfile/tests/fixtures/test-block/block.txt +0 -1
- data/roles/nrser.blockinfile/tests/fixtures/test-block/content.txt +0 -1
- data/roles/nrser.blockinfile/tests/fixtures/test-follow/link0.txt +0 -1
- data/roles/nrser.blockinfile/tests/fixtures/test-follow/link1.txt +0 -1
- data/roles/nrser.blockinfile/tests/fixtures/test-follow/link2.txt +0 -1
- data/roles/nrser.blockinfile/tests/fixtures/test-follow/real0.txt +0 -2
- data/roles/nrser.blockinfile/tests/fixtures/test-follow/real1.txt +0 -2
- data/roles/nrser.blockinfile/tests/fixtures/test-follow/real2.txt +0 -2
- data/roles/nrser.blockinfile/tests/fixtures/test-insertab/insertafter.txt +0 -4
- data/roles/nrser.blockinfile/tests/fixtures/test-insertab/insertbefore.txt +0 -4
- data/roles/nrser.blockinfile/tests/fixtures/test-insertab/insertbof.txt +0 -4
- data/roles/nrser.blockinfile/tests/fixtures/test-insertab/inserteof.txt +0 -4
- data/roles/nrser.blockinfile/tests/fixtures/test-insertab/insertunmatched.txt +0 -4
- data/roles/nrser.blockinfile/tests/fixtures/test-insertab/updateafter.txt +0 -8
- data/roles/nrser.blockinfile/tests/fixtures/test-insertab/updatebefore.txt +0 -8
- data/roles/nrser.blockinfile/tests/fixtures/test-multiline/insert.txt +0 -2
- data/roles/nrser.blockinfile/tests/fixtures/test-multiline/remove.txt +0 -11
- data/roles/nrser.blockinfile/tests/fixtures/test-multiline/update.txt +0 -12
- data/roles/nrser.blockinfile/tests/fixtures/test-replace/index.html +0 -1
- data/roles/nrser.blockinfile/tests/fixtures/test-state/insert-present.txt +0 -2
- data/roles/nrser.blockinfile/tests/fixtures/test-state/insert.txt +0 -2
- data/roles/nrser.blockinfile/tests/fixtures/test-state/remove-absent.txt +0 -6
- data/roles/nrser.blockinfile/tests/fixtures/test-state/remove-present.txt +0 -6
- data/roles/nrser.blockinfile/tests/fixtures/test-state/remove.txt +0 -6
- data/roles/nrser.blockinfile/tests/hosts +0 -1
- data/roles/nrser.blockinfile/tests/roles/yaegashi.blockinfile +0 -1
- data/roles/nrser.blockinfile/tests/run.sh +0 -64
- data/roles/nrser.blockinfile/tests/test-basic.yml +0 -31
- data/roles/nrser.blockinfile/tests/test-block.yml +0 -16
- data/roles/nrser.blockinfile/tests/test-follow.yml +0 -21
- data/roles/nrser.blockinfile/tests/test-insertab.yml +0 -34
- data/roles/nrser.blockinfile/tests/test-multiline.yml +0 -51
- data/roles/nrser.blockinfile/tests/test-replace.yml +0 -21
- data/roles/nrser.blockinfile/tests/test-state.yml +0 -32
- data/roles/qb.gitignore/files/gitignore/Global/Matlab.gitignore +0 -22
- data/roles/qb.gitignore/files/gitignore/Global/Vagrant.gitignore +0 -1
- data/roles/qb.gitignore/files/gitignore/Terraform.gitignore +0 -6
- data/roles/qb.project/meta/main.yml +0 -6
- data/roles/qb.project/tasks/dev.yml +0 -36
- data/roles/qb.project/tasks/setup.yml +0 -42
- data/roles/qb.project/templates/README.md.j2 +0 -2
- data/roles/qb.project/templates/bootstrap.yml.j2 +0 -20
@@ -0,0 +1,116 @@
|
|
1
|
+
QB Role `default_dir` Strategies
|
2
|
+
==============================================================================
|
3
|
+
|
4
|
+
Details on the acceptable values for the `default_dir` metadata key for QB roles, which I'm calling *strategies*.
|
5
|
+
|
6
|
+
- `null` (or missing entirely) - **No strategy, DIRECTORY arg required on CLI**
|
7
|
+
|
8
|
+
No strategy for figuring out a default directory.
|
9
|
+
|
10
|
+
A {QB::UserInputError} will be raised by {QB::Role.default_dir}
|
11
|
+
|
12
|
+
- `false` - **DIRECTORY arg not used**
|
13
|
+
|
14
|
+
Role does not use a directory argument.
|
15
|
+
|
16
|
+
Providing one via the command line *should* result in an error (though this is untested), and `qb_dir` will not be set in Ansible.
|
17
|
+
|
18
|
+
- **Strategies with no parameters**
|
19
|
+
|
20
|
+
Encoded as simple string values.
|
21
|
+
|
22
|
+
- `'cwd'` - **Current working directory**
|
23
|
+
|
24
|
+
Use the working directory the `run` command was executed in.
|
25
|
+
|
26
|
+
This is expected to pretty much always succeed.
|
27
|
+
|
28
|
+
> **Example**
|
29
|
+
>
|
30
|
+
> default_dir: cwd
|
31
|
+
>
|
32
|
+
|
33
|
+
- `'git_root'` - **Git repo root**
|
34
|
+
|
35
|
+
Use the root of the Git repo for the working directory the run command was executed in.
|
36
|
+
|
37
|
+
Raises an error if that directory is not part of a Git repo.
|
38
|
+
|
39
|
+
> **Example**
|
40
|
+
>
|
41
|
+
> default_dir: git_root
|
42
|
+
>
|
43
|
+
|
44
|
+
- **Strategies with parameters**
|
45
|
+
|
46
|
+
Encoded as directories with a single string key denoting the strategy pointing to a value holding the parameters.
|
47
|
+
|
48
|
+
- `{exe: <path:string>}` - **Run an executable**
|
49
|
+
|
50
|
+
Run the executable at `path` and use the output, which should be a single string directory path (we do chomp what we get back).
|
51
|
+
|
52
|
+
The exe is fed a `JSON` dump of the role options at the time via `STDIN`, so it can dynamically determine the directory based on those if it wants.
|
53
|
+
|
54
|
+
If `path` is relative, it's assumed to be relative to the *role directory*, **NOT** the working directory.
|
55
|
+
|
56
|
+
Raises errors when things go wrong.
|
57
|
+
|
58
|
+
> **Example** Role-relative executable
|
59
|
+
>
|
60
|
+
> This will attempt to resolve the default directory by executing the `<role_path>/bin/get_default_dir` file
|
61
|
+
>
|
62
|
+
> default_dir:
|
63
|
+
> exe: bin/get_default_dir
|
64
|
+
>
|
65
|
+
|
66
|
+
- `{find_up: <rel_path:string>}` - **Find a path walking up**
|
67
|
+
|
68
|
+
Walk up the directory hierarchy from the CLI working directory looking for the first place that `rel_path` exists.
|
69
|
+
|
70
|
+
This is used to do things like find the `Gemfile`, nearest
|
71
|
+
`.gitignore`, etc:
|
72
|
+
|
73
|
+
> **Example** Find the nearest `Gemfile` walking up directories
|
74
|
+
>
|
75
|
+
> default_dir:
|
76
|
+
> find_up: Gemfile
|
77
|
+
>
|
78
|
+
|
79
|
+
> **Example** Find the nearest `.gitignore` walking up directories
|
80
|
+
>
|
81
|
+
> default_dir:
|
82
|
+
> find_up: .gitignore
|
83
|
+
>
|
84
|
+
|
85
|
+
`rel_path` can be deep too:
|
86
|
+
|
87
|
+
> **Example** Find the nearest directory walking up for which `<dir>/dev/ref` exists
|
88
|
+
>
|
89
|
+
> default_dir:
|
90
|
+
> find_up: dev/ref
|
91
|
+
>
|
92
|
+
|
93
|
+
- `{from_role: <role:string}` - **Use value from another role**
|
94
|
+
|
95
|
+
Use the value from another QB role, which this one presumably includes.
|
96
|
+
|
97
|
+
`role` can be anything you would normally use to locate a role using `qb run`, etc. (partial or full name or path).
|
98
|
+
|
99
|
+
> **Example** Use the value for the `qb/ruby/bundler` role
|
100
|
+
>
|
101
|
+
> default_dir:
|
102
|
+
> from_role: qb/ruby/bundler
|
103
|
+
>
|
104
|
+
|
105
|
+
- `Array` - **Multiple strategies (fallbacks)**
|
106
|
+
|
107
|
+
A list of strategies to try; first to succeed wins.
|
108
|
+
|
109
|
+
> **Example** Closest `Gemfile` or Git root
|
110
|
+
>
|
111
|
+
> Walk up directories looking for `Gemfile`, and if one can't be found then use the Git repo root.
|
112
|
+
>
|
113
|
+
> default_dir:
|
114
|
+
> - find_up: Gemfile
|
115
|
+
> - git_root
|
116
|
+
>
|
data/exe/qb
CHANGED
@@ -35,30 +35,32 @@ def main args
|
|
35
35
|
|
36
36
|
QB.check_ansible_version
|
37
37
|
|
38
|
-
logger.debug "
|
38
|
+
logger.debug "Main switch arg" => args[0]
|
39
39
|
|
40
|
-
|
40
|
+
method_name, method_args = case args[0]
|
41
41
|
when nil, '-h', '--help', 'help'
|
42
|
-
|
42
|
+
[:help, []]
|
43
43
|
when 'play'
|
44
|
-
|
44
|
+
[:play, args.rest]
|
45
45
|
when 'run'
|
46
|
-
|
46
|
+
[:run, args.rest]
|
47
47
|
when 'setup'
|
48
|
-
|
49
|
-
|
50
|
-
case state_args[0]
|
51
|
-
when nil
|
52
|
-
QB::CLI.setup
|
53
|
-
end
|
48
|
+
[:setup, args.rest]
|
54
49
|
else
|
55
50
|
# default to `run` on the full args
|
56
|
-
|
51
|
+
[:run, args]
|
57
52
|
end
|
58
53
|
|
59
|
-
logger.debug "
|
54
|
+
logger.debug "Calling QB::CLI.#{ method_name }",
|
55
|
+
method_args: method_args
|
60
56
|
|
61
|
-
|
57
|
+
status = begin
|
58
|
+
QB::CLI.public_send method_name, method_args
|
59
|
+
rescue Exception => error
|
60
|
+
raise error
|
61
|
+
end
|
62
|
+
|
63
|
+
logger.debug "QB::CLI.#{ method_name } returned, exiting.", status: status
|
62
64
|
exit status
|
63
65
|
end
|
64
66
|
|
data/lib/qb.rb
CHANGED
@@ -45,32 +45,17 @@ module QB
|
|
45
45
|
include SemanticLogger::Loggable
|
46
46
|
|
47
47
|
|
48
|
+
# Support for the old custom debug logging, now sent to {SemanticLogger}.
|
49
|
+
#
|
48
50
|
def self.debug *args
|
49
51
|
if args[0].is_a? String
|
50
52
|
logger.debug *args
|
51
53
|
else
|
54
|
+
# De-array if there's only one arg
|
55
|
+
args = args[0] if args.length == 1
|
56
|
+
# And send the args to SM as the payload
|
52
57
|
logger.debug payload: args
|
53
58
|
end
|
54
|
-
|
55
|
-
# return unless ENV['QB_DEBUG'] && args.length > 0
|
56
|
-
#
|
57
|
-
# header = 'DEBUG'
|
58
|
-
#
|
59
|
-
# if args[0].is_a? String
|
60
|
-
# header += " " + args.shift
|
61
|
-
# end
|
62
|
-
#
|
63
|
-
# dumpObj = case args.length
|
64
|
-
# when 0
|
65
|
-
# header
|
66
|
-
# when 1
|
67
|
-
# {header => args[0]}
|
68
|
-
# else
|
69
|
-
# {header => args}
|
70
|
-
# end
|
71
|
-
#
|
72
|
-
# # $stderr.puts("DEBUG " + format(msg, values))
|
73
|
-
# $stderr.puts dumpObj.pretty_inspect
|
74
59
|
end
|
75
60
|
|
76
61
|
end
|
@@ -26,8 +26,8 @@ class QB::Ansible::Cmds::Playbook < ::Cmds
|
|
26
26
|
# shell path resolution do it's thing.
|
27
27
|
DEFAULT_EXE = 'ansible-playbook'
|
28
28
|
|
29
|
-
TEMPLATE = <<-END
|
30
|
-
|
29
|
+
TEMPLATE = <<-END
|
30
|
+
<%== exe %>
|
31
31
|
|
32
32
|
<%= cmd_options %>
|
33
33
|
|
@@ -134,7 +134,7 @@ class QB::Ansible::Cmds::Playbook < ::Cmds
|
|
134
134
|
|
135
135
|
|
136
136
|
# Instance Methods
|
137
|
-
# ======================================================================
|
137
|
+
# ======================================================================
|
138
138
|
|
139
139
|
# @return [Hash<String => Object>]
|
140
140
|
# Hash of CLI options for `ansible-playbook` based off {#role_options}
|
@@ -241,4 +241,3 @@ class QB::Ansible::Cmds::Playbook < ::Cmds
|
|
241
241
|
# end protected
|
242
242
|
|
243
243
|
end # class QB::Ansible::Playbook
|
244
|
-
|
data/lib/qb/ansible/env.rb
CHANGED
@@ -53,6 +53,16 @@ class QB::Ansible::Env
|
|
53
53
|
attr_reader :lookup_plugins
|
54
54
|
|
55
55
|
|
56
|
+
# `ANSIBLE_CONFIG_<name>=<value>` ENV var values.
|
57
|
+
#
|
58
|
+
# @see http://docs.ansible.com/ansible/latest/intro_configuration.html
|
59
|
+
#
|
60
|
+
# @return [Hash<(String | Symbol), String]
|
61
|
+
#
|
62
|
+
attr_reader :config
|
63
|
+
|
64
|
+
|
65
|
+
|
56
66
|
# Constructor
|
57
67
|
# ======================================================================
|
58
68
|
|
@@ -76,6 +86,8 @@ class QB::Ansible::Env
|
|
76
86
|
@lookup_plugins = [
|
77
87
|
QB::ROOT.join('plugins', 'lookup_plugins'),
|
78
88
|
]
|
89
|
+
|
90
|
+
@config = {}
|
79
91
|
end # #initialize
|
80
92
|
|
81
93
|
|
@@ -91,19 +103,27 @@ class QB::Ansible::Env
|
|
91
103
|
# @todo Document return value.
|
92
104
|
#
|
93
105
|
def to_h
|
94
|
-
[
|
106
|
+
hash = [
|
95
107
|
:roles_path,
|
96
108
|
:library,
|
97
109
|
:filter_plugins,
|
98
110
|
:lookup_plugins
|
99
111
|
].map { |name|
|
100
|
-
value = self.send
|
112
|
+
value = self.send name
|
101
113
|
|
102
114
|
value = value.join(':') if value.is_a?(Array)
|
103
115
|
|
104
116
|
[self.class.to_var_name(name), value]
|
105
117
|
}.to_h
|
118
|
+
|
119
|
+
config.each { |name, value|
|
120
|
+
hash[ self.class.to_var_name( "CONFIG_#{ name }" ) ] = value.to_s
|
121
|
+
}
|
122
|
+
|
123
|
+
hash
|
106
124
|
end # #to_h
|
107
125
|
|
108
126
|
|
109
127
|
end # class QB::Ansible::Env
|
128
|
+
|
129
|
+
require 'qb/ansible/env/devel'
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module QB; end
|
2
|
+
module QB::Ansible; end
|
3
|
+
|
4
|
+
|
5
|
+
# @todo document QB::Ansible::Env class.
|
6
|
+
class QB::Ansible::Env::Devel < QB::Ansible::Env
|
7
|
+
ANSIBLE_HOME = QB::ROOT / 'packages' / 'python' / 'ansible'
|
8
|
+
|
9
|
+
# Instance Methods
|
10
|
+
# ======================================================================
|
11
|
+
|
12
|
+
# @todo Document to_h method.
|
13
|
+
#
|
14
|
+
# @param [type] arg_name
|
15
|
+
# @todo Add name param description.
|
16
|
+
#
|
17
|
+
# @return [return_type]
|
18
|
+
# @todo Document return value.
|
19
|
+
#
|
20
|
+
def to_h
|
21
|
+
hash = super
|
22
|
+
|
23
|
+
hash['ANSIBLE_HOME'] = ANSIBLE_HOME.to_s
|
24
|
+
|
25
|
+
hash['PYTHONPATH'] = [
|
26
|
+
# (QB::ROOT / 'lib' / 'python'),
|
27
|
+
(ANSIBLE_HOME / 'lib'),
|
28
|
+
ENV['PYTHONPATH'],
|
29
|
+
].
|
30
|
+
compact.
|
31
|
+
map( &:to_s ).
|
32
|
+
join( ':' )
|
33
|
+
|
34
|
+
path = ENV['PATH'].split ':'
|
35
|
+
|
36
|
+
path.insert \
|
37
|
+
path.find_index { |p| ! p.start_with?( './' ) },
|
38
|
+
(ANSIBLE_HOME / 'bin').to_s
|
39
|
+
|
40
|
+
hash['PATH'] = path.join ':'
|
41
|
+
|
42
|
+
# hash['ANSIBLE_CONNECTION'] = 'local'
|
43
|
+
# hash['ANSIBLE_PYTHON_INTERPRETER'] = '/usr/local/bin/python2'
|
44
|
+
|
45
|
+
hash
|
46
|
+
end # #to_h
|
47
|
+
|
48
|
+
|
49
|
+
end # class QB::Ansible::Env
|
data/lib/qb/cli.rb
CHANGED
@@ -30,6 +30,8 @@ module QB; end
|
|
30
30
|
|
31
31
|
module QB::CLI
|
32
32
|
|
33
|
+
include SemanticLogger::Loggable
|
34
|
+
|
33
35
|
# Eigenclass (Singleton Class)
|
34
36
|
# ========================================================================
|
35
37
|
#
|
@@ -114,7 +116,7 @@ module QB::CLI
|
|
114
116
|
ask name: option.name,
|
115
117
|
description: option.description,
|
116
118
|
default: default
|
117
|
-
# type:
|
119
|
+
# type:
|
118
120
|
end
|
119
121
|
|
120
122
|
|
data/lib/qb/cli/help.rb
CHANGED
@@ -24,7 +24,7 @@ module QB::CLI
|
|
24
24
|
# Error exit status - we don't want `qb ... && ...` to move on to the
|
25
25
|
# second command when we end up falling back to `help`.
|
26
26
|
#
|
27
|
-
def self.help
|
27
|
+
def self.help args = []
|
28
28
|
metadata = if QB.gemspec.metadata && !QB.gemspec.metadata.empty?
|
29
29
|
"metadata:\n" + QB.gemspec.metadata.map {|key, value|
|
30
30
|
" #{ key }: #{ value }"
|
data/lib/qb/cli/list.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# Requirements
|
2
|
+
# =====================================================================
|
3
|
+
|
4
|
+
# package
|
5
|
+
|
6
|
+
|
7
|
+
# Declarations
|
8
|
+
# =======================================================================
|
9
|
+
|
10
|
+
module QB; end
|
11
|
+
|
12
|
+
|
13
|
+
# Definitions
|
14
|
+
# =======================================================================
|
15
|
+
|
16
|
+
module QB::CLI
|
17
|
+
|
18
|
+
# List available roles.
|
19
|
+
#
|
20
|
+
# @example
|
21
|
+
#
|
22
|
+
# qb list --user
|
23
|
+
# qb list -u
|
24
|
+
# qb list --local
|
25
|
+
# qb list -l
|
26
|
+
# qb list --system
|
27
|
+
# qb list -s
|
28
|
+
# qb list --path=:system
|
29
|
+
# qb list --path=./roles
|
30
|
+
# qb list -p ./roles
|
31
|
+
# qb list gem
|
32
|
+
#
|
33
|
+
# @todo
|
34
|
+
# We should have more types of help.
|
35
|
+
#
|
36
|
+
# @return [1]
|
37
|
+
# Error exit status - we don't want `qb ... && ...` to move on to the
|
38
|
+
# second command when we end up falling back to `help`.
|
39
|
+
#
|
40
|
+
def self.list args = []
|
41
|
+
puts QB::Role.available
|
42
|
+
puts
|
43
|
+
|
44
|
+
return 1
|
45
|
+
end # .help
|
46
|
+
|
47
|
+
end # module QB::CLI
|
data/lib/qb/cli/run.rb
CHANGED
@@ -14,7 +14,7 @@ module QB; end
|
|
14
14
|
# Definitions
|
15
15
|
# =======================================================================
|
16
16
|
|
17
|
-
module QB::CLI
|
17
|
+
module QB::CLI
|
18
18
|
|
19
19
|
# Run a QB role.
|
20
20
|
#
|
@@ -22,13 +22,13 @@ module QB::CLI
|
|
22
22
|
# CLI args to work with.
|
23
23
|
#
|
24
24
|
# @return [Fixnum]
|
25
|
-
# Exit status code from `ansible-playbook` command, unless we invoked
|
25
|
+
# Exit status code from `ansible-playbook` command, unless we invoked
|
26
26
|
# help or error'd out in another way before the run (in which case `1`
|
27
27
|
# is returned).
|
28
28
|
#
|
29
29
|
def self.run args
|
30
30
|
role_arg = args.shift
|
31
|
-
QB.debug "role arg"
|
31
|
+
QB.debug "role arg" => role_arg
|
32
32
|
|
33
33
|
begin
|
34
34
|
role = QB::Role.require role_arg
|
@@ -45,17 +45,17 @@ module QB::CLI
|
|
45
45
|
|
46
46
|
options = QB::Options.new role, args
|
47
47
|
|
48
|
-
QB.debug "
|
49
|
-
|
50
|
-
}
|
48
|
+
QB.debug "Role options set on cli",
|
49
|
+
role: options.role_options.reject { |k, o| o.value.nil? }
|
51
50
|
|
52
|
-
QB.debug "
|
51
|
+
QB.debug "QB options", options.qb.dup
|
52
|
+
QB.debug "Ansible options", options.ansible.dup
|
53
53
|
|
54
54
|
cwd = Dir.getwd
|
55
55
|
|
56
56
|
dir = nil
|
57
57
|
|
58
|
-
if role.
|
58
|
+
if role.has_dir_arg?
|
59
59
|
# get the target dir
|
60
60
|
dir = case args.length
|
61
61
|
when 0
|
@@ -198,10 +198,39 @@ module QB::CLI
|
|
198
198
|
],
|
199
199
|
'roles' => [
|
200
200
|
'nrser.blockinfile',
|
201
|
-
playbook_role
|
202
201
|
],
|
203
202
|
}
|
204
203
|
|
204
|
+
if role.meta['call_role']
|
205
|
+
logger.debug "Calling role through qb/call..."
|
206
|
+
|
207
|
+
play['tasks'] = [
|
208
|
+
{
|
209
|
+
'include_role' => {
|
210
|
+
'name' => 'qb/call',
|
211
|
+
},
|
212
|
+
'vars' => {
|
213
|
+
'role' => role.name,
|
214
|
+
'args' => set_options.map { |option|
|
215
|
+
[option.var_name, option.value]
|
216
|
+
}.to_h,
|
217
|
+
}
|
218
|
+
}
|
219
|
+
]
|
220
|
+
|
221
|
+
env = QB::Ansible::Env::Devel.new
|
222
|
+
exe = [
|
223
|
+
"python2",
|
224
|
+
(QB::Ansible::Env::Devel::ANSIBLE_HOME / 'bin' / 'ansible-playbook')
|
225
|
+
].join " "
|
226
|
+
|
227
|
+
else
|
228
|
+
play['roles'] << playbook_role
|
229
|
+
env = QB::Ansible::Env.new
|
230
|
+
exe = "ansible-playbook"
|
231
|
+
|
232
|
+
end
|
233
|
+
|
205
234
|
if options.qb['user']
|
206
235
|
play['become'] = true
|
207
236
|
play['become_user'] = options.qb['user']
|
@@ -209,9 +238,7 @@ module QB::CLI
|
|
209
238
|
|
210
239
|
playbook = [play]
|
211
240
|
|
212
|
-
|
213
|
-
|
214
|
-
env = QB::Ansible::Env.new
|
241
|
+
logger.debug "playbook", playbook
|
215
242
|
|
216
243
|
# stick the role path in front to make sure we get **that** role
|
217
244
|
env.roles_path.unshift role.path.expand_path.dirname
|
@@ -220,7 +247,8 @@ module QB::CLI
|
|
220
247
|
env: env,
|
221
248
|
playbook: playbook,
|
222
249
|
role_options: options,
|
223
|
-
chdir: (File.exists?('./ansible/ansible.cfg') ? './ansible' : nil)
|
250
|
+
chdir: (File.exists?('./ansible/ansible.cfg') ? './ansible' : nil),
|
251
|
+
exe: exe
|
224
252
|
|
225
253
|
# print
|
226
254
|
# =====
|
@@ -287,5 +315,3 @@ module QB::CLI
|
|
287
315
|
end # .run
|
288
316
|
|
289
317
|
end # module QB::CLI
|
290
|
-
|
291
|
-
|