Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

debian install postgresql

apt-get install postgresql-12
Comment

postgres setup Linux Debian

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql-12
Comment

Postgresql on Ubuntu/Debian

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# install postgresql on remote instance
# 
# run:
# ansible-playbook "yourplaybookname.yaml" -i ./hosts -e "postgresql_version=..." -e "myinstance=..."
#
 
- name: install postgresql on Ubuntu or Debian
  hosts: "{{myinstance}}"
  become: yes
  become_method: sudo
  gather_facts: yes
 
  tasks:
  - debug: msg="play_hosts={{play_hosts}}"
  - debug: msg="ansible_distribution={{ansible_distribution}}"
 
  - name: postgresql key
    apt_key:
      url: https://www.postgresql.org/media/keys/ACCC4CF8.asc
      state: present
    become: true
     
  - name: create variable
    command: bash -c "echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" "
    register: repo_line
 
  - debug: 
      msg: "{{ repo_line.stdout }}"
       
  - name: add postgresql repo 
    apt_repository:
      repo: "{{ repo_line.stdout }}"
      state: present
    become: true
 
  - name: install postgresql
    apt:
      name: "postgresql-{{postgresql_version}}"
      state: present
      update_cache: yes
    become: true
Comment

Postgresql on Ubuntu/Debian

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# install postgresql on remote instance
# 
# run:
# ansible-playbook "yourplaybookname.yaml" -i ./hosts -e "postgresql_version=..." -e "myinstance=..."
#
 
- name: install postgresql on Ubuntu or Debian
  hosts: "{{myinstance}}"
  become: yes
  become_method: sudo
  gather_facts: yes
 
  tasks:
  - debug: msg="play_hosts={{play_hosts}}"
  - debug: msg="ansible_distribution={{ansible_distribution}}"
 
  - name: postgresql key
    apt_key:
      url: https://www.postgresql.org/media/keys/ACCC4CF8.asc
      state: present
    become: true
     
  - name: create variable
    command: bash -c "echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" "
    register: repo_line
 
  - debug: 
      msg: "{{ repo_line.stdout }}"
       
  - name: add postgresql repo 
    apt_repository:
      repo: "{{ repo_line.stdout }}"
      state: present
    become: true
 
  - name: install postgresql
    apt:
      name: "postgresql-{{postgresql_version}}"
      state: present
      update_cache: yes
    become: true
Comment

PREVIOUS NEXT
Code Example
Shell :: docker save in windows 
Shell :: git force sync with remote 
Shell :: recover lost file git 
Shell :: search by commit message 
Shell :: reset bash_profile 
Shell :: push code to github repository from command line 
Shell :: tailwindcss cli 
Shell :: split string in shell script 
Shell :: bash list processes mac 
Shell :: install neo4j latest version ubuntu 
Shell :: epub linux reader 
Shell :: windows vpn service 
Shell :: linux cmd uninstall 
Shell :: git syntax 
Shell :: npm uninstall 
Shell :: cmd find file dir 
Shell :: httpd ssl docker 
Shell :: gif to webm ffmpeg 
Shell :: iptables deny all 
Shell :: nim install 
Shell :: powershell check if user is admin 
Shell :: ext-dom missing ubuntu 
Shell :: ubuntu openvpn client 
Shell :: list all gpg keys ubuntu 
Shell :: how to install docker on Debian 10 
Shell :: crontab command not found 
Shell :: ubuntu download file from url 
Shell :: chocolatey installation 
Shell :: bash how to remove the first n lines of a file 
Shell :: git remove all branches except master windows 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =