qb 0.3.12 → 0.3.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (367) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +3 -1
  3. data/README.md +42 -26
  4. data/ansible.cfg +7 -0
  5. data/doc/common_issues/qb_run/slow_gather_facts.md +51 -0
  6. data/doc/getting_started.md +84 -0
  7. data/doc/intro.md +67 -0
  8. data/doc/notes/2018.01.06.ansible_devel_submodule.md +29 -0
  9. data/doc/qb_roles.md +155 -0
  10. data/doc/qb_roles/metadata/default_dir.md +116 -0
  11. data/exe/qb +16 -14
  12. data/lib/qb.rb +5 -20
  13. data/lib/qb/ansible/cmds/playbook.rb +3 -4
  14. data/lib/qb/ansible/env.rb +22 -2
  15. data/lib/qb/ansible/env/devel.rb +49 -0
  16. data/lib/qb/cli.rb +3 -1
  17. data/lib/qb/cli/help.rb +1 -1
  18. data/lib/qb/cli/list.rb +47 -0
  19. data/lib/qb/cli/run.rb +41 -15
  20. data/lib/qb/cli/setup.rb +35 -2
  21. data/lib/qb/options.rb +57 -30
  22. data/lib/qb/role.rb +32 -170
  23. data/lib/qb/role/default_dir.rb +231 -0
  24. data/lib/qb/role/errors.rb +18 -10
  25. data/lib/qb/role/name.rb +139 -0
  26. data/lib/qb/util/logging.rb +0 -7
  27. data/lib/qb/version.rb +1 -1
  28. data/library/stream +5 -0
  29. data/plugins/filter_plugins/string_plugins.py +2 -3
  30. data/plugins/filter_plugins/version_plugins.py +11 -0
  31. data/qb.gemspec +158 -62
  32. data/roles/nrser.blockinfile/library/blockinfile.py +14 -0
  33. data/roles/qb.git_repo/tasks/main.yml +3 -3
  34. data/roles/qb.npm_package/meta/main.yml +2 -2
  35. data/roles/qb.npm_package/meta/qb.yml +3 -3
  36. data/roles/qb.vars/meta/qb.yml +8 -7
  37. data/roles/qb.vars/tasks/main.yml +10 -1
  38. data/roles/qb/call/defaults/main.yml +2 -0
  39. data/roles/qb/call/meta/main.yml +8 -0
  40. data/roles/qb/call/meta/qb.yml +68 -0
  41. data/roles/qb/call/tasks/main.yml +92 -0
  42. data/roles/qb/gem/new/meta/qb.yml +1 -1
  43. data/roles/qb/gem/new/tasks/main.yml +3 -3
  44. data/roles/qb/gem/release/tasks/main.yml +3 -5
  45. data/roles/{qb.gitignore → qb/git/ignore}/defaults/main.yml +1 -1
  46. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  47. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Actionscript.gitignore +2 -3
  48. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Ada.gitignore +0 -0
  49. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Agda.gitignore +0 -0
  50. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Android.gitignore +3 -2
  51. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/AppEngine.gitignore +0 -0
  52. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/AppceleratorTitanium.gitignore +0 -0
  53. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/ArchLinuxPackages.gitignore +0 -0
  54. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Autotools.gitignore +9 -0
  55. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/C++.gitignore +0 -0
  56. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/C.gitignore +0 -0
  57. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/CFWheels.gitignore +0 -0
  58. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/CMake.gitignore +0 -0
  59. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/CONTRIBUTING.md +0 -0
  60. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/CUDA.gitignore +0 -0
  61. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/CakePHP.gitignore +0 -0
  62. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/ChefCookbook.gitignore +0 -0
  63. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Clojure.gitignore +0 -0
  64. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/CodeIgniter.gitignore +0 -0
  65. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/CommonLisp.gitignore +0 -0
  66. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Composer.gitignore +1 -1
  67. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Concrete5.gitignore +0 -0
  68. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Coq.gitignore +0 -0
  69. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/CraftCMS.gitignore +0 -0
  70. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/D.gitignore +0 -0
  71. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/DM.gitignore +0 -0
  72. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Dart.gitignore +0 -0
  73. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Delphi.gitignore +0 -0
  74. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Drupal.gitignore +3 -0
  75. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/EPiServer.gitignore +0 -0
  76. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Eagle.gitignore +0 -0
  77. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Elisp.gitignore +0 -0
  78. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Elixir.gitignore +2 -0
  79. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Elm.gitignore +0 -0
  80. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Erlang.gitignore +0 -0
  81. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/ExpressionEngine.gitignore +0 -0
  82. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/ExtJs.gitignore +2 -0
  83. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Fancy.gitignore +0 -0
  84. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Finale.gitignore +0 -0
  85. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/ForceDotCom.gitignore +0 -0
  86. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Fortran.gitignore +0 -0
  87. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/FuelPHP.gitignore +0 -0
  88. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/GWT.gitignore +0 -0
  89. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Gcov.gitignore +0 -0
  90. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Gem.gitignore +0 -0
  91. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/GitBook.gitignore +0 -0
  92. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Anjuta.gitignore +0 -0
  93. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Ansible.gitignore +0 -0
  94. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Archives.gitignore +2 -2
  95. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Bazaar.gitignore +0 -0
  96. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/BricxCC.gitignore +0 -0
  97. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/CVS.gitignore +0 -0
  98. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Calabash.gitignore +0 -0
  99. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Cloud9.gitignore +0 -0
  100. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/CodeKit.gitignore +0 -0
  101. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/DartEditor.gitignore +0 -0
  102. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Dreamweaver.gitignore +0 -0
  103. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Dropbox.gitignore +0 -0
  104. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Eclipse.gitignore +0 -0
  105. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/EiffelStudio.gitignore +0 -0
  106. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Emacs.gitignore +0 -0
  107. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Ensime.gitignore +0 -0
  108. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Espresso.gitignore +0 -0
  109. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/FlexBuilder.gitignore +0 -0
  110. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/GPG.gitignore +0 -0
  111. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/JDeveloper.gitignore +0 -0
  112. data/roles/qb/git/ignore/files/gitignore/Global/JEnv.gitignore +5 -0
  113. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/JetBrains.gitignore +2 -1
  114. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/KDevelop4.gitignore +0 -0
  115. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Kate.gitignore +0 -0
  116. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Lazarus.gitignore +0 -0
  117. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/LibreOffice.gitignore +0 -0
  118. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Linux.gitignore +0 -0
  119. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/LyX.gitignore +0 -0
  120. data/roles/qb/git/ignore/files/gitignore/Global/Matlab.gitignore +25 -0
  121. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Mercurial.gitignore +0 -0
  122. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/MicrosoftOffice.gitignore +0 -0
  123. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/ModelSim.gitignore +0 -0
  124. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Momentics.gitignore +0 -0
  125. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/MonoDevelop.gitignore +0 -0
  126. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/NetBeans.gitignore +0 -0
  127. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Ninja.gitignore +0 -0
  128. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/NotepadPP.gitignore +0 -0
  129. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Otto.gitignore +0 -0
  130. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/README.md +0 -0
  131. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Redcar.gitignore +0 -0
  132. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Redis.gitignore +0 -0
  133. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/SBT.gitignore +0 -0
  134. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/SVN.gitignore +0 -0
  135. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/SlickEdit.gitignore +0 -0
  136. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Stata.gitignore +0 -0
  137. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/SublimeText.gitignore +5 -5
  138. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/SynopsysVCS.gitignore +0 -0
  139. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Tags.gitignore +0 -0
  140. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/TextMate.gitignore +0 -0
  141. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/TortoiseGit.gitignore +0 -0
  142. data/roles/qb/git/ignore/files/gitignore/Global/Vagrant.gitignore +5 -0
  143. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Vim.gitignore +6 -4
  144. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/VirtualEnv.gitignore +0 -0
  145. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/VisualStudioCode.gitignore +0 -0
  146. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/WebMethods.gitignore +0 -0
  147. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Windows.gitignore +4 -1
  148. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/Xcode.gitignore +9 -9
  149. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/XilinxISE.gitignore +0 -0
  150. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Global/macOS.gitignore +2 -1
  151. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Go.gitignore +0 -3
  152. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Gradle.gitignore +0 -0
  153. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Grails.gitignore +0 -0
  154. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Haskell.gitignore +2 -0
  155. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/IGORPro.gitignore +0 -0
  156. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Idris.gitignore +0 -0
  157. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Java.gitignore +0 -0
  158. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Jboss.gitignore +0 -0
  159. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Jekyll.gitignore +1 -0
  160. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Joomla.gitignore +1 -1
  161. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Julia.gitignore +0 -0
  162. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/KiCad.gitignore +0 -0
  163. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Kohana.gitignore +0 -0
  164. data/roles/qb/git/ignore/files/gitignore/Kotlin.gitignore +1 -0
  165. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/LICENSE +0 -0
  166. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/LabVIEW.gitignore +0 -0
  167. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Laravel.gitignore +0 -0
  168. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Leiningen.gitignore +0 -0
  169. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/LemonStand.gitignore +0 -0
  170. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Lilypond.gitignore +0 -0
  171. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Lithium.gitignore +0 -0
  172. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Lua.gitignore +0 -0
  173. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Magento.gitignore +0 -0
  174. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Maven.gitignore +0 -0
  175. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Mercury.gitignore +0 -0
  176. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/MetaProgrammingSystem.gitignore +0 -0
  177. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Nanoc.gitignore +1 -1
  178. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Nim.gitignore +0 -0
  179. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Node.gitignore +1 -1
  180. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/OCaml.gitignore +3 -0
  181. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Objective-C.gitignore +0 -0
  182. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Opa.gitignore +0 -0
  183. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/OpenCart.gitignore +0 -0
  184. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/OracleForms.gitignore +0 -0
  185. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Packer.gitignore +0 -0
  186. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Perl.gitignore +1 -1
  187. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Phalcon.gitignore +0 -0
  188. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/PlayFramework.gitignore +0 -0
  189. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Plone.gitignore +0 -0
  190. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Prestashop.gitignore +3 -1
  191. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Processing.gitignore +0 -0
  192. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/PureScript.gitignore +0 -0
  193. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Python.gitignore +11 -5
  194. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/QB.gitignore +0 -0
  195. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Qooxdoo.gitignore +0 -0
  196. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Qt.gitignore +8 -0
  197. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/R.gitignore +0 -0
  198. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/README.md +2 -2
  199. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/ROS.gitignore +2 -0
  200. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Rails.gitignore +4 -0
  201. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/RhodesRhomobile.gitignore +0 -0
  202. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Ruby.gitignore +0 -16
  203. data/roles/qb/git/ignore/files/gitignore/RubyMotion.gitignore +30 -0
  204. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Rust.gitignore +0 -0
  205. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/SCons.gitignore +0 -0
  206. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Sass.gitignore +0 -0
  207. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Scala.gitignore +0 -0
  208. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Scheme.gitignore +0 -0
  209. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Scrivener.gitignore +0 -0
  210. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Sdcc.gitignore +0 -0
  211. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/SeamGen.gitignore +0 -0
  212. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/SketchUp.gitignore +0 -0
  213. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Smalltalk.gitignore +4 -0
  214. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Stella.gitignore +0 -0
  215. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/SugarCRM.gitignore +2 -2
  216. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Swift.gitignore +1 -0
  217. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Symfony.gitignore +7 -0
  218. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/SymphonyCMS.gitignore +0 -0
  219. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/TeX.gitignore +6 -1
  220. data/roles/qb/git/ignore/files/gitignore/Terraform.gitignore +9 -0
  221. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Textpattern.gitignore +0 -0
  222. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/TurboGears2.gitignore +0 -0
  223. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Typo3.gitignore +0 -0
  224. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Umbraco.gitignore +7 -0
  225. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Unity.gitignore +7 -6
  226. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/UnrealEngine.gitignore +2 -0
  227. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/VVVV.gitignore +0 -0
  228. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/VisualStudio.gitignore +37 -6
  229. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Waf.gitignore +0 -0
  230. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/WordPress.gitignore +1 -0
  231. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Xojo.gitignore +0 -0
  232. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Yeoman.gitignore +0 -0
  233. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Yii.gitignore +0 -0
  234. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/ZendFramework.gitignore +0 -1
  235. data/roles/{qb.gitignore → qb/git/ignore}/files/gitignore/Zephir.gitignore +0 -0
  236. data/roles/{qb.gitignore → qb/git/ignore}/meta/main.yml +1 -1
  237. data/roles/{qb.gitignore → qb/git/ignore}/meta/qb +5 -0
  238. data/roles/{qb.gitignore → qb/git/ignore}/tasks/main.yml +9 -1
  239. data/roles/qb/github/pages/setup/defaults/main.yml +2 -0
  240. data/roles/qb/github/pages/setup/meta/main.yml +8 -0
  241. data/roles/qb/github/pages/setup/meta/qb.yml +68 -0
  242. data/roles/qb/github/pages/setup/tasks/main.yml +10 -0
  243. data/roles/{qb.project → qb/project}/.qb-options.yml +1 -1
  244. data/roles/{qb.project → qb/project}/defaults/main.yml +1 -1
  245. data/roles/{qb.project → qb/project}/files/ansible.cfg +0 -0
  246. data/roles/{qb.project → qb/project}/files/hosts +0 -0
  247. data/roles/qb/project/meta/main.yml +6 -0
  248. data/roles/{qb.project → qb/project}/meta/qb.yml +4 -2
  249. data/roles/{qb.project → qb/project}/qb/get_dir +0 -0
  250. data/roles/qb/project/tasks/dev.yml +53 -0
  251. data/roles/{qb.project → qb/project}/tasks/main.yml +3 -2
  252. data/roles/{qb.project → qb/project}/templates/.gitkeep +0 -0
  253. data/roles/qb/project/templates/README.md.j2 +4 -0
  254. data/roles/qb/project/templates/setup.qb.yml.j2 +52 -0
  255. data/roles/{qb.project → qb/project}/templates/setup.yml.j2 +0 -0
  256. data/roles/{qb.role → qb/role}/.qb-options.yml +0 -0
  257. data/roles/{qb.role → qb/role}/defaults/main.yml +4 -1
  258. data/roles/{qb.role → qb/role}/meta/main.yml +1 -1
  259. data/roles/{qb.role → qb/role}/meta/qb.yml +2 -2
  260. data/roles/qb/role/qb/meta/main.yml +1 -1
  261. data/roles/qb/role/qb/meta/qb.yml +1 -1
  262. data/roles/qb/role/qb/tasks/main.yml +4 -2
  263. data/roles/qb/role/qb/templates/qb.yml.j2 +1 -1
  264. data/roles/{qb.role → qb/role}/tasks/main.yml +3 -2
  265. data/roles/{qb.role → qb/role}/tasks/module.yml +0 -0
  266. data/roles/{qb.role → qb/role}/tasks/plugins/_filter_plugin.yml +0 -0
  267. data/roles/{qb.role → qb/role}/tasks/plugins/filter_plugins.yml +5 -5
  268. data/roles/{qb.role → qb/role}/templates/.gitkeep +0 -0
  269. data/roles/{qb.role → qb/role}/templates/README.md.j2 +0 -0
  270. data/roles/{qb.role → qb/role}/templates/defaults/main.yml.j2 +0 -0
  271. data/roles/{qb.role → qb/role}/templates/filter_plugins/filters.py.j2 +0 -0
  272. data/roles/{qb.role → qb/role}/templates/handlers/main.yml.j2 +0 -0
  273. data/roles/{qb.role → qb/role}/templates/library/module.rb.j2 +0 -0
  274. data/roles/{qb.role → qb/role}/templates/meta/main.yml.j2 +0 -0
  275. data/roles/{qb.role → qb/role}/templates/tasks/main.yml.j2 +0 -0
  276. data/roles/{qb.role → qb/role}/templates/vars/main.yml.j2 +0 -0
  277. data/roles/{qb.role → qb/role}/vars/main.yml +1 -1
  278. data/roles/qb/ruby/bundler/.qb-options.yml +4 -0
  279. data/roles/qb/ruby/bundler/defaults/main.yml +7 -0
  280. data/roles/qb/ruby/bundler/filter_plugins/bundler_filters.py +157 -0
  281. data/roles/qb/ruby/bundler/meta/main.yml +8 -0
  282. data/roles/qb/ruby/bundler/meta/qb.yml +69 -0
  283. data/roles/qb/ruby/bundler/tasks/gems.yml +12 -0
  284. data/roles/qb/ruby/bundler/tasks/main.yml +12 -0
  285. data/roles/qb/ruby/bundler/tasks/setup.yml +13 -0
  286. data/roles/qb/ruby/yard/defaults/args.yml +2 -0
  287. data/roles/qb/ruby/yard/defaults/main.yml +9 -0
  288. data/roles/qb/ruby/yard/meta/main.yml +8 -0
  289. data/roles/qb/ruby/yard/meta/qb.yml +71 -0
  290. data/roles/qb/ruby/yard/tasks/main.yml +28 -0
  291. metadata +290 -297
  292. data/roles/nrser.blockinfile/tests/.gitignore +0 -1
  293. data/roles/nrser.blockinfile/tests/expected/test-basic/create.txt +0 -5
  294. data/roles/nrser.blockinfile/tests/expected/test-basic/insert.txt +0 -6
  295. data/roles/nrser.blockinfile/tests/expected/test-basic/marker.txt +0 -5
  296. data/roles/nrser.blockinfile/tests/expected/test-basic/remove.txt +0 -2
  297. data/roles/nrser.blockinfile/tests/expected/test-basic/update.txt +0 -6
  298. data/roles/nrser.blockinfile/tests/expected/test-block/block.txt +0 -4
  299. data/roles/nrser.blockinfile/tests/expected/test-block/content.txt +0 -4
  300. data/roles/nrser.blockinfile/tests/expected/test-follow/link0.txt +0 -6
  301. data/roles/nrser.blockinfile/tests/expected/test-follow/link1.txt +0 -6
  302. data/roles/nrser.blockinfile/tests/expected/test-follow/link2.txt +0 -1
  303. data/roles/nrser.blockinfile/tests/expected/test-follow/real0.txt +0 -2
  304. data/roles/nrser.blockinfile/tests/expected/test-follow/real1.txt +0 -2
  305. data/roles/nrser.blockinfile/tests/expected/test-follow/real2.txt +0 -6
  306. data/roles/nrser.blockinfile/tests/expected/test-insertab/insertafter.txt +0 -8
  307. data/roles/nrser.blockinfile/tests/expected/test-insertab/insertbefore.txt +0 -8
  308. data/roles/nrser.blockinfile/tests/expected/test-insertab/insertbof.txt +0 -8
  309. data/roles/nrser.blockinfile/tests/expected/test-insertab/inserteof.txt +0 -8
  310. data/roles/nrser.blockinfile/tests/expected/test-insertab/insertunmatched.txt +0 -8
  311. data/roles/nrser.blockinfile/tests/expected/test-insertab/updateafter.txt +0 -8
  312. data/roles/nrser.blockinfile/tests/expected/test-insertab/updatebefore.txt +0 -8
  313. data/roles/nrser.blockinfile/tests/expected/test-multiline/insert.txt +0 -11
  314. data/roles/nrser.blockinfile/tests/expected/test-multiline/remove.txt +0 -2
  315. data/roles/nrser.blockinfile/tests/expected/test-multiline/update.txt +0 -12
  316. data/roles/nrser.blockinfile/tests/expected/test-replace/index.html +0 -6
  317. data/roles/nrser.blockinfile/tests/expected/test-state/insert-present.txt +0 -5
  318. data/roles/nrser.blockinfile/tests/expected/test-state/insert.txt +0 -5
  319. data/roles/nrser.blockinfile/tests/expected/test-state/remove-absent.txt +0 -2
  320. data/roles/nrser.blockinfile/tests/expected/test-state/remove-present.txt +0 -2
  321. data/roles/nrser.blockinfile/tests/expected/test-state/remove.txt +0 -2
  322. data/roles/nrser.blockinfile/tests/fixtures/test-basic/insert.txt +0 -2
  323. data/roles/nrser.blockinfile/tests/fixtures/test-basic/marker.txt +0 -1
  324. data/roles/nrser.blockinfile/tests/fixtures/test-basic/remove.txt +0 -6
  325. data/roles/nrser.blockinfile/tests/fixtures/test-basic/update.txt +0 -6
  326. data/roles/nrser.blockinfile/tests/fixtures/test-block/block.txt +0 -1
  327. data/roles/nrser.blockinfile/tests/fixtures/test-block/content.txt +0 -1
  328. data/roles/nrser.blockinfile/tests/fixtures/test-follow/link0.txt +0 -1
  329. data/roles/nrser.blockinfile/tests/fixtures/test-follow/link1.txt +0 -1
  330. data/roles/nrser.blockinfile/tests/fixtures/test-follow/link2.txt +0 -1
  331. data/roles/nrser.blockinfile/tests/fixtures/test-follow/real0.txt +0 -2
  332. data/roles/nrser.blockinfile/tests/fixtures/test-follow/real1.txt +0 -2
  333. data/roles/nrser.blockinfile/tests/fixtures/test-follow/real2.txt +0 -2
  334. data/roles/nrser.blockinfile/tests/fixtures/test-insertab/insertafter.txt +0 -4
  335. data/roles/nrser.blockinfile/tests/fixtures/test-insertab/insertbefore.txt +0 -4
  336. data/roles/nrser.blockinfile/tests/fixtures/test-insertab/insertbof.txt +0 -4
  337. data/roles/nrser.blockinfile/tests/fixtures/test-insertab/inserteof.txt +0 -4
  338. data/roles/nrser.blockinfile/tests/fixtures/test-insertab/insertunmatched.txt +0 -4
  339. data/roles/nrser.blockinfile/tests/fixtures/test-insertab/updateafter.txt +0 -8
  340. data/roles/nrser.blockinfile/tests/fixtures/test-insertab/updatebefore.txt +0 -8
  341. data/roles/nrser.blockinfile/tests/fixtures/test-multiline/insert.txt +0 -2
  342. data/roles/nrser.blockinfile/tests/fixtures/test-multiline/remove.txt +0 -11
  343. data/roles/nrser.blockinfile/tests/fixtures/test-multiline/update.txt +0 -12
  344. data/roles/nrser.blockinfile/tests/fixtures/test-replace/index.html +0 -1
  345. data/roles/nrser.blockinfile/tests/fixtures/test-state/insert-present.txt +0 -2
  346. data/roles/nrser.blockinfile/tests/fixtures/test-state/insert.txt +0 -2
  347. data/roles/nrser.blockinfile/tests/fixtures/test-state/remove-absent.txt +0 -6
  348. data/roles/nrser.blockinfile/tests/fixtures/test-state/remove-present.txt +0 -6
  349. data/roles/nrser.blockinfile/tests/fixtures/test-state/remove.txt +0 -6
  350. data/roles/nrser.blockinfile/tests/hosts +0 -1
  351. data/roles/nrser.blockinfile/tests/roles/yaegashi.blockinfile +0 -1
  352. data/roles/nrser.blockinfile/tests/run.sh +0 -64
  353. data/roles/nrser.blockinfile/tests/test-basic.yml +0 -31
  354. data/roles/nrser.blockinfile/tests/test-block.yml +0 -16
  355. data/roles/nrser.blockinfile/tests/test-follow.yml +0 -21
  356. data/roles/nrser.blockinfile/tests/test-insertab.yml +0 -34
  357. data/roles/nrser.blockinfile/tests/test-multiline.yml +0 -51
  358. data/roles/nrser.blockinfile/tests/test-replace.yml +0 -21
  359. data/roles/nrser.blockinfile/tests/test-state.yml +0 -32
  360. data/roles/qb.gitignore/files/gitignore/Global/Matlab.gitignore +0 -22
  361. data/roles/qb.gitignore/files/gitignore/Global/Vagrant.gitignore +0 -1
  362. data/roles/qb.gitignore/files/gitignore/Terraform.gitignore +0 -6
  363. data/roles/qb.project/meta/main.yml +0 -6
  364. data/roles/qb.project/tasks/dev.yml +0 -36
  365. data/roles/qb.project/tasks/setup.yml +0 -42
  366. data/roles/qb.project/templates/README.md.j2 +0 -2
  367. data/roles/qb.project/templates/bootstrap.yml.j2 +0 -20
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cad865997a7d3c28a43696a18d61845343640f57
4
- data.tar.gz: 862f3381e5233eb4958e534beeeeb6e8713f70b5
3
+ metadata.gz: 5303c21f22149b8a6ae1bccb85b6ab0c298eabe5
4
+ data.tar.gz: 192ae9200cbcc58a3ac5accc4fbd46f13f08a2f5
5
5
  SHA512:
