ansible / lightbulb

Lightbulb has been deprecated and replaced by Ansible Workshops
https://ansible.github.io/workshops/
MIT License
480 stars 307 forks source link

Instructor inventory artifacts for larger courses #329

Closed liquidat closed 6 years ago

liquidat commented 6 years ago

When a course with more than 10 users, the instructors inventory has artifacts: the student 1 list does not only contain hosts for student 1, but for student 1, student 11, student 12, etc. The same is true for student 2 which also contains the hosts for student 20, 21, etc.

[student1]
student1-ansible ansible_host=xx.xx.xx.xx ansible_user=centos
student1-node1 ansible_host=xx.xx.xx.xx ansible_user=centos
student1-node2 ansible_host=xx.xx.xx.xx ansible_user=centos
student1-node3 ansible_host=xx.xx.xx.xx ansible_user=centos
student10-ansible ansible_host=xx.xx.xx.xx ansible_user=centos
student10-node1 ansible_host=xx.xx.xx.xx ansible_user=centos
student10-node2 ansible_host=xx.xx.xx.xx ansible_user=centos
student10-node3 ansible_host=xx.xx.xx.xx ansible_user=centos
student11-ansible ansible_host=xx.xx.xx.xx ansible_user=centos
student11-node1 ansible_host=xx.xx.xx.xx ansible_user=centos
student11-node2 ansible_host=xx.xx.xx.xx ansible_user=centos
student11-node3 ansible_host=xx.xx.xx.xx ansible_user=centos
[student2]

It seems that the template generator does not properly filter the students.

rndmh3ro commented 6 years ago

I guess the problem here is that you use student1 instead of student01. Does this still happen when you use student01?

liquidat commented 6 years ago

@rndmh3ro Ah, of course - thanks!

tima commented 6 years ago

FWIW @liquidat, this is #114. I think we could handle not having a leading zero better in the template.

liquidat commented 6 years ago

@tima A, I missed that one. Good to know!