1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00

Merge pull request #473 from iiab/master

Sync from iiab/iiab:master
This commit is contained in:
A Holt 2021-04-09 13:46:52 -04:00 committed by GitHub
commit 53d9a38de9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 41 additions and 30 deletions

View file

@ -8,7 +8,7 @@ addons:
- sourceline: ppa:ansible/ansible
packages:
# - python-pip # @arky had used this starting in 2018
- ansible-base # Install latest ansible-base e.g. 2.10.6+, similar to https://github.com/iiab/iiab/blob/master/scripts/ansible
- ansible-base # Install latest ansible-base e.g. 2.10.7+, similar to https://github.com/iiab/iiab/blob/master/scripts/ansible
# - python3-pymysql # These 7-or-8 packages are not needed during this very rapid --syntax-check
# - python3-psycopg2
# - python3-passlib
@ -21,7 +21,8 @@ addons:
install:
# - scripts/ansible # See #2105: fails to install latest Ansible (& ~4 Ansible Collections from collections.yml) due to Travis VM's disk layout/perms being different
# - pip install ansible # SLOW/OVERWEIGHT: installs Ansible 3.0.0+ with ~80 Ansible Collections
# - pip install ansible-base # ALSO WORKS e.g. if the above addons: / apt: section is commented out. To install latest ansible-base e.g. 2.10.6+, similar to https://github.com/iiab/iiab/blob/master/scripts/ansible
# - pip install ansible-base # ALSO WORKS (FASTER THAN ALL ABOVE!) e.g. if the above addons: / apt: section is commented out. To install latest ansible-base e.g. 2.10.7+, similar to https://github.com/iiab/iiab/blob/master/scripts/ansible
# - pip3 install ansible-core # APRIL 2021: ansible-base is being renamed to ansible-core -- latest version number is listed at https://pypi.org/project/ansible-core/
- ansible-galaxy collection install -r collections.yml # Install ~4 Ansible Collections
- "{ echo 'roles_path = ./roles/'; } >> ansible.cfg" # Add correct roles_path to ansible.cfg, appending to https://github.com/iiab/iiab/blob/master/ansible.cfg
# - "{ echo '[defaults]'; echo 'roles_path = ./roles/'; } >> ansible.cfg" # 2021-02-24: suddenly no longer works, with the newer ansible-base install methods above (error arises due to '[defaults]' appearing twice)

View file

@ -5,7 +5,7 @@
# If nec, change them by editing /etc/iiab/local_vars.yml prior to installing!
mediawiki_major_version: 1.35 # "1.35" also works
mediawiki_minor_version: 1
mediawiki_minor_version: 2
mediawiki_version: "{{ mediawiki_major_version }}.{{ mediawiki_minor_version }}"
mediawiki_download_base_url: "https://releases.wikimedia.org/mediawiki/{{ mediawiki_major_version }}"

View file

@ -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`` — these are specified on/around Line 76 of: `/opt/iiab/iiab/roles/usb_lib/tasks/install.yml <https://github.com/iiab/iiab/blob/master/roles/usb_lib/tasks/install.yml#L76>`_
IIAB will generally mount USB drives 'rw' allowing root to both read and write to them. In addition, in March 2021 (`PR #2715 <https://github.com/iiab/iiab/issues/2715>`_) Kolibri exports were enabled by also giving non-root users read and write access to VFAT/FAT32, NTFS and exFAT USB drives, using ``umask=0000`` (in /etc/usbmount/usbmount.conf) to override the ``umask=0022`` default. If however you prefer to restore usbmount's default, set ``usb_lib_umask0000_for_kolibri: False`` in `/etc/iiab/local_vars.yml <http://FAQ.IIAB.IO/#What_is_local_vars.yml_and_how_do_I_customize_it.3F>`_ prior to installing IIAB.
IIAB will generally mount USB drives 'rw' allowing root to both read and write to them. In addition, in March 2021 (`PR #2715 <https://github.com/iiab/iiab/issues/2715>`_) Kolibri exports were enabled by also giving non-root users read and write access to VFAT/FAT32, NTFS and exFAT USB drives, using ``umask=0000`` (in /etc/usbmount/usbmount.conf) to override the ``umask=0022`` default. If however you prefer to restore usbmount's default, set ``usb_lib_umask0000_for_kolibri: False`` in `/etc/iiab/local_vars.yml <http://FAQ.IIAB.IO/#What_is_local_vars.yml_and_how_do_I_customize_it.3F>`_ (preferably do this prior to installing IIAB).
Official `usbmount 0.0.22 (2011-08-08) <https://github.com/rbrito/usbmount/releases>`_ documentation:

View file

