mrlesmithjr / ansible-guacamole

Ansible role to install/configure Guacamole
MIT License
19 stars 15 forks source link

This role cant handle remote postgres databases #18

Closed nakomoto closed 2 years ago

nakomoto commented 2 years ago

Hi!

In defaults/main.yml you asking for guacamole_postgresql_db.host and guacamole_postgresql_db.port, but you dont use it in the tasks. You are trying to create a local database and this fails because there is no locally installed PostgreSQL

TASK [guacamole-role : config | Creating Guacamole DB] ***********************************************
fatal: [guacamole]: FAILED! => changed=false 
  module_stderr: |-
    Shared connection to 10.10.10.32 closed.
  module_stdout: |-
    sudo: unknown user: postgres
    sudo: error initializing audit plugin sudoers_audit
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1

The same for Creating Guacamole DB User task and Popluating DB task and so on in tasks/config.yml

stefanDeveloper commented 2 years ago

I ran into the same issue, however, I could resolve it by running: sudo apt install postgresql postgresql-client. After that I could use: sudo -u postgres psql

stefanDeveloper commented 2 years ago

My biggest problem was that I ran into the issue the issue:

fatal: [guacamole]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (psycopg2) on guacamole's Python /usr/bin/python3. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"}

I could resolve it by adding the tasks:

- name: install pip3
  apt: name=python3-pip state=present
  become: true

- name: Install psycopg2 for ansible to be able to create postgresql users
  pip: name=psycopg2-binary
  become: true
nakomoto commented 2 years ago

Hello Stefan,

I ran into the same issue, however, I could resolve it by running: sudo apt install postgresql postgresql-client. After that I could use: sudo -u postgres psql

This is not a solution. This is not even a workaround!

Why i should install postgres packages locally, when the PostgreSQL Server is remote and the ansible module can handle remote connections?!?

stefanDeveloper commented 2 years ago

I forgot to mention that I didn't install it locally, I installed it on the expected host where I want to have my postgresql.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.