qb 0.1.71 → 0.1.72
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/qb/version.rb +1 -1
- data/plugins/filter_plugins/path.py +66 -0
- data/roles/qb.qb_setup/meta/main.yml +8 -0
- data/roles/qb.qb_setup/meta/qb.yml +69 -0
- data/roles/qb.qb_setup/tasks/main.yml +6 -0
- data/roles/qb.qb_setup/tasks/packages.yml +3 -0
- data/roles/qb.qb_setup/tasks/packages/pip.yml +6 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56ee085b4ad133ca61ffc618b9e91886b22d623a
|
4
|
+
data.tar.gz: e4a66a0fa5f86d261310562d93dc6896285d87c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84cc40de910e66c346335b39e63d4d10bbe3f73bc6c53ce070a8e8e63f5265602869e42ff2cdfdc83d4bc2294346193e95954b76f3df86226b75d7e82438b289
|
7
|
+
data.tar.gz: 756bf8f03c836c59ff05b17d074232673a63fb46f48d2a91a871ac636cb8ce16ad86fc79e3c4f44e75877e12354f51a1b8467ff782029b485c5c2c439b474ea0
|
data/lib/qb/version.rb
CHANGED
@@ -0,0 +1,66 @@
|
|
1
|
+
"""
|
2
|
+
Path manipulation filters using Python's `pathlib` module:
|
3
|
+
|
4
|
+
https://docs.python.org/dev/library/pathlib.html
|
5
|
+
|
6
|
+
as well as the `os.path` stdlib module.
|
7
|
+
|
8
|
+
Provided to Python 2.7 via the `pathlib2` pip module.
|
9
|
+
"""
|
10
|
+
|
11
|
+
from __future__ import (absolute_import, division, print_function)
|
12
|
+
__metaclass__ = type
|
13
|
+
|
14
|
+
import sys
|
15
|
+
import re
|
16
|
+
import os
|
17
|
+
from pathlib2 import Path
|
18
|
+
|
19
|
+
from ansible.errors import AnsibleError
|
20
|
+
|
21
|
+
# def cap(string):
|
22
|
+
# '''just upper-case the first damn letter.
|
23
|
+
#
|
24
|
+
# >>> cap("DoSomething")
|
25
|
+
# 'DoSomething'
|
26
|
+
#
|
27
|
+
# >>> cap('doSomething')
|
28
|
+
# 'DoSomething'
|
29
|
+
# '''
|
30
|
+
# return string[0].upper() + string[1:]
|
31
|
+
|
32
|
+
|
33
|
+
def resolve(*path_segments):
|
34
|
+
'''
|
35
|
+
Path resolution like I know from Node's `path.resolve`, but using Python's
|
36
|
+
`pathlib.Path#resolve`, which seems to function the same way.
|
37
|
+
|
38
|
+
Backported into 2.7 via the `pathlib2` pip modules.
|
39
|
+
|
40
|
+
Joins paths right-to-left until they form an absolute path. If none is
|
41
|
+
formed, the path is prefixed by the current directory to form an absolute
|
42
|
+
path.
|
43
|
+
|
44
|
+
The resuling string is absolute and normalized.
|
45
|
+
'''
|
46
|
+
|
47
|
+
return Path(*path_segments).resolve().__str__()
|
48
|
+
|
49
|
+
|
50
|
+
class FilterModule(object):
|
51
|
+
'''
|
52
|
+
Path manipualtion filter via Python's os.path module.
|
53
|
+
'''
|
54
|
+
|
55
|
+
def filters(self):
|
56
|
+
return {
|
57
|
+
'path_join': os.path.join,
|
58
|
+
'path_resolve': resolve,
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
# testing - call camel_case on first cli arg and print result
|
63
|
+
if __name__ == '__main__':
|
64
|
+
import doctest
|
65
|
+
doctest.testmod()
|
66
|
+
|
@@ -0,0 +1,69 @@
|
|
1
|
+
---
|
2
|
+
# meta/qb.yml file for qb.qb_setup
|
3
|
+
#
|
4
|
+
# qb settings for this role. see README.md for more info.
|
5
|
+
#
|
6
|
+
|
7
|
+
# description of the role to show in it's help output.
|
8
|
+
description: >-
|
9
|
+
Takes care of additional setup required for QB besides installtion of the
|
10
|
+
gem, like installing Python libraries.
|
11
|
+
|
12
|
+
# Gemspec-style requirements. Right now only `gems:qb` is used, but plan to
|
13
|
+
# generalize in the future.
|
14
|
+
requirements:
|
15
|
+
gems:
|
16
|
+
qb: ~> 0.1.69
|
17
|
+
|
18
|
+
# prefix for role variables
|
19
|
+
var_prefix: null
|
20
|
+
|
21
|
+
# how to get a default for `dir` if it's not provided as the only
|
22
|
+
# positional argument. if a positional argument is provided it will
|
23
|
+
# override the method defined here.
|
24
|
+
#
|
25
|
+
# options:
|
26
|
+
#
|
27
|
+
# - null
|
28
|
+
# - require the value on the command line.
|
29
|
+
# - false
|
30
|
+
# - don't provide qb_dir (means doesn't load or save options either).
|
31
|
+
# - git_root
|
32
|
+
# - use the git root fof the directory that the `qb` command is invoked
|
33
|
+
# from. useful for 'project-centric' commands so they can be invoked
|
34
|
+
# from anywhere in the repo.
|
35
|
+
# - cwd
|
36
|
+
# - use the directory the `qb` command is invoked form.
|
37
|
+
# - {exe: PATH}
|
38
|
+
# - invoke an execuable, passing a JSON serialization of the options
|
39
|
+
# mapping their CLI names to values. path can be relative to role
|
40
|
+
# directory.
|
41
|
+
# - {find_up: FILENAME}
|
42
|
+
# - starting at the current direcotry and climbing up to parent
|
43
|
+
# directories, use the first one that contains FILENAME. error
|
44
|
+
# if none is found.
|
45
|
+
default_dir: false
|
46
|
+
|
47
|
+
# If `true`, QB will ensure the default dir exists before starting the play.
|
48
|
+
#
|
49
|
+
# For legacy reasons, this defaults to `true` if not present, but we want to
|
50
|
+
# default declare it as `false` here so new roles can turn it on only if
|
51
|
+
# they need it.
|
52
|
+
#
|
53
|
+
mkdir: false
|
54
|
+
|
55
|
+
# default user to become for play
|
56
|
+
default_user: null
|
57
|
+
|
58
|
+
# set to false to not save options in .qb-options.yml files
|
59
|
+
save_options: true
|
60
|
+
|
61
|
+
# options to pass to ansible-playbook
|
62
|
+
ansible_options: {}
|
63
|
+
|
64
|
+
options: []
|
65
|
+
# - name: example
|
66
|
+
# description: an example of a variable.
|
67
|
+
# required: false
|
68
|
+
# type: boolean # boolean (default) | string
|
69
|
+
# short: e
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.72
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nrser
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -202,6 +202,7 @@ files:
|
|
202
202
|
- node_modules/semver/range.bnf
|
203
203
|
- node_modules/semver/semver.js
|
204
204
|
- package.json
|
205
|
+
- plugins/filter_plugins/path.py
|
205
206
|
- plugins/filter_plugins/string.py
|
206
207
|
- plugins/filter_plugins/version.py
|
207
208
|
- plugins/lookup_plugins/every.py
|
@@ -598,6 +599,11 @@ files:
|
|
598
599
|
- roles/qb.qb_role/tasks/main.yml
|
599
600
|
- roles/qb.qb_role/templates/.gitkeep
|
600
601
|
- roles/qb.qb_role/templates/qb.yml.j2
|
602
|
+
- roles/qb.qb_setup/meta/main.yml
|
603
|
+
- roles/qb.qb_setup/meta/qb.yml
|
604
|
+
- roles/qb.qb_setup/tasks/main.yml
|
605
|
+
- roles/qb.qb_setup/tasks/packages.yml
|
606
|
+
- roles/qb.qb_setup/tasks/packages/pip.yml
|
601
607
|
- roles/qb.read_json/defaults/main.yml
|
602
608
|
- roles/qb.read_json/meta/main.yml
|
603
609
|
- roles/qb.read_json/meta/qb.yml
|