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: a63b0a4a7ad6bd07ebcd5a046dcd9030968ee1ae
4
- data.tar.gz: fa90582f07b70b10ac2e712e0535fd3c092074b7
3
+ metadata.gz: 7694cb8a3c33618943fcc8bd0542b466c1fc2661
4
+ data.tar.gz: 057335d70625fca40ffc58f0e509b80466e5868c
5
5
  SHA512:
6
- metadata.gz: 8103f643b5d66b9f46b1ef076468afc8c7a9307f72e3a2bc211909862d796d9c08a4735c3c07382140e219313b9d038a7428d8d48a827034e6c6c011c1f9e4e3
7
- data.tar.gz: 3a26d900604cb5dbcccd3c5da3f6182f1fde5db0210c7ecb662dacaf8c47b0ad3eb3e1c64ae377d3c7dbbc0dd2521a902802990402e6f125eed18f672ac7e4c6
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
- # @_confopts[:format] = 'json' if @_confopts[:ansible] == true
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
@@ -2,6 +2,6 @@ module Moose
2
2
  ##
3
3
  # The Moose-Tools dynamic inventory management library
4
4
  module Inventory
5
- VERSION = '0.1.5'
5
+ VERSION = '0.1.6'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moose-inventory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russell Davies