mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
b3b01bb7a3
If I create a database from scratch and assign permissions by doing: - name: ensure database is created action: postgresql_db db=$dbname - name: ensure django user has access action: postgresql_user db=$dbname user=$dbuser priv=ALL password=$dbpassword Then it fails with the error: File "/tmp/ansible-1347048449.32-29998829936529/postgresql_user", line 565, in <module> main() File "/tmp/ansible-1347048449.32-29998829936529/postgresql_user", line 273, in main changed = grant_privileges(cursor, user, privs) or changed File "/tmp/ansible-1347048449.32-29998829936529/postgresql_user", line 174, in grant_privileges changed = grant_func(cursor, user, name, privilege)\ File "/tmp/ansible-1347048449.32-29998829936529/postgresql_user", line 132, in grant_database_privilege prev_priv = get_database_privileges(cursor, user, db) File "/tmp/ansible-1347048449.32-29998829936529/postgresql_user", line 118, in get_database_privileges r = re.search('%s=(C?T?c?)/[a-z]+\,?' % user, datacl) File "/usr/lib/python2.7/re.py", line 142, in search return _compile(pattern, flags).search(string) TypeError: expected string or buffer This fix fixes the problem by not executing the regex if the db query on pg_database returns None. |
||
---|---|---|
.. | ||
apt | ||
apt_repository | ||
assemble | ||
async_status | ||
async_wrapper | ||
authorized_key | ||
command | ||
copy | ||
easy_install | ||
facter | ||
fetch | ||
file | ||
get_url | ||
git | ||
group | ||
lineinfile | ||
mount | ||
mysql_db | ||
mysql_user | ||
nagios | ||
ohai | ||
ping | ||
pip | ||
postgresql_db | ||
postgresql_user | ||
raw | ||
seboolean | ||
selinux | ||
service | ||
setup | ||
shell | ||
slurp | ||
subversion | ||
supervisorctl | ||
template | ||
user | ||
virt | ||
wait_for | ||
yum |