Skip to content
This repository has been archived by the owner on Sep 10, 2020. It is now read-only.

Simplifies group membership update task #90

Merged
merged 1 commit into from
Nov 30, 2016
Merged
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
16 changes: 2 additions & 14 deletions roles/crawler/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,12 @@
name: "{{ fpsd_crawler_system_account }}"
system: yes

# Necessary because the user module is not idempotent.
- name: List what groups each user is in.
command: "groups {{ item }}"
with_items: "{{ fpsd_crawler_system_account }}"
register: groups_result
always_run: true
changed_when: false

- name: Add users to system group for running crawler.
user:
append: yes
groups: "{{ fpsd_crawler_system_account }}"
name: "{{ item.1 }}"
when: "fpsd_crawler_system_account not in item.0.stdout"
with_together:
- "{{ groups_result.results }}"
- "{{ fpsd_database_usernames }}"
failed_when: true
name: "{{ item }}"
with_items: "{{ fpsd_database_usernames }}"

- name: Create project directory.
file:
Expand Down