Hi, i am having a problem in setting up postgresql through ansible.

Error::-
----------


 Peer authentication failed for user "postgres". I checked google, i found 
people as saying i need to use become and become_user: postgress. But even 
after doing that i am getting, that those are not valid attribute .

My code is :: 
-----------------

- name: Install Postgress 9.5 Version and its dependencies 
  apt:
    name: "{{ item }}"
    update_cache: yes
    cache_valid_time: 3600

  with_items:

    - postgresql
    - libpq-dev 
    - python-psycopg2
    - postgresql-client-common
    - postgresql-contrib
 

- name: Make change in postgresql.conf file 
  template:
    src: postgresql_conf.jinja2
    dest: /etc/postgresql/9.5/main/postgresql.conf
    mode: 0644
    owner: postgres
    group: postgres 


- name: Daemon-Reload for Postgress
  systemd:
    state: restarted
    daemon-reload: yes 
    name: postgresql

- name: create a new postgresql Database
  postgresql_db:
    name: "{{ my_db_name }}"
    # become: true 
    # become_user: postgres


- name: Create Postgress User 
  postgresql_user:
    name: "{{ my_db_create_name }}"
    password: "{{ my_db_password }}"
    priv: "CONNECT/products:ALL"
    # become: true 
    # become_user: postgres
 

- name: Ensuring no other user have Database Access
  postgresql_privs:
    db: "{{ my_db_create_name }}"
    role: PUBLIC
    type: database 
    priv: ALL
    state: absent  
    # become: true 
    # become_user: postgres


Can anyone help me ?




-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/73a68e87-b064-4b7a-b3ac-047293aceccf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to