6
- metadata.gz: e84892a7b62dad0a3f7d4dfb4a5aa5dd5c865a3412ef8b6f1e1f70ada799e61b3f7397511a8e3aa6275c3927ff0c32c21fd1aae179bc6551689d2251db047275
7
- data.tar.gz: c40a7c516e791e845d335ad3a8aa31dfc8537c3a5f7d72010cd28f1e2bd4dc04fe40c829fd600f974e72ec3f27e035dce51fbd3e1d06744c1b3b9c00a34db310
6
+ metadata.gz: 51454accde596eab43cd5311cab5eb302b56dfe443694817486261cc56a1da02eff5db83a2ea53668eb2b0efaa344b02c5c81fbee41de7bffec280e348d09aa4
7
+ data.tar.gz: 59244ecbf50690bee88196083a711716d4ed4aca587e465d61531977b801a37d213db82a0b763a7c47800a384074bb92eacd9eaaabf83a074d248d1a94ef4d4c
data/.yardopts CHANGED
@@ -1,5 +1,7 @@
1
- --markup markdown
1
+ --output-dir=./doc/site
2
+ --markup=markdown
2
3
  lib/**/*.rb
3
4
  dev/packages/gems/nrser/lib/**/*.rb
4
5
  -
5
6
  README.md
7
+ doc/**/*.md
data/README.md CHANGED
@@ -1,48 +1,64 @@
1
- # qb #
1
+ QB
2
+ ==============================================================================
2
3
 
