Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #9 from andrazk/fix/with-items
Browse files Browse the repository at this point in the history
Fix item has no attribute error
  • Loading branch information
mattwillsher authored Dec 21, 2016
2 parents 20faa24 + c44f164 commit d179aac
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tasks/add_groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
state: "{{ item.state | default('present') }}"
gid: "{{ item.gid | default(omit) }}"
system: "{{ item.system | default(omit) }}"
with_items: users_groups
with_items: "{{ users_groups }}"
when: item.state|default('present') != "absent"

- name: Create per-user groups
Expand All @@ -14,7 +14,7 @@
state: "{{ item.state | default('present') }}"
gid: "{{ item.gid | default(item.uid) | default(omit) }}"
system: "{{ item.system | default(omit) }}"
with_items: users
with_items: "{{ users }}"
when: >
users_per_user_groups == true and
item.state|default('present') != 'absent'
2 changes: 1 addition & 1 deletion tasks/remove_groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
group:
name: "{{ item.name }}"
state: absent
with_items: users
with_items: "{{ users }}"
when: >
users_per_user_groups == true and
item.state|default('present') == 'absent' and
Expand Down
2 changes: 1 addition & 1 deletion tasks/ssh_keys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
user='{{ item.0.name }}'
key='{{ item.1 }}'
with_subelements:
- users_ssh_keys
- "{{ users_ssh_keys }}"
- keys
4 changes: 2 additions & 2 deletions tasks/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
createhome: '{{ item.createhome|default(users_create_homedirs) }}'
system: '{{ item.system | default(omit) }}'
append: yes
with_items: users
with_items: "{{ users }}"
when: >
not ( item.name == ansible_ssh_user and
item.state|default('present') == 'absent' )
Expand All @@ -24,7 +24,7 @@
state: '{{ item.state | default("present") }}'
groups: '{{ users_admin_group }}'
append: yes
with_items: users
with_items: "{{ users }}"
when: >
item.is_admin is defined and
item.is_admin == true

0 comments on commit d179aac

Please sign in to comment.