File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "description" : " Run on a PE PSQL node to return the major version of the PSQL server currently installed" ,
3
+ "parameters" : { },
4
+ "input_method" : " stdin"
5
+ }
Original file line number Diff line number Diff line change
1
+ #!/opt/puppetlabs/puppet/bin/ruby
2
+ # frozen_string_literal: true
3
+
4
+ require '/opt/puppetlabs/puppet/cache/lib/pe_install/pe_postgresql_info.rb'
5
+
6
+ # GetPEAdmConfig task class
7
+ class GetPSQLInfo
8
+ def initialize ( params ) ; end
9
+
10
+ def execute!
11
+ psql_info = PEPostgresqlInfo . new
12
+ data = { 'version' => psql_info . installed_server_version }
13
+ puts data . to_json
14
+ end
15
+ end
16
+
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
You can’t perform that action at this time.
0 commit comments