3
- qb is all about projects. named after everyone's favorite projects.
4
+ QB is all about projects. Named after everyone's favorite projects.
4
5
 
5
- ## meta/qb.yml ##
6
+ QB works by running [Ansible][] plays. So you can think about it as "quarterback" if you happen to be from the corner of the world where that makes any sense.
6
7
 
7
- if this file exists in a role `qb` sees it will make that role available.
8
+ You generally want to read these docs at
8
9
 
9
- the contents of this file allow you to configure how `qb` uses the role.
10
+ <http://www.rubydoc.info/gems/qb/>
10
11
 
11
- ### null values ###
12
+ where the links are more likely to work.
12
13
 
13
- values set to `null` are treated like they're not there at all. to tell QB
14
- *not* to do something assign `false`.
14
+ Or, if you're working from a local clone, by booting the [yard][] server via
15
15
 
16
- ### var_prefix ###
16
+ bundle exec yard server
17
17
 
18
- declare prefix to be added to variable names from the command line for
19
- use in the role.
18
+ and opening
20
19
 
21
- because all variables are pretty much global in ansible, you really want to prefix all your variables names to try and achieve uniqueness. the way i've been doing that is to prefix them with the 'namespaceless' part of the role name.
20
+ <http://localhost:8808>
22
21
 