@ -76,29 +76,6 @@
line: 'FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus exfat fuseblk ntfs"'
path: /etc/usbmount/usbmount.conf
- name: "Set 'umask=0000' for {VFAT/FAT32, NTFS, exFAT} using var FS_MOUNTOPTIONS in /etc/usbmount/usbmount.conf, so Kolibri exports work"
lineinfile:
regexp: '^FS_MOUNTOPTIONS=.*'
line: 'FS_MOUNTOPTIONS="-fstype=vfat,umask=0000 -fstype=ntfs,umask=0000 -fstype=exfat,umask=0000"'
path: /etc/usbmount/usbmount.conf
when: usb_lib_umask0000_for_kolibri
# Setting 'umask=0000' for all filesystems: (much the same thing as above, as
# the mount command does not use this umask setting for filesystems like ext4)
#- name: "Add ',umask=0000' to MOUNTOPTIONS var in /etc/usbmount/usbmount.conf, so Kolibri exports work"
# lineinfile:
# regexp: '^MOUNTOPTIONS=.*'
# line: 'MOUNTOPTIONS="sync,noexec,nodev,noatime,nodiratime,umask=0000"'
# path: /etc/usbmount/usbmount.conf
# when: usb_lib_umask0000_for_kolibri
- name: 'Set FS_MOUNTOPTIONS="" in /etc/usbmount/usbmount.conf, e.g. if Kolibri will not be used'
lineinfile:
regexp: '^FS_MOUNTOPTIONS=.*'
line: 'FS_MOUNTOPTIONS=""' # Restore apt pkg default, if runrole forced
path: /etc/usbmount/usbmount.conf
when: not usb_lib_umask0000_for_kolibri
# 2021-03-25: Consider removing this stanza & all of this role's Apache logic!
- name: Install /etc/{{ apache_conf_dir }}/content_dir.conf from template
template:

View file

@ -30,6 +30,32 @@
when: usb_lib_installed is undefined
# If setup.yml becomes the norm in future, put the 2-3 stanzas below in there:
- name: "Set 'umask=0000' for {VFAT/FAT32, NTFS, exFAT} using var FS_MOUNTOPTIONS in /etc/usbmount/usbmount.conf, so Kolibri exports work"
lineinfile:
regexp: '^FS_MOUNTOPTIONS=.*'
line: 'FS_MOUNTOPTIONS="-fstype=vfat,umask=0000 -fstype=ntfs,umask=0000 -fstype=exfat,umask=0000"'
path: /etc/usbmount/usbmount.conf
when: usb_lib_umask0000_for_kolibri
# Setting 'umask=0000' for all filesystems: (much the same thing as above, as
# the mount command does not use this umask setting for filesystems like ext4)
#- name: "Add ',umask=0000' to MOUNTOPTIONS var in /etc/usbmount/usbmount.conf, so Kolibri exports work"
# lineinfile:
# regexp: '^MOUNTOPTIONS=.*'
# line: 'MOUNTOPTIONS="sync,noexec,nodev,noatime,nodiratime,umask=0000"'
# path: /etc/usbmount/usbmount.conf
# when: usb_lib_umask0000_for_kolibri
- name: 'Set FS_MOUNTOPTIONS="" in /etc/usbmount/usbmount.conf, e.g. if Kolibri will not be used'
lineinfile:
regexp: '^FS_MOUNTOPTIONS=.*'
line: 'FS_MOUNTOPTIONS=""' # Restore apt pkg default, e.g. for runrole
path: /etc/usbmount/usbmount.conf
when: not usb_lib_umask0000_for_kolibri
- name: Enable/Disable/Restart Apache if primary
include_tasks: apache.yml
when: not nginx_enabled
@ -60,3 +86,5 @@
value: "{{ usb_lib_install }}"
- option: usb_lib_enabled
value: "{{ usb_lib_enabled }}"
- option: usb_lib_umask0000_for_kolibri
value: "{{ usb_lib_umask0000_for_kolibri }}"

View file

@ -33,12 +33,17 @@ fi
# FYI .travis.yml installs ansible-base in a slightly different way (PR #2689).
# IIAB implementers might instead consider these 3 GENERAL TECHNIQUES below
# ("in an emergency!") e.g. if you must install an older version of Ansible:
# IIAB implementers might instead consider these 4 GENERAL TECHNIQUES below
# ("in an emergency!") e.g. if apt fails & you need a newer/older Ansible:
# TEMPORARILY USE pip3 to install the latest ansible-core as listed at
# https://pypi.org/project/ansible-core/ (REMOVE W/ "pip3 uninstall ansible-core")
#pip3 install ansible-core # Then start a new shell, so /usr/local/bin works
#apt install python3-pymysql python3-psycopg2 python3-passlib python3-pip python3-setuptools python3-packaging python3-venv virtualenv
#ansible-galaxy collection install -r collections.yml
# TEMPORARILY USE ansible-base 2.10.7 (REMOVE W/ "pip3 uninstall ansible-base")
#pip3 install ansible-base==2.10.7 # Start new shell, so /usr/local/bin works
#ansible-galaxy collection install -r collections.yml
# TEMPORARILY USE ANSIBLE 2.9.19 (REMOVE IT WITH "pip uninstall ansible")
#apt install python-pip