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

Fix item has no attribute error #9

Merged
merged 1 commit into from
Dec 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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