From 17656f55d788b6fdec4505d4885e20cfbcead5e6 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 30 Jul 2014 15:33:05 +0900 Subject: [PATCH] ansible: add removable_media.yml, not works --- ansible/enable-mount.rules.polkit | 5 +++++ ansible/removable_media.yml | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 ansible/enable-mount.rules.polkit create mode 100644 ansible/removable_media.yml diff --git a/ansible/enable-mount.rules.polkit b/ansible/enable-mount.rules.polkit new file mode 100644 index 0000000..4dd147a --- /dev/null +++ b/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; + } +}); diff --git a/ansible/removable_media.yml b/ansible/removable_media.yml new file mode 100644 index 0000000..9763ff6 --- /dev/null +++ b/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