David, Thank you for the feedback. I will look into this and see if it is a limitation of the API, pyrax or where ever else. If I can find a solution I'll look into applying a fix.
On Wed, Jan 14, 2015 at 11:20 AM, David Goodall <[email protected]> wrote: > Thank you Matt. > I made the change you suggested but still get the same result with no > extra information. > I then tried a db username with no special characters and it works fine - > sorry, I should have tried this first. > > Here is the db username that doesn't work: > S+%{r.46Z?f_*JuB > The module can create a user with this name OK, but it fails on the 2nd > run. > Not a problem for me at the moment as we will just use a different name. > > Thanks again for your help. > Best regards, > David > > On Wednesday, January 14, 2015 at 4:21:47 PM UTC, Matt Martz wrote: >> >> I have been unable to duplicate this issue. The code in place in >> rax_cdb_user tries to perform a `instance.get_user` on the username. If >> the username exists the user object is returned. If an Exception is >> raised, the function returns False and the module attempts to create the >> user. >> >> In your case, it sounds like the user does exist, but an Exception is >> being raised for some reason, that does not indicate the absence of a >> user. You could try to make the following change to rax_cdb_user.py (which >> I may do anyway): >> >> https://gist.github.com/sivel/3b41dd88147f7d99cab2 >> >> If that raises some other error, it might help track down why that user >> cannot be found on the instance. >> >> On Wed, Jan 14, 2015 at 8:31 AM, David Goodall <[email protected]> >> wrote: >> >>> Hi, >>> >>> Using Tower 2.1 I have a playbook which creates a stack including a >>> Cloud DB instance, user and DB. >>> This works fine, but on running the playbook again, it fails with: >>> msg: A user with the name "xxxxxxxxxx" already exists. >>> (The username has special characters if that's any help). >>> >>> I've pasted the YAML for creating the DB and user below - am I missing >>> something obvious or is this module not idempotent? >>> >>> Best regards, >>> David >>> >>> - name: Create cloud DB server >>> rax_cdb: >>> credentials: ~/.rax.creds >>> region: LON >>> name: "{{ db_server }}" >>> flavor: 1 >>> volume: 2 >>> wait: yes >>> state: present >>> register: rax_db_server >>> >>> - name: Create cloud DB >>> rax_cdb_database: >>> credentials: ~/.rax.creds >>> region: LON >>> cdb_id: "{{rax_db_server.cdb.id}}" >>> name: "{{ db_name }}" >>> state: present >>> register: rax_db_database >>> >>> - name: Create cloud DB user >>> rax_cdb_user: >>> credentials: ~/.rax.creds >>> region: LON >>> cdb_id: "{{rax_db_server.cdb.id}}" >>> db_username: "{{ db_user }}" >>> db_password: "{{ db_password }}" >>> databases: >>> - "{{rax_db_database.database.name}}" >>> state: present >>> register: rax_db_user >>> >>> -- >>> 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 [email protected]. >>> To post to this group, send email to [email protected]. >>> To view this discussion on the web visit https://groups.google.com/d/ >>> msgid/ansible-project/a860e219-6775-43e6-9b85- >>> b95a0e8e20c4%40googlegroups.com >>> <https://groups.google.com/d/msgid/ansible-project/a860e219-6775-43e6-9b85-b95a0e8e20c4%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Matt Martz >> @sivel >> sivel.net >> > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/f3878188-48f4-4388-b6be-d3fea48f2643%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/f3878188-48f4-4388-b6be-d3fea48f2643%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Matt Martz @sivel sivel.net -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAD8N0v9vEyKxT_TRY-1OeG6ALhqRd_V6%2BYuS4P7i%3DgB6ip5rgg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
