I think I need another pair of eyes here. I am attempting to run a dict of 
users through an ipa user-add command, but it fails with the error 
"with_dict expects a dict." I believe I have formatted my dict correctly 
(it's about 40,000 lines long, generated from a python3 script): 

---
students:
  username1:
      lastname: jibberish
      firstname: jibberish
      firstinitial: jibberish
      studentid: jibberish
      dob: jibberish
      dateexpires: 2018-06-19
      epochexpiry: 1529415778
      uid: jibberish
      passwordhash: "jibberish"
  username2:
      lastname: jibberish
      firstname: jibberish
      firstinitial: jibberish
      studentid: jibberish
      dob: jibberish
      dateexpires: 2018-06-19
      epochexpiry: 1529416593
      uid: jibberish
      passwordhash: "jibberish"
  username3:
      lastname: jibberish
      firstname: jibberish
      firstinitial: jibberish
      studentid: jibberish
      dob: jibberish
      dateexpires: 2018-06-19
      epochexpiry: 1529416755
      uid: jibberish
      passwordhash: "jibberish"

And here is the play where I am trying to use it: 
  - name: Add existing student users to ipaserver
    command: "/bin/ipa user-add 
            {{ item.key }} 
            --first='{{ item.value.firstname }}'
            --last='{{ item.value.lastname }}'
            --cn='{{item.value.firstname}} {{item.value.lastname}}'
            --email={{ item.value.name }}@stu.parkland.edu
            --shell=/bin/bash
            --homedir='/home/students/{{ item.value.firstinitial }}/{{ 
item.key }}'
            --uid='{{ item.value.uid }}'
            --gidnumber='{{ item.value.uid }}'
            --skeleton=/etc/skel
            --setattr userpassword='{crypt}{{ item.value.passwordhash}}'
            --title=student"
    with_dict: "{{students}}"
    register: added_students

And the error:
TASK [Add existing student users to ipaserver] 
*********************************
fatal: [216.125.253.133]: FAILED! => {"failed": true, "msg": "with_dict 
expects a dict"}
Running it verbose only gives me the task path in addition to the above 
error.

Is there a maximum size a dict can be? Is there something else wrong with 
my dict? I have tried it as a list (with a -<space> before each username 
and with_items in the play), but got a unicode error. I'm stumped.

Thanks for taking a look!
Joanna

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/02e4155e-9086-4cee-85e4-37e1b62e9132%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to