<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Bug report</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">ansible 1.7.0</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">OSX Mavericks 10.9.4</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">When running against an AWS RDS Postgresql instance, the postgres_user module can't set up new users.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">Run this task:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: Ensure user has access to the database
  postgresql_user: login_host={{ db_host }}
                   port={{ db_port }}
                   login_user={{ db_admin_user }}
                   login_password={{ db_admin_password }}
                   db={{ db_name }}
                   name={{ db_user }}
                   password={{ db_password }}
                   priv=ALL
                   state=present "><pre class="notranslate"><code class="notranslate">- name: Ensure user has access to the database
  postgresql_user: login_host={{ db_host }}
                   port={{ db_port }}
                   login_user={{ db_admin_user }}
                   login_password={{ db_admin_password }}
                   db={{ db_name }}
                   name={{ db_user }}
                   password={{ db_password }}
                   priv=ALL
                   state=present 
</code></pre></div>
<h5 dir="auto">Expected Results:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ok: [...] =&gt; {&quot;changed&quot;: true, &quot;db&quot;: &quot;database&quot;}"><pre class="notranslate"><code class="notranslate">ok: [...] =&gt; {"changed": true, "db": "database"}
</code></pre></div>
<h5 dir="auto">Actual Results:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="failed: [...] =&gt; {&quot;failed&quot;: true, &quot;parsed&quot;: false}
invalid output was: SUDO-SUCCESS-qwpjepgvenunnlewzwjddpnrbfjyptxo
Traceback (most recent call last):
  File &quot;/home/ubuntu/.ansible/tmp/ansible-tmp-1407775799.05-32923950289495/postgresql_user&quot;, line 1869, in &lt;module&gt;
    main()
  File &quot;/home/ubuntu/.ansible/tmp/ansible-tmp-1407775799.05-32923950289495/postgresql_user&quot;, line 497, in main
    changed = user_alter(cursor, module, user, password, role_attr_flags, encrypted, expires)
  File &quot;/home/ubuntu/.ansible/tmp/ansible-tmp-1407775799.05-32923950289495/postgresql_user&quot;, line 201, in user_alter
    cursor.execute(select, {&quot;user&quot;: user})
psycopg2.ProgrammingError: permission denied for relation pg_authid"><pre class="notranslate"><code class="notranslate">failed: [...] =&gt; {"failed": true, "parsed": false}
invalid output was: SUDO-SUCCESS-qwpjepgvenunnlewzwjddpnrbfjyptxo
Traceback (most recent call last):
  File "/home/ubuntu/.ansible/tmp/ansible-tmp-1407775799.05-32923950289495/postgresql_user", line 1869, in &lt;module&gt;
    main()
  File "/home/ubuntu/.ansible/tmp/ansible-tmp-1407775799.05-32923950289495/postgresql_user", line 497, in main
    changed = user_alter(cursor, module, user, password, role_attr_flags, encrypted, expires)
  File "/home/ubuntu/.ansible/tmp/ansible-tmp-1407775799.05-32923950289495/postgresql_user", line 201, in user_alter
    cursor.execute(select, {"user": user})
psycopg2.ProgrammingError: permission denied for relation pg_authid
</code></pre></div>
<p dir="auto">Apparently the <code class="notranslate">pg_authid</code> relation <a href="https://forums.aws.amazon.com/thread.jspa?threadID=151248" rel="nofollow">is not available in RDS</a>.</p>
<p dir="auto">Possible workaround: if access denied for <code class="notranslate">pg_authid</code>, then always set the password.</p>
<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Bug report</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">ansible 1.7.0</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">OSX Mavericks 10.9.4</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">When running against an AWS RDS Postgresql instance, the postgres_user module can't set up new users.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<p dir="auto">Run this task:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: Ensure user has access to the database
  postgresql_user: login_host={{ db_host }}
                   port={{ db_port }}
                   login_user={{ db_admin_user }}
                   login_password={{ db_admin_password }}
                   db={{ db_name }}
                   name={{ db_user }}
                   password={{ db_password }}
                   priv=ALL
                   state=present "><pre class="notranslate"><code class="notranslate">- name: Ensure user has access to the database
  postgresql_user: login_host={{ db_host }}
                   port={{ db_port }}
                   login_user={{ db_admin_user }}
                   login_password={{ db_admin_password }}
                   db={{ db_name }}
                   name={{ db_user }}
                   password={{ db_password }}
                   priv=ALL
                   state=present 
</code></pre></div>
<h5 dir="auto">Expected Results:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ok: [...] =&gt; {&quot;changed&quot;: true, &quot;db&quot;: &quot;database&quot;}"><pre class="notranslate"><code class="notranslate">ok: [...] =&gt; {"changed": true, "db": "database"}
</code></pre></div>
<h5 dir="auto">Actual Results:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="failed: [...] =&gt; {&quot;failed&quot;: true, &quot;parsed&quot;: false}
invalid output was: SUDO-SUCCESS-qwpjepgvenunnlewzwjddpnrbfjyptxo
Traceback (most recent call last):
  File &quot;/home/ubuntu/.ansible/tmp/ansible-tmp-1407775799.05-32923950289495/postgresql_user&quot;, line 1869, in &lt;module&gt;
    main()
  File &quot;/home/ubuntu/.ansible/tmp/ansible-tmp-1407775799.05-32923950289495/postgresql_user&quot;, line 497, in main
    changed = user_alter(cursor, module, user, password, role_attr_flags, encrypted, expires)
  File &quot;/home/ubuntu/.ansible/tmp/ansible-tmp-1407775799.05-32923950289495/postgresql_user&quot;, line 201, in user_alter
    cursor.execute(select, {&quot;user&quot;: user})
psycopg2.ProgrammingError: permission denied for relation pg_authid"><pre class="notranslate"><code class="notranslate">failed: [...] =&gt; {"failed": true, "parsed": false}
invalid output was: SUDO-SUCCESS-qwpjepgvenunnlewzwjddpnrbfjyptxo
Traceback (most recent call last):
  File "/home/ubuntu/.ansible/tmp/ansible-tmp-1407775799.05-32923950289495/postgresql_user", line 1869, in &lt;module&gt;
    main()
  File "/home/ubuntu/.ansible/tmp/ansible-tmp-1407775799.05-32923950289495/postgresql_user", line 497, in main
    changed = user_alter(cursor, module, user, password, role_attr_flags, encrypted, expires)
  File "/home/ubuntu/.ansible/tmp/ansible-tmp-1407775799.05-32923950289495/postgresql_user", line 201, in user_alter
    cursor.execute(select, {"user": user})
psycopg2.ProgrammingError: permission denied for relation pg_authid
</code></pre></div>
<p dir="auto">Apparently the <code class="notranslate">pg_authid</code> relation <a href="https://forums.aws.amazon.com/thread.jspa?threadID=151248" rel="nofollow">is not available in RDS</a>.</p>
<p dir="auto">Possible workaround: if access denied for <code class="notranslate">pg_authid</code>, then always set the password.</p>