Project scenario:
Today I used Ansible to install postgresql-13 and wrote the following test script from the official installation tutorial.
- hosts: postgresql
gather_facts: false
tasks:
- name: install pg repo
yum:
name: https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
state: present
- name: install pg
yum:
name: postgresql13-server
state: present
- name:
stat:
path: "/var/lib/pgsql/data/pg_hba.conf"
register: postgres_data
- name:
shell: "/usr/pgsql-13/bin/postgresql-13-setup initdb"
when: not postgres_data.stat.exists
- name:
systemd:
name: postgresql-13
enabled: yes
daemon_reload: yes
state: started
Problem Description:
the following error occurs when running the script:
fatal: [172.17.200.2]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "msg": "Failure downloading https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm, Request failed: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)>"}
Solution:
Just modify https
to http
in https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
Read More:
- [Solved] CentOS Use Yum to install dependency: error: rpmdb open failed
- WARNING: Download failure <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed
- [Solved] Yum Install Software Error: Invalid configuration value: failovermethod=priority…
- Ubuntu 20.04 Desktop Install sublime-text Error: “Certificate verification failed”
- yum: Error: Failed to download metadata for repo ‘aliyun-AppStream‘: Cannot download repomd.xml
- [Solved] yum Install rpmdb Error: error: rpmdb: BDB0113 failed: BDB1507 Thread died in Berkeley DB library
- [Solved] Ubuntu Update source error: Certificate verification failed: The certificate is NOT trusted.
- [Solve] Yinhe Qilin V10 System Error: Failed to download metadata for repo ‘ks10-adv-os‘
- [Solved] yum Command Error: Error: Failed to download metadata for repo ‘appstream‘
- [Solved] yum Install gcc Error: Error: Package: glibc-headers-2.17-317.el7.x86_64
- [Solved] Docker Install Error: [Errno 14] curl#60 – Peer‘s Certificate issuer is not recognized
- Linux yum Error: All mirror URLs are not using ftp
- [Solved] Linux – error: cannot open Packages database in /var/lib/rpm
- [Solved] Clone Linux Code Error: server certificate verification failed. CAfile: none CRLfile: none
- [Solved] Ubuntu Compile Rust Program Error: failed to run custom build command for openssl-sys v0.9.39
- How to Solve Yum Error: db5 error(30973)
- Yum source error: [errno 14] HTTP Error 404 – not found
- yum Error: rpmdb open failed [How to Solve]
- Initializing the Kubernetes master node ERROR: failed to pull image registry.aliyuncs.com/google_containers/coredns:v1.8.0
- [Solved] YUM Error: error: rpmdb: BDB0113 Thread/process 11498/140107732375616 failed