23
- for example, if you have a role named `qb.project`, the 'namespace' would be `qb` and the 'namespaceless' part would be `project`. it has been my convention to then name the role variables `project_*`, like `project_owner`, `project_name`, etc..
24
22
 
25
- `var_prefix` therefore defaults to the 'namespaceless' part of the role name, so that a call like
23
+ <!-- References & Further Reading: -->
26
24
 
27
- qb qb.project --owner=nrser --name=blah
25
+ [Ansible]: https://www.ansible.com/
26
+ [yard]: https://yardoc.org/
28
27
 
29
- will pass variables
30
28
 
31
- project_owner: "nrser"
32
- project_name: "blah"
29
+ ------------------------------------------------------------------------------
30
+ Quickies
31
+ ------------------------------------------------------------------------------
33
32
 
34
- to the `qb.project` role.
33
+ 1. Status: **UNSTABLE**
34
+
35
+ A bit past experimental, but still actively exploring API and features. Any and every thing subject to breaking changes until we hit `1.0`. Generally trying to bump the minor version with larger changes, but not paying a huge amount of attention to it. Being used personally and in projects and organizations I work with.
35
36
 
36
- however, this setting allows you to specify an alternative prefix.
37
+ 2. Compatibility: **OSX/macOS-only**
38
+
39
+ Though it would probably run fine on Linux, if not other \*nix as well.
37
40
 
