From 958b647faa96fa8c670e49acabd077f789de993b Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 11 Feb 2018 10:41:35 -0500 Subject: [PATCH 01/12] usb-lib documentation was very stale --- roles/usb-lib/README.rst | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/roles/usb-lib/README.rst b/roles/usb-lib/README.rst index e3ae506cb..db6a62f8c 100644 --- a/roles/usb-lib/README.rst +++ b/roles/usb-lib/README.rst @@ -1,14 +1,20 @@ ============== -USB Lib README +usb-lib README ============== -This role implements Library Box type functionality to mount and link content on a USB drive. +SEE "Can teachers display their own content?" WITHIN http://FAQ.IIAB.IO FOR UP-TO-DATE DOCUMENTATION. + +This role implements LibraryBox-type functionality to mount and link content on a USB drive. + +Users should have nearly immediate access to "teacher content" by browsing to http://box/usb Automount is handled by usbmount and scripts in this role look in the root of the mounted drive for +* /usb +* /USB * /share * /Share -* /PirateShare +* /Piratebox/Share and if found create a symlink of the form /library/content/USBn points to /media/usbn. From 39306ad708aa92e0337d46d7ccb20d4443aec30f Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 11 Feb 2018 10:53:01 -0500 Subject: [PATCH 02/12] Update README.rst --- roles/usb-lib/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/usb-lib/README.rst b/roles/usb-lib/README.rst index db6a62f8c..bad7c3af7 100644 --- a/roles/usb-lib/README.rst +++ b/roles/usb-lib/README.rst @@ -4,7 +4,7 @@ usb-lib README SEE "Can teachers display their own content?" WITHIN http://FAQ.IIAB.IO FOR UP-TO-DATE DOCUMENTATION. -This role implements LibraryBox-type functionality to mount and link content on a USB drive. +This role implements functionality similar to LibraryBox, to mount and link content on a USB drive within /library/www/html/local_content Users should have nearly immediate access to "teacher content" by browsing to http://box/usb From 949d1d98bc8abbe8a68ab4fd22b46dd933c2322e Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 11 Feb 2018 10:54:32 -0500 Subject: [PATCH 03/12] Update README.rst --- roles/usb-lib/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/usb-lib/README.rst b/roles/usb-lib/README.rst index bad7c3af7..fc2508d5c 100644 --- a/roles/usb-lib/README.rst +++ b/roles/usb-lib/README.rst @@ -4,7 +4,7 @@ usb-lib README SEE "Can teachers display their own content?" WITHIN http://FAQ.IIAB.IO FOR UP-TO-DATE DOCUMENTATION. -This role implements functionality similar to LibraryBox, to mount and link content on a USB drive within /library/www/html/local_content +This role implements functionality similar to LibraryBox, to mount content on USB drives, by creating links within /library/www/html/local_content Users should have nearly immediate access to "teacher content" by browsing to http://box/usb From 0d9e4789aaf9afddc3e97706eb6a592fe451cdec Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 11 Feb 2018 11:02:08 -0500 Subject: [PATCH 04/12] Update README.rst --- roles/usb-lib/README.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/roles/usb-lib/README.rst b/roles/usb-lib/README.rst index fc2508d5c..2c60cec5d 100644 --- a/roles/usb-lib/README.rst +++ b/roles/usb-lib/README.rst @@ -4,11 +4,13 @@ usb-lib README SEE "Can teachers display their own content?" WITHIN http://FAQ.IIAB.IO FOR UP-TO-DATE DOCUMENTATION. -This role implements functionality similar to LibraryBox, to mount content on USB drives, by creating links within /library/www/html/local_content +This role implements functionality similar to LibraryBox, to mount "teacher content" on USB drives. -Users should have nearly immediate access to "teacher content" by browsing to http://box/usb +Users should have nearly immediate access to this "teacher content" (on all inserted USB drives) by browsing to http://box/usb -Automount is handled by usbmount and scripts in this role look in the root of the mounted drive for +USB drives must be formatted with one of the iilesystems listed under "FILESYSTEMS=" at /etc/usbmount/usbmount.conf + +Automount is handled by usbmount, and scripts in this role look in the root of the mounted drive for... * /usb * /USB @@ -16,7 +18,7 @@ Automount is handled by usbmount and scripts in this role look in the root of th * /Share * /Piratebox/Share -and if found create a symlink of the form /library/content/USBn points to /media/usbn. +...and if found, create a symlink of the form /library/www/html/local_content/USBn pointing to /media/usbn. There is also a patch for problems with automount on Fedora 21+ From ca62a894d858358b38305c4f8ca9bba9c7d03212 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 11 Feb 2018 11:06:33 -0500 Subject: [PATCH 05/12] Update README.rst --- roles/usb-lib/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/usb-lib/README.rst b/roles/usb-lib/README.rst index 2c60cec5d..2a3bf5d88 100644 --- a/roles/usb-lib/README.rst +++ b/roles/usb-lib/README.rst @@ -18,7 +18,7 @@ Automount is handled by usbmount, and scripts in this role look in the root of t * /Share * /Piratebox/Share -...and if found, create a symlink of the form /library/www/html/local_content/USBn pointing to /media/usbn. +...and if found, creates a symlink of the form /library/www/html/local_content/USBn pointing to /media/usbn. There is also a patch for problems with automount on Fedora 21+ From 11c89162c33868feb2c84ced87ec44e09d1ee401 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 11 Feb 2018 11:07:23 -0500 Subject: [PATCH 06/12] indentation/syntax per new Ansible documentation --- roles/usb-lib/tasks/main.yml | 82 ++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 36 deletions(-) diff --git a/roles/usb-lib/tasks/main.yml b/roles/usb-lib/tasks/main.yml index f0de224a8..066aa92d9 100644 --- a/roles/usb-lib/tasks/main.yml +++ b/roles/usb-lib/tasks/main.yml @@ -1,67 +1,77 @@ - name: Add a content directory for links to be located - file: dest={{ doc_root }}/local_content - state=directory - owner={{ apache_user }} - group={{ iiab_admin_user }} - mode=0775 + file: + dest: "{{ doc_root }}/local_content" + state: directory + owner: "{{ apache_user }}" + group: "{{ iiab_admin_user }}" + mode: 0775 - name: Copy mount file to usbmount when enabled - template: src=mount.d/70-usb-library - dest=/etc/usbmount/mount.d/ - owner=root - group=root - mode=0751 + template: + src: mount.d/70-usb-library + dest: /etc/usbmount/mount.d/ + owner: root + group: root + mode: 0751 when: usb_lib_enabled - name: Copy umount file to usbmount when enabled - template: src=umount.d/70-usb-library - dest=/etc/usbmount/umount.d - owner=root - group=root - mode=0751 + template: + src: umount.d/70-usb-library + dest: /etc/usbmount/umount.d + owner: root + group: root + mode: 0751 when: usb_lib_enabled - name: Remove mount file to usbmount when not enabled - file: path=/etc/usbmount/mount.d/70-usb-library - state=absent + file: + path: /etc/usbmount/mount.d/70-usb-library + state: absent when: not usb_lib_enabled - name: Remove umount file to usbmount when not enabled - file: path=/etc/usbmount/umount.d/70-usb-library - state=absent + file: + path: /etc/usbmount/umount.d/70-usb-library + state: absent when: not usb_lib_enabled - name: Add Apache config for content directory - template: src=content_dir.conf - dest=/etc/{{ apache_config_dir }} + template: + src: content_dir.conf + dest: "/etc/{{ apache_config_dir }}" when: usb_lib_enabled -- name: Create the link to enable for Debian - file: src=/etc/{{ apache_config_dir }}/content_dir.conf - dest=/etc/apache2/sites-enabled/content_dir.conf - state=link +- name: Create the link to enable (debian) + file: + src: "/etc/{{ apache_config_dir }}/content_dir.conf" + dest: /etc/apache2/sites-enabled/content_dir.conf + state: link when: is_debuntu -- name: Remove the link that enables in Debian - file: src=/etc/{{ apache_config_dir }}/content_dir.conf - dest=/etc/apache2/sites-enabled/content_dir.conf - state=absent +- name: Remove the link that enables (debian) + file: + src: "/etc/{{ apache_config_dir }}/content_dir.conf" + dest: /etc/apache2/sites-enabled/content_dir.conf + state: absent when: is_debuntu and not usb_lib_enabled - name: Remove Apache config for content directory - file: name=/etc/{{ apache_config_dir }}/content_dir.conf - state=absent + file: + name: "/etc/{{ apache_config_dir }}/content_dir.conf" + state: absent when: not usb_lib_enabled - name: Add usb-lib to service list - ini_file: dest='{{ service_filelist }}' - section=usb-lib - option='{{ item.option }}' - value='{{ item.value }}' + ini_file: + dest: "{{ service_filelist }}" + section: usb-lib + option: "{{ item.option }}" + value: "{{ item.value }}" with_items: - option: name value: usb-lib - option: description - value: '"usb-lib automounts USB drives and can live-link /library/www/html/local_content to Teachers Content."' + value: '"usb-lib automounts USB drives' Teacher Content within /library/www/html/local_content, so students can browse it almost immediately at http://box/usb"' - option: enabled value: "{{ usb_lib_enabled }}" From 79445ebc73a0b0febaf88108845994d1d9f6798e Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 11 Feb 2018 12:54:31 -0500 Subject: [PATCH 07/12] Update README.rst --- roles/usb-lib/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/usb-lib/README.rst b/roles/usb-lib/README.rst index 2a3bf5d88..9fe3651f4 100644 --- a/roles/usb-lib/README.rst +++ b/roles/usb-lib/README.rst @@ -2,7 +2,7 @@ usb-lib README ============== -SEE "Can teachers display their own content?" WITHIN http://FAQ.IIAB.IO FOR UP-TO-DATE DOCUMENTATION. +PLEASE SEE "Can teachers display their own content?" WITHIN http://FAQ.IIAB.IO FOR UP-TO-DATE DOCUMENTATION. This role implements functionality similar to LibraryBox, to mount "teacher content" on USB drives. From fe6e9b65a743fadf6f39e95a4d0e33db3547765c Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 11 Feb 2018 12:58:15 -0500 Subject: [PATCH 08/12] Update README.rst --- roles/usb-lib/README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/usb-lib/README.rst b/roles/usb-lib/README.rst index 9fe3651f4..479f64357 100644 --- a/roles/usb-lib/README.rst +++ b/roles/usb-lib/README.rst @@ -4,11 +4,11 @@ usb-lib README PLEASE SEE "Can teachers display their own content?" WITHIN http://FAQ.IIAB.IO FOR UP-TO-DATE DOCUMENTATION. -This role implements functionality similar to LibraryBox, to mount "teacher content" on USB drives. +This role implements functionality similar to LibraryBox, to mount "teacher content" from USB drives. Users should have nearly immediate access to this "teacher content" (on all inserted USB drives) by browsing to http://box/usb -USB drives must be formatted with one of the iilesystems listed under "FILESYSTEMS=" at /etc/usbmount/usbmount.conf +USB drives must be formatted with one of the filesystems listed under "FILESYSTEMS=" at /etc/usbmount/usbmount.conf -- also beware that problems remain automounting exFAT filesystems with usbmount, even in 2018. Automount is handled by usbmount, and scripts in this role look in the root of the mounted drive for... From 1f2892d910d8baf8ce1e16079d023c3a07a5c1cd Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 11 Feb 2018 13:00:37 -0500 Subject: [PATCH 09/12] Update README.rst --- roles/usb-lib/README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/usb-lib/README.rst b/roles/usb-lib/README.rst index 479f64357..a242ae964 100644 --- a/roles/usb-lib/README.rst +++ b/roles/usb-lib/README.rst @@ -8,8 +8,6 @@ This role implements functionality similar to LibraryBox, to mount "teacher cont Users should have nearly immediate access to this "teacher content" (on all inserted USB drives) by browsing to http://box/usb -USB drives must be formatted with one of the filesystems listed under "FILESYSTEMS=" at /etc/usbmount/usbmount.conf -- also beware that problems remain automounting exFAT filesystems with usbmount, even in 2018. - Automount is handled by usbmount, and scripts in this role look in the root of the mounted drive for... * /usb @@ -20,6 +18,8 @@ Automount is handled by usbmount, and scripts in this role look in the root of t ...and if found, creates a symlink of the form /library/www/html/local_content/USBn pointing to /media/usbn. +USB drives must be formatted with one of the filesystems listed under "FILESYSTEMS=" at /etc/usbmount/usbmount.conf (beware that problems remain automounting exFAT filesystems using usbmount, even in 2018). + There is also a patch for problems with automount on Fedora 21+ Please Note that as of the 4.1.8-200.fc22.x86_64 not all USB drives will mount even with this patch. From 54fddf421d623b6246e5d10be8f194df0c8fa1e4 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 12 Feb 2018 12:29:50 -0500 Subject: [PATCH 10/12] Update README.rst --- roles/usb-lib/README.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/usb-lib/README.rst b/roles/usb-lib/README.rst index a242ae964..d16ab1209 100644 --- a/roles/usb-lib/README.rst +++ b/roles/usb-lib/README.rst @@ -18,7 +18,9 @@ Automount is handled by usbmount, and scripts in this role look in the root of t ...and if found, creates a symlink of the form /library/www/html/local_content/USBn pointing to /media/usbn. -USB drives must be formatted with one of the filesystems listed under "FILESYSTEMS=" at /etc/usbmount/usbmount.conf (beware that problems remain automounting exFAT filesystems using usbmount, even in 2018). +USB drives must be formatted with one of the filesystems listed under "FILESYSTEMS=" at /etc/usbmount/usbmount.conf + +WARNING: even after adding "exfat ntfs fuseblk" within the above line, problems remain automounting exFAT and NTFS filesystems using usbmount, as of February 2018. It's recommended you stick to FAT32 and ext4 filesystems for now. There is also a patch for problems with automount on Fedora 21+ From 2578d541a035d13317e973ef52d804371bf21ca5 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 12 Feb 2018 12:31:58 -0500 Subject: [PATCH 11/12] Update README.rst --- roles/usb-lib/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/usb-lib/README.rst b/roles/usb-lib/README.rst index d16ab1209..98eb7ceff 100644 --- a/roles/usb-lib/README.rst +++ b/roles/usb-lib/README.rst @@ -20,7 +20,7 @@ Automount is handled by usbmount, and scripts in this role look in the root of t USB drives must be formatted with one of the filesystems listed under "FILESYSTEMS=" at /etc/usbmount/usbmount.conf -WARNING: even after adding "exfat ntfs fuseblk" within the above line, problems remain automounting exFAT and NTFS filesystems using usbmount, as of February 2018. It's recommended you stick to FAT32 and ext4 filesystems for now. +WARNING: even if you manually add "exfat ntfs fuseblk" within the above line, problems remain automounting exFAT and NTFS filesystems using usbmount, as of February 2018. It's recommended you stick to FAT32 and ext4 filesystems for now. There is also a patch for problems with automount on Fedora 21+ From c6568b27d9d06adbaca9aab2c4484df887af9767 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 12 Feb 2018 12:37:03 -0500 Subject: [PATCH 12/12] Update main.yml --- roles/usb-lib/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/usb-lib/tasks/main.yml b/roles/usb-lib/tasks/main.yml index 066aa92d9..5280440bd 100644 --- a/roles/usb-lib/tasks/main.yml +++ b/roles/usb-lib/tasks/main.yml @@ -72,6 +72,6 @@ - option: name value: usb-lib - option: description - value: '"usb-lib automounts USB drives' Teacher Content within /library/www/html/local_content, so students can browse it almost immediately at http://box/usb"' + value: '"usb-lib automounts Teacher Content on USB drives to /library/www/html/local_content, so students can browse it almost immediately at http://box/usb"' - option: enabled value: "{{ usb_lib_enabled }}"