diff --git a/playbooks/bootstrap/roles/users/tasks/main.yaml b/playbooks/bootstrap/roles/users/tasks/main.yaml index aaa5570..d956ff1 100644 --- a/playbooks/bootstrap/roles/users/tasks/main.yaml +++ b/playbooks/bootstrap/roles/users/tasks/main.yaml @@ -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 diff --git a/playbooks/bootstrap/roles/users/vars/debian.yaml b/playbooks/bootstrap/roles/users/vars/debian.yaml new file mode 100644 index 0000000..711019a --- /dev/null +++ b/playbooks/bootstrap/roles/users/vars/debian.yaml @@ -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 diff --git a/playbooks/bootstrap/roles/users/vars/redhat.yaml b/playbooks/bootstrap/roles/users/vars/redhat.yaml new file mode 100644 index 0000000..9413dbe --- /dev/null +++ b/playbooks/bootstrap/roles/users/vars/redhat.yaml @@ -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