瀏覽代碼

ansible: add removable_media.yml, not works

pull/1/head
10sr 10 年之前
父節點
當前提交
17656f55d7
共有 2 個檔案被更改,包括 21 行新增0 行删除
  1. +5
    -0
      ansible/enable-mount.rules.polkit
  2. +16
    -0
      ansible/removable_media.yml

+ 5
- 0
ansible/enable-mount.rules.polkit 查看文件

@@ -0,0 +1,5 @@
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.udisks2.filesystem-mount-system" && subject.isInGroup("storage")) {
return polkit.Result.YES;
}
});

+ 16
- 0
ansible/removable_media.yml 查看文件

@@ -0,0 +1,16 @@
---
# do not forget to add lxpolkit to autostart!
- hosts: all
vars:
packages: [gvfs, gvfs-afc, polkit, lxpolkit]
sudo: yes
tasks:
- name: install packages
pacman: name={{item}} state=installed
with_items: packages
when: ansible_os_family == "Archlinux"
- name: add user yuk to storage group
user: append=yes groups=storage name=yuk
- name: put polkit rule for mount by storage group
copy: src=enable-mount.rules.polkit
dest=/etc/polkit-1/rules.d/10-enable-mount.rules

Loading…
取消
儲存