File tree Expand file tree Collapse file tree 3 files changed +11
-15
lines changed Expand file tree Collapse file tree 3 files changed +11
-15
lines changed Original file line number Diff line number Diff line change 39
39
{
40
40
"name" : " puppetlabs/inifile" ,
41
41
"version_requirement" : " >= 5.2.0 < 6.0.0"
42
+ },
43
+ {
44
+ "name" : " puppetlabs/ruby_task_helper" ,
45
+ "version_requirement" : " >= 0.6.1 < 1.0.0"
42
46
}
43
47
],
44
48
"operatingsystem_support" : [
Original file line number Diff line number Diff line change 1
1
{
2
2
"description" : " Run on a PE PSQL node to return the major version of the PSQL server currently installed" ,
3
3
"parameters" : { },
4
+ "files" : [" ruby_task_helper/files/task_helper.rb" ],
4
5
"input_method" : " stdin"
5
6
}
Original file line number Diff line number Diff line change 1
1
#!/opt/puppetlabs/puppet/bin/ruby
2
2
# frozen_string_literal: true
3
3
4
+ require_relative '../../ruby_task_helper/files/task_helper.rb'
4
5
require '/opt/puppetlabs/puppet/cache/lib/pe_install/pe_postgresql_info.rb'
5
6
6
- # GetPEAdmConfig task class
7
- class GetPSQLInfo
8
- def initialize ( params ) ; end
9
-
10
- def execute!
7
+ # Task which fetches the installed PSQL server major version
8
+ class GetPSQLInfo < TaskHelper
9
+ def task
11
10
psql_info = PEPostgresqlInfo . new
12
- data = { 'version' => psql_info . installed_server_version }
13
- puts data . to_json
11
+ { 'version' => psql_info . installed_server_version }
14
12
end
15
13
end
16
14
17
- # Run the task unless an environment flag has been set, signaling not to. The
18
- # environment flag is used to disable auto-execution and enable Ruby unit
19
- # testing of this task.
20
- unless ENV [ 'RSPEC_UNIT_TEST_MODE' ]
21
- Puppet . initialize_settings
22
- task = GetPSQLInfo . new ( JSON . parse ( STDIN . read ) )
23
- task . execute!
24
- end
15
+ GetPSQLInfo . run if $PROGRAM_NAME == __FILE__
You can’t perform that action at this time.
0 commit comments