#384 manage.py alter_user --admin should be idempotent (for ansible)
Closed: Won't fix 4 years ago by praiskup. Opened 5 years ago by msuchy.

From email communication:

On 09/07/2018 08:33 AM, Miroslav Suchý wrote:

Dne 7.9.2018 v 07:55 Mikolaj Izdebski napsal(a):

  • # FIXME mizdebsk 2018-09-07: This task is currently disabled because
  • # admin status should be treated as application data and does not
  • # need to be Ansible-managed. If it really needs to stay in Ansible
  • # then 1) the task shoud be fixed not to report changes and 2) it
  • # should allow setting different admins for staging and production.
  • name: set up admins
    command: ./manage.py alter_user --admin {{ item }}
    become: yes
    become_user: copr-fe
    args:
    chdir: /usr/share/copr/coprs_frontend/
  • when: False
  • when: not 'admin status is application data, not config'
    with_items:
  • msuchy
  • sgallagh
    @@ -70,10 +79,13 @@
  • nb
  • kevin

In fact, this should be probably set by some {host,group}_var. But still in Ansible playbook, where else you would like
to have it?

Personally I consider admin status as Copr data, it is stored in
database, so IMHO it doesn't need to be in Ansible.

But I'm fine with keeping it Ansible (with admin lists moved to group
vars), but it should be fixed to:
1. detect and report changes made - IIRC currently the script always
returns 0 and prints nothing, no matter whether the change was made or
not, so upstream change is probably needed,
2. handle cases where user does not exist in database,
3. handle cases where database was not initialized yet (initial install)
4. revoke admin status when user is removed from the list in ansible


Metadata Update from @msuchy:
- Issue tagged with: bug

5 years ago

By idempotent you mean that the ansible output should be "green", not "yellow" when executing the ansible task, right?

We decided to drop this from ansible entirely.

Metadata Update from @praiskup:
- Issue close_status updated to: Won't fix
- Issue status updated to: Closed (was: Open)

4 years ago

Login to comment on this ticket.

Metadata