Update users role to support redhat

TIL: sudo doesn't exist on Fedora, it is wheel.

Change-Id: I417afa2d871e8f7de49be6a7b02e1ccd1e10bcef
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2019-03-16 19:54:20 -04:00
parent 9f5bab1863
commit 32334f78db
3 changed files with 35 additions and 2 deletions

View File

@ -12,6 +12,9 @@
# License for the specific language governing permissions and limitations
# under the License.
---
- name: Include OS-specific variables
include_vars: "{{ ansible_os_family | lower }}.yaml"
- name: Create windmill_users group
become: true
group:
@ -25,7 +28,7 @@
user:
name: "{{ item }}"
group: "{{ windmill_users[item].gid }}"
groups: sudo
groups: "{{ __windmill_users_sudo_group }}"
shell: /bin/bash
uid: "{{ windmill_users[item].uid }}"
with_items: "{{ windmill_root_users }}"
@ -42,5 +45,5 @@
- name: Disable password for sudo users
become: true
copy:
content: "%sudo ALL=(ALL) NOPASSWD: ALL"
content: "%{{ __windmill_users_sudo_group }} ALL=(ALL) NOPASSWD: ALL"
dest: /etc/sudoers.d/sudo

View File

@ -0,0 +1,15 @@
# Copyright 2019 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
---
__windmill_users_sudo_group: sudo

View File

@ -0,0 +1,15 @@
# Copyright 2019 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
---
__windmill_users_sudo_group: wheel