38
- if this is set to `null` the default will be used.
41
+ 3. Installation
42
+
43
+ Head over to {file:doc/getting_started.md Getting Started}.
39
44
 
40
- ### default_dir ###
45
+ 4. More Info
46
+
47
+ There is some semblance of an {file:doc/intro.md Introduction} available to get indignant about.
41
48
 
42
- every invocation of `qb` must have a directory it's targeting where it will place a `.qb-options.yml` if applicable. this directory is passed to the role as the `dir` option
43
49
 
44
- this is often the project's root folder, and can sometimes be assembled from the values of other parameters.
50
+ <!-- References & Further Reading: -->
45
51
 
46
- ### vars ###
52
+ [Homebrew]: https://brew.sh/
47
53
 
48
- TODO
54
+ [Ansible Installation]: http://docs.ansible.com/ansible/latest/intro_installation.html
55
+
56
+
57
+ ------------------------------------------------------------------------------
58
+ Help!
59
+ ------------------------------------------------------------------------------
60
+
61
+ Common Issues:
62
+
63
+ 1. `qb run` Command Issues
64
+ 1. {file:doc/common_issues/qb_run/slow_gather_facts.md "Gathering Facts" is *really slow* (FQDN lookup problem)}
@@ -2,3 +2,10 @@
2
2
 
3
3
  roles_path = ./dev/scratch
4
4
  retry_files_enabled = False
