- name: copy grouper provision script for mujina
  copy: src={{ item }} dest=~/{{ item }}
  with_items:
    - add-mujina-user.gsh

- name: use correct grouper config
  template: src={{ item.src }}.j2 dest=/opt/www/grouper.apiBinary-2.1.5/conf/{{ item.dest }}
  with_items:
    - { src: sources-grouper-shell.xml, dest: sources.xml }

- name: provision grouper with users
  shell: bin/gsh ~/{{ item }}
  register: gsh_output
  changed_when: "'auto-created' in gsh_output.stderr"
  failed_when: gsh_output.stderr != '' and ("already exists" not in gsh_output.stderr and "auto-created" not in gsh_output.stderr)
  args:
    chdir: /opt/www/grouper-shell
  with_items:
    - add-mujina-user.gsh

- name: copy grouper provision script for mujina
  copy: src={{ item }} dest=~/{{ item }}
  with_items:
    - add-mujina-user.gsh

- name: provision grouper with users
  shell: bin/gsh ~/{{ item }}
  register: gsh_output
  changed_when: "'auto-created' in gsh_output.stderr"
  failed_when: gsh_output.stderr != '' and ("already exists" not in gsh_output.stderr and "auto-created" not in gsh_output.stderr)
  args:
    chdir: /opt/www/grouper-shell
  with_items:
    - add-mujina-user.gsh

Remove grouper sources.xml provisioning. This is already done in the grouper role
Mujina-idp: Remove grouper sources.xml provisioning. This is already done in the grouper role
