moose-inventory 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7694cb8a3c33618943fcc8bd0542b466c1fc2661
|
4
|
+
data.tar.gz: 057335d70625fca40ffc58f0e509b80466e5868c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 394c749d2d70e32e19514de5b00b60ccb45bc1829f8071804ec4f05b542e2fcbff0a1f27e28ba299d162a6c86ab4dc99bab9c180b31c4d38db18b102ec225a71
|
7
|
+
data.tar.gz: 5598e22deade66147638d2f94d4453f75dfcb01797c70fb37047b5b5c3a5099f078388cc57f9967fab333e53e1b5c1191f1359d2542bc9c759427d760b2c6394
|
@@ -45,7 +45,7 @@ module Moose
|
|
45
45
|
name = names.first
|
46
46
|
host = db.models[:host].find(name: name)
|
47
47
|
if host.nil?
|
48
|
-
fmt.warn "The host #{name} does not exist
|
48
|
+
fmt.warn "The host #{name} does not exist.\n"
|
49
49
|
else
|
50
50
|
host.hostvars_dataset.each do |hv|
|
51
51
|
results[hv[:name].to_sym] = hv[:value]
|
@@ -74,8 +74,12 @@ module Moose
|
|
74
74
|
end
|
75
75
|
|
76
76
|
# Sanity
|
77
|
-
# - Ansible output format must be json
|
78
|
-
|
77
|
+
# - Ansible output format must be json - pjson is permitted, but yaml is not.
|
78
|
+
if @_confopts[:ansible] == true
|
79
|
+
unless @_confopts[:format] =~ /p|pjson|j|json/
|
80
|
+
@_confopts[:format] = 'json'
|
81
|
+
end
|
82
|
+
end
|
79
83
|
|
80
84
|
end
|
81
85
|
|
@@ -106,12 +110,12 @@ module Moose
|
|
106
110
|
case @_argv[0]
|
107
111
|
when '--list'
|
108
112
|
@_confopts[:ansible] = true
|
109
|
-
@_confopts[:format] = 'json'
|
113
|
+
@_confopts[:format] = 'json' unless @_confopts[:format] =~ /p|pjson|j|json/
|
110
114
|
@_argv.clear
|
111
115
|
@_argv.concat(['group', 'list']).flatten
|
112
116
|
when '--host'
|
113
117
|
@_confopts[:ansible] = true
|
114
|
-
@_confopts[:format] = 'json'
|
118
|
+
@_confopts[:format] = 'json' unless @_confopts[:format] =~ /p|pjson|j|json/
|
115
119
|
host = @_argv[1]
|
116
120
|
@_argv.clear
|
117
121
|
@_argv.concat(['host', 'listvars', "#{host}"]).flatten
|