From 00ec9c9b8e776179b8e96c994c1a45dd7f54610e Mon Sep 17 00:00:00 2001 From: Monocots Date: Tue, 25 Oct 2022 19:06:30 +0000 Subject: [PATCH] Add an alias to access psql db --- modules/rhizo_base/manifests/users.pp | 8 ++++++++ modules/rhizo_base/templates/bash_aliases.erb | 1 + 2 files changed, 9 insertions(+) create mode 100644 modules/rhizo_base/templates/bash_aliases.erb diff --git a/modules/rhizo_base/manifests/users.pp b/modules/rhizo_base/manifests/users.pp index 5a571fd..076aed6 100644 --- a/modules/rhizo_base/manifests/users.pp +++ b/modules/rhizo_base/manifests/users.pp @@ -13,6 +13,7 @@ class rhizo_base::users { $password_hash = $rhizo_base::password_hash + $pgsql_pwd = $rhizo_base::pgsql_pwd user { 'rhizomatica': ensure => present, @@ -46,4 +47,11 @@ class rhizo_base::users { mode => '0600' } + file { '/home/tic/.bash_aliases': + content => template('rhizo_base/bash_aliases.erb'), + owner => 'tic', + group => 'tic', + mode => '0640' + } + } \ No newline at end of file diff --git a/modules/rhizo_base/templates/bash_aliases.erb b/modules/rhizo_base/templates/bash_aliases.erb new file mode 100644 index 0000000..7f9039f --- /dev/null +++ b/modules/rhizo_base/templates/bash_aliases.erb @@ -0,0 +1 @@ +alias psql='psql postgresql://rhizomatica:<%= @pgsql_pwd %>@localhost/rhizomatica'