oravirt / ansible-oracle-modules

Oracle modules for Ansible
MIT License
214 stars 160 forks source link

re-runnign oracle_user module returns error #70

Open gsirvas opened 6 years ago

gsirvas commented 6 years ago

Hi, I started testing your modules today and I created a simple test to create a user. Running the playbook runs successfully and creates the user, but when I re-run the playbook with no change the playbook returns ""msg": "ORA-01031: insufficient privileges: sql: select password from sys.user$ where name = upper('dbauser2')""

Here is my playbook


I executed the query "select password from sys.user$ where name = upper('dbauser2')" as sys and it runs succesfully.

Is there additional setup needed that I'm missing?

oravirt commented 6 years ago

You need to run the play as sys as well. You're running as system: user: system

Also, I'm not sure this will be idempotent for 12.2/18.3 as they way the hashed passwords are stored has changed. It will probably always return as changed.

(you could also set update_password: on_create if you don't want to maintain the password after the initial run)