Module: VagrantPlugins::Ventriloquist::Cap::Linux::PgExportPghost

Defined in:
lib/ventriloquist/cap/services/linux/pg_export_pghost.rb

Class Method Summary collapse

Class Method Details

.pg_export_pghost(machine) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/ventriloquist/cap/services/linux/pg_export_pghost.rb', line 6

def self.pg_export_pghost(machine)
  machine.communicate.tap do |comm|
    if ! comm.test('grep -q PGHOST /etc/profile.d/ventriloquist.sh 2>/dev/null')
      machine.env.ui.info('Setting default PGHOST')
      comm.sudo('echo "export PGHOST=localhost" >> /etc/profile.d/ventriloquist.sh')
    end
  end
end