2017-10-04 11 views
0

: 적절한 이름의 데이터베이스가 생성됩니다피어 인증은 사용자와 사용 psql의 실패와 ansible postgresql_user로 만든 DB ansible <code>postgresql_user</code> 내 사용을 잘못 무엇

- name: Create user and grant access to the database 
    become_user: postgres 
    become: yes 
    postgresql_user: 
     db: '{{db_name}}' 
     name: '{{db_user}}' 
     password: '{{db_password}}' 
     priv: ALL 
     state: present 

내가 psql의 인 그레스의 사용자를 입력 :

        List of databases 
    Name | Owner | Encoding | Collate | Ctype | Access privileges 
------------+----------+----------+-------------+-------------+----------------------- 
app-andi | postgres | UTF8  | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres   + 
      |   |   |    |    | postgres=CTc/postgres+ 
      |   |   |    |    | andi=CTc/postgres 
postgres | postgres | UTF8  | en_US.UTF-8 | en_US.UTF-8 | 
template0 | postgres | UTF8  | en_US.UTF-8 | en_US.UTF-8 | =c/postgres   + 
      |   |   |    |    | postgres=CTc/postgres 
template1 | postgres | UTF8  | en_US.UTF-8 | en_US.UTF-8 | =c/postgres   + 
      |   |   |    |    | postgres=CTc/postgres 
(4 rows) 

문제 :

,691 :에

시도 사용

psql: FATAL: Peer authentication failed for user "andi"

: ansible 2.3.1.0 방랑 1.9.4

DOCS : http://docs.ansible.com/ansible/latest/postgresql_user_module.html

psql -d "app-andi" -U andi -W

과이 암호는 내가 끝낼 ansible 변수에 주어진 제공하는 단계

https://www.postgresql.org/docs/9.2/static/app-psql.html

답변

0

문제는 완전히 관련이없는 관련이있었습니다.

그냥 같이 연결합니다

psql -d "app-andi" -U andi -W -h 127.0.0.1