5
+
6
+ # Will cause Ansible to cache facts at `//tmp/facts_cache/localhost` in JSON
7
+ # format. Useful when you want to see what it's caching and play with using the
8
+ # cache
9
+ # gathering = explicit
10
+ # fact_caching = jsonfile
11
+ # fact_caching_connection = ./tmp/facts_cache
@@ -0,0 +1,51 @@
1
+ Common Issue: "Gathering Facts" is *really slow* (FQDN lookup problem)
2
+ ==============================================================================
3
+
4
+ Like, 30 seconds kind of slow..!
5
+
6
+ I've encountered this when the system hostname is *not fully-qualified*, resulting in a DNS query (that seemingly times out after - you guessed it - 30 seconds) in attempt to figure out the hosts' Fully-Qualified Domain Name (FQDN).
7
+
8
+ The culprit in this case is a call to Python's `socket.getfqdn()`, which can be found when Ansible is gathering the `platform` facts at
9
+
10
+ <https://github.com/ansible/ansible/blob/v2.4.1.0-1/lib/ansible/module_utils/facts/system/platform.py#L49>
11
+
12
+ You can test if this is an issue with the following terminal command:
13
+
14
+ time python -c 'import socket; print(socket.getfqdn())'
15
+
16
+ You want that to return really quickly, and should see something like:
17
+
18
+ $ time python -c 'import socket; print(socket.getfqdn())'
19
+ nrser-mbp.local
20
+
21
+ real 0m0.394s
22
+ user 0m0.015s
23
+ sys 0m0.021s
24
+
25
+ If it obviously takes a long time and you see result more like
26
+
27
+ $ time python -c 'import socket; print(socket.getfqdn())'
28
+ nrser-mbp
29
+
30
+ real 0m30.028s
31
+ user 0m0.013s
32
+ sys 0m0.008s
33
+
34
+ then it's definitely a problem and is **single-handedly slowing fact gathering to a crawl**.
35
+
36
+ The reason it's happening is because the system's `HostName` is not fully-qualified - notice the `nrser-mbp.local` output in the fast time and the `nrser-mbp` in the slow one.
37
+
38
+ The remedy is to add the `.local` to the `HostName`:
39
+
40
+ sudo scutil --set HostName "$(scutil --get LocalHostName).local"
41
+
42
+ and you're all set!
43
+
44
+ > This assumes you get something reasonable out of `scutil --get LocalHostName`... you can of course just manually stick your hostname in there too.
45
+
46
+ If you have a specific hostname/network setup where `.local` doesn't make sense, you're of course going to have to do something more complicated, probably involving your local DNS resolution and/or network DNS, but the basic idea remains: get `socket.getfqdn()` to go fast.
47
+
48
+
49
+ Credit where credit is due:
50
+
51
+ 1. https://apple.stackexchange.com/questions/175320/why-is-my-hostname-resolution-taking-so-long
@@ -0,0 +1,84 @@
1
+ Getting Started with QB
2
+ ==============================================================================
3
+
4
+ Meant to help get you up and running.
5
+
6
+ -----------------------------------------------------------------------------
7
+ Prerequisites
8
+ -----------------------------------------------------------------------------
9
+
10
+ 1. macOS (OSX)
11
+
12
+ The only thing it's developed, tested and used on at this point, though I don't see any fundamental reason it won't run on \*nix.
13
+
14
+ Exactly zero Windows support.
15
+
16
+ I'm running `10.12.6` "Sierra" right now, and it's not tested in anything else because I'm not aware of any reasonably cheap and easy way to test on a variety of macOS versions.
17
+
18
+ 2. [Homebrew][]
19
+
20
+ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
21
+
22
+ Not totally necessary if you already have all the other prereqs setup or want to figure out how to do so on your own.
23
+
24
+ 3. Python 2 (for Ansible)
25
+
26
+ brew install python2
27
+
28
+ Should come with `pip2`. I haven't used anything except `2.7.X`, currently on `2.7.13`.
29
+
30
+ 4. [Ansible][Ansible Installation]
31
+
32
+ I use the latest stable version available through `pip2`:
33
+
34
+ pip2 install ansible
35
+
36
+ I think we need at least `2.1.2`, and may need something higher by now. Using `2.4.1.0` right now, which you can explicitly install like:
37
+
38
+ pip2 install ansible==2.4.1.0
39
+
40
+ Basically have been upgrading whenever I hit bugs or try to use a feature just to find it isn't in my version, which has been... often.
41
+
42
+ 5. Recent Ruby
43
+
44
+ QB uses refinements, so the Ruby `2.0.0` that ships on recent versions of macOS won't suffice. Currently testing against `2.3.4`.
45
+
46
+ I use [rbenv][], something like:
47
+
48
+ brew install rbenv
49
+ rbenv init # and follow instructions
50
+ rbenv install 2.3.4 # or whatever
51
+ rbenv global 2.3.4
52
+
53
+ 6. Recent Node.js
54
+
55
+ brew install node
56
+
57
+ I think Node is only used right now for the [semver][] package, so if you don't use any of the version functionality in QB you probably don't need it?
58
+
59
+
60
+ <!-- References & Further Reading: -->
61
+
62
+ [Homebrew]: https://brew.sh/
63
+
64
+ [Ansible Installation]: http://docs.ansible.com/ansible/latest/intro_installation.html
65
+
66
+ [rbenv]: https://github.com/rbenv/rbenv
67
+
68
+ [semver]: https://www.npmjs.com/package/semver
69
+
70
+
71
+ -----------------------------------------------------------------------------
72
+ Installation
73
+ -----------------------------------------------------------------------------
74
+
75
+ It's just gem from there:
76
+
77
+ gem install qb
78
+
79
+
80
+ -----------------------------------------------------------------------------
81
+ Usage
82
+ -----------------------------------------------------------------------------
83
+
84
+ Yeah TODO someday maybe.
@@ -0,0 +1,67 @@
1
+ A Rough Introduction to QB
2
+ ==============================================================================
3
+
4
+ Ok, So WTF Is It?
5
+ ------------------------------------------------------------------------------
6
+
7
+ QB is a wrapper around [Ansible Roles][] (Ansible's principle unit of code generalization and reuse) that provides a [command line interface][] (here-after referred to as the *CLI*, which just means you use it from the *terminal* or *console* or *shell* or whatever you call the thing you type commands into) for running roles on-the-fly.
8
+
9
+ Instead of writing an [Ansible playbook][] file along with all the necessary [configuration][Ansible configuration] you can just open up a terminal and tell it what you want to do, and QB finds the roles, sets up the paths and host, builds the playbook, and runs it.
10
+
11
+ It also provides help on which roles are available, what they do, and what arguments and options they accept, along with a mess of other features and functionality aimed to make it nicer and easier to write and run Ansible roles that manage your project state.
12
+
13
+ QB is written in Ruby and distributed as a gem. This is kinda a pain-in-the-ass because Ansible is written in Python, so they can't share a runtime, and Ruby doesn't naturally compile/package into a binary, so you end up dealing with [rbenv][] and getting all the paths pointing the the right version and all that other fuss.
14
+
15
+ But hey, Ruby just *feels good man*, and at least it has it's packaging, pathing, distribution and environment management a far-sight better together than Python (in, like, my opinion... I find RubyGems, Bundler, `Gemfile` and `rbenv` a lot less troublesome than `pip`, `virtualenv`, `requirements.txt` and the dreaded `site-packages`).
16
+
17
+
18
+ <!-- References & Further Reading: -->
19
+
20
+ [command line interface]: https://en.wikipedia.org/wiki/Command-line_interface
21
+
22
+ [Ansible Roles]: http://docs.ansible.com/ansible/latest/playbooks_reuse_roles.html
23
+
24
+ [Ansible playbook]: http://docs.ansible.com/ansible/latest/playbooks.html
25
+
26
+ [Ansible configuration]: http://docs.ansible.com/ansible/latest/intro_configuration.html
27
+
28
+ [rbenv]: https://github.com/rbenv/rbenv
29
+
30
+
31
+ -----------------------------------------------------------------------------
32
+ Why Would You Want To Do A Stupid Thing Like That?
33
+ -----------------------------------------------------------------------------
34
+
35
+ Basically, [idempotence][]. I want the human (that's you!) to say how things should be and the computer to do what needs to be done (and only what needs to be done) to make it like that.
36
+
37
+ Ansible:
38
+
39
+ 1. Has a big library of idempotent functionality (that they call [modules][Ansible Modules]) covering a lot of common system resources and states (and they're pretty well documented).
40
+
41
+ 2. Uses a very easy to understand execution paradigm (here's a list of stuff, go through it in order).
42
+
43
+ 3. Is reasonably easy to extend in simple and useful ways, like writing modules, roles, and the more common plugin types.
44
+
45
+ On the downside, Ansible:
46
+
47
+ 1. Is extremely slow to execute `localhost`-targeted playbooks (by CLI standards).
48
+
49
+ 2. Is difficult to extend in complex and useful ways (mostly due to the nearly-complete lack of [Python API][Ansible Python API] documentation).
50
+
51
+ Trying to write vars and action plugins falls in this category for me, along with most the other "look at the source and maybe you can find something kinda like what you want and then screw around off that until it sorta works" stuff.
52
+
53
+ 3. Generally greets you with a old-school-PHP-esque awkwardness once you wade in past the kiddie pool, seemingly due to a similar legacy of an extremely simple system that had things *resembling* common programing features bolted on without always lining up the holes or tightening the screws.
54
+
55
+ See: parametrized roles when all variables are kinda maybe global; modules without any concept of extension or composition, etc.
56
+
57
+
58
+ So, QB tries to make using all that Ansible stuff easier for your everyday tasks and work around some of the wonkiness a bit.
59
+
60
+
61
+ <!-- References & Further Reading: -->
62
+
63
+ [Idempotence]: https://en.wikipedia.org/wiki/Idempotence
64
+
65
+ [Ansible Modules]: http://docs.ansible.com/ansible/latest/list_of_all_modules.html
66
+
67
+ [Ansible Python API]: http://docs.ansible.com/ansible/latest/dev_guide/developing_api.html
@@ -0,0 +1,29 @@
1
+ Ansible `devel` Branch as a Submodule
2
+ ==============================================================================
3
+
4
+ I've forked the [devel][ansible/ansible@devel] branch of [ansible/ansible][] (where activer development happens) at ansible/ansible@b7bf98cd to [nrser/ansible][] (maintaining `devel` as the active and default branch) and added as a submodule at `//packages/python/ansible`.
5
+
6
+ Because:
7
+
8
+ 1. I specifically needed `include_role` to properly template it's `name` parameter, which is fixed in `devel` and presumably slated to land in `2.5` but broken in `2.4`. Which leads me too...
9
+
10
+ 2. Stuff is broken in Ansible *all the time*. Like no other production software I've ever used. There are nearly [4,000 open issues on GitHub][Ansible issues]. Which has painfully and eventually led me to
11
+ 1. Since the release versions are so riddled with bugs (sorry guys, it just really is), might as well use the active development version and at least be able to take advantages of fixes as soon as possible.
12
+
13
+ This is my first excursion into using `devel`, so I'm yet to see if this results in a better or worse experience, but at this point I'm willing to try.
14
+
15
+ 2. I'm going to need to fix and improve things myself.
16
+
17
+ This is super experimental, and going to be behind configuration options for the time being and excluded from the gem package, so it will only be available in development, but I think it's quite possibly the only real path forward to build reliable and sane software that takes advantage of Ansible's expansive module library.
18
+
19
+
20
+ <!-- References & Further Reading: -->
21
+
22
+ [ansible/ansible]: https://github.com/ansible/ansible
23
+
24
+ [ansible/ansible@devel]: https://github.com/ansible/ansible/tree/devel
25
+
26
+ [nrser/ansible]: https://github.com/nrser/ansible
27
+
28
+ [Ansible issues]: https://github.com/ansible/ansible/issues
29
+
@@ -0,0 +1,155 @@
1
+ QB Roles
2
+ ==============================================================================
3
+
4
+ QB roles are [Ansible roles][] that can be run via `qb run`. An Ansible role is a QB role if it has a [QB Metadata](#QB_Metadata) file - `meta/qb.yml` or `meta/qb`.
5
+
6
+
7
+ <!-- References & Further Reading: -->
8
+
9
+ [Ansible Roles]: http://docs.ansible.com/ansible/latest/playbooks_reuse_roles.html
10
+
11
+
12
+ ------------------------------------------------------------------------------
13
+ Creating QB Roles
14
+ ------------------------------------------------------------------------------
15
+
16
+ The easiest way to create QB roles is to use QB's `qb/role/qb` role (say *that* five times fast!):
17
+
18
+ qb run qb/role/qb DIRECTORY [OPTIONS]
19
+
20
+ Since `run` is the default QB CLI command and role names are inferred from partial matches whenever possible, this is commonly shortened to:
21
+
22
+ qb role/qb DIRECTORY [OPTIONS]
23
+
24
+ Which will work unless your roles path contains other roles with 'role/qb' in their name.
25
+
26
+ This will generate a `DIRECTORY/meta/qb.yml` file with common keys and values for you to start from, as well as some notes and links.
27
+
28
+
29
+ > **Example**
30
+ >
31
+ > To create a new role named `me/my_new_role` at `./roles/me/my_new_role` run
32
+ >
33
+ > qb role/qb ./roles/me/my_new_role
34
+ >
35
+
36
+
37
+ As always, you can check out the `qb/role/qb` options via
38
+
39
+ qb role/qb -h
40
+
41
+
42
+ ------------------------------------------------------------------------------
43
+ QB Metadata
44
+ ------------------------------------------------------------------------------
45
+
46
+ QB metadata is a dictionary structure mapping string keys to mixed values that provides QB-specific role configuration.
47
+
48
+ **_A role is a QB role if (and only if) it has QB metadata._**
49
+
50
+
51
+ ### Metadata File Location and Format ###
52
+
53
+ Metadata is provided via one of two file paths (relative to the role's root directory `<role_path>`):
54
+
55
+ 1. `<role_path>/meta/qb.yml`
56
+
57
+ Metadata provided in static [YAML][] format. This is default method and should be used unless the metadata needs to be created dynamically on each role run (in ways not covered by the value options themselves).
58
+
59
+ 2. `<role_path>/meta/qb` (*executable*)
60
+
61
+ Metadata provided by running an executable. The file must be marked as executable for the current system user.
62
+
63
+ The executable is fed a [JSON][] encoding of the options collected form the CLI `run` command on `STDIN`.
64
+
65
+ The executable should write the computed metadata to `STDOUT` in [YAML][] or [JSON][] format and exit successfully.
66
+
67
+ > QB uses the [Ruby YAML library][] to parse the result, which accepts `JSON` as well.
68
+
69
+ If `meta/qb` can't compute metadata, it should exit with an error status and write any error feedback to `STDERR` (though feedback might not be nicely relayed to the CLI user yet).
70
+
71
+ Right now, please don't provide both. At some point I'll handle this case, probably by raising an error, but for the moment I'm not sure how it's (not) handled.
72
+
73
+ > Role metadata is loaded by the {QB::Role#load_meta} function, which is called on demand when accessing the {QB::Role#meta} attribute.
74
+
75
+
76
+ <!-- References & Further Reading: -->
77
+
78
+ [YAML]: http://yaml.org/
79
+ [JSON]: https://www.json.org/
80
+ [Ruby YAML library]: http://ruby-doc.org/stdlib/libdoc/yaml/rdoc/YAML.html
81
+
82
+ ******************************************************************************
83
+
84
+
85
+ ### Conventions ###
86
+
87
+ #### `null` and Missing Metadata Values ####
88
+
89
+ **_QB treats keys set to `null` and missing keys identically._**
90
+
91
+ `null` is the same as not being there at all. I feel like this simplifies things. Departures from this behavior are considered bugs.
92
+
93
+ Generally, to tell QB *not* to do something assign `false`.
94
+
95
+ ******************************************************************************
96
+
97
+
98
+ ### Recognized Metadata Keys ###
99
+
100
+ This section lays out recognized keys and their acceptable values.
101
+
102
+ All keys are optional unless otherwise stated, though if present their values must be acceptable or errors will be raised when you try to run the role.
103
+
104
+
105
+ #### default_dir ####
106
+
107
+ Define a *strategy* (or list of *strategies*) to find a suitable default for
108
+ the `DIRECTORY` command line argument - which becomes the `qb_dir` variable in Ansible - when running a QB role.
109
+
110
+ > The role's `default_dir` metadata value is converted into a directory path in {QB::Role#default_dir}.
111
+
112
+ In brief, the *strategy* value can be:
113
+
114
+ 1. `null` (or missing)
115
+ - `DIRECTORY` arg must be provided on CLI.
116
+ 2. `false`
117
+ - No `DIRECTORY` arg is used and none will be accepted.
118
+ 3. `cwd`
119
+ - Use directory `run` command was run in.
120
+ 4. `git_root`
121
+ - Use the root of the Git repo working directory is a part of.
122
+ 5. `{exe: <path:string>}`
123
+ - Run the executable at `path` and use output.
124
+ 6. `{find_up: <rel_path:string>}`
125
+ - Walk up directories from current looking for `rel_path`.
126
+ 7. `{from_role: <role:string>}`
127
+ - Use the value from another role.
128
+ 8. `Array`
129
+ - Try each strategy until one works.
130
+
131
+ See {file:doc/qb_roles/metadata/default_dir.md} for strategy details and examples.
132
+
133
+
134
+ #### var_prefix ####
135
+
136
+ Declare prefix to be prepended to role CLI option names to form their Ansible variable name.
137
+
138
+ Because all variables are pretty much global in Ansible, you really want to prefix all your variables names to try and achieve uniqueness. the way i've been doing that is to prefix them with the 'namespaceless' part of the role name.
139
+
140
+ For example, if you have a role named `qb.project`, the 'namespace' would be `qb` and the 'namespaceless' part would be `project`. it has been my convention to then name the role variables `project_*`, like `project_owner`, `project_name`, etc..
141
+
142
+ `var_prefix` therefore defaults to the 'namespaceless' part of the role name, so that a call like
143
+
144
+ qb qb.project --owner=nrser --name=blah
145
+
146
+ will pass variables
147
+
148
+ project_owner: "nrser"
149
+ project_name: "blah"
150
+
151
+ to the `qb.project` role.
152
+
153
+ However, this setting allows you to specify an alternative prefix.
154
+
155
+ If this is set to `null` (or missing) the default behavior will be used.