Fixing pulseaudio placement and call on cron.
This commit is contained in:
parent
6eb1feb649
commit
ab62cb85a3
@ -1,27 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
domaingroup="domain users"
|
||||
localgroups="pulse pulse-access"
|
||||
|
||||
baseusers="bglug"
|
||||
domainusers="$(getent group "${domaingroup}" | awk 'BEGIN { FS = ":" } ; { print $4 }' | sed -e 's/,/ /g')"
|
||||
|
||||
users="${baseusers} ${domainusers}"
|
||||
|
||||
for group in ${localgroups}; do
|
||||
actualusers=$(getent group '${group}' | awk 'BEGIN { FS = ":" }; { print $4 }' | sed -e 's/,/ /g')
|
||||
|
||||
# Removing users not in the group
|
||||
for user in ${actualusers}; do
|
||||
whuser=${user//[[:space:]]/}
|
||||
echo "removing ${user}"
|
||||
[[ "${users}" =~ "${whuser}" ]] || gpasswd -d "${whuser}" "${group}"
|
||||
unset whuser
|
||||
done
|
||||
|
||||
# Adding users to group
|
||||
for user in ${users}; do
|
||||
whuser=${user//[[:space:]]/}
|
||||
[[ "${actualusers}" =~ "${whuser}" ]] || gpasswd -a "${whuser}" "${group}"
|
||||
done
|
||||
done
|
@ -35,10 +35,10 @@
|
||||
- pkgs
|
||||
- packages
|
||||
|
||||
- include: audio.yml
|
||||
tags:
|
||||
- base
|
||||
- audio
|
||||
#- include: audio.yml
|
||||
# tags:
|
||||
# - base
|
||||
# - audio
|
||||
|
||||
- include: system.yml
|
||||
tags:
|
||||
|
@ -26,18 +26,9 @@
|
||||
shell: chmod -x /usr/bin/start-pulseaudio-x11
|
||||
sudo: yes
|
||||
|
||||
# Need to manage additions to pulse and pulse-access groups
|
||||
- name: Copying script to manage users in pulse and pulse-access
|
||||
copy:
|
||||
src: pulseaudio-perms.sh
|
||||
dest: '/var/lib/{{ ansible_local.domain.domainfull }}/bin/pulseaudio-perms.sh'
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
- name: Adding pulseaudio fixing script at reboot.
|
||||
lineinfile:
|
||||
line: '@reboot root /var/lib/{{ ansible_local.domain.domainfull }}/bin/pulseaudio-perms.sh >/dev/null 2>&1'
|
||||
line: '@reboot root curl -sSL http://{{ ansible_local.domain.serverfqdn }}/ks/preseed/pulseaudio-perms.sh | bash >/dev/null 2>&1'
|
||||
dest: /etc/cron.d/pulseaudio-perms
|
||||
create: yes
|
||||
state: present
|
@ -11,6 +11,11 @@
|
||||
- domain
|
||||
- nss
|
||||
|
||||
- include: audio.yml
|
||||
tags:
|
||||
- domain
|
||||
- audio
|
||||
|
||||
- include: gui-changes.yml
|
||||
tags:
|
||||
- domain
|
||||
|
Loading…
x
Reference in New Issue
Block a user