Commit 9a76dd90 authored by rgaudin's avatar rgaudin
Browse files

switching to raspbian-buster distro

parent 69358953
2.0.8
* Updated kiwix-serve to 2.1.0
* Updated to raspbian 2019-07-10 (buster)
2.0.8
* fixed ZIM icon display on homepage
......
......@@ -32,11 +32,12 @@ language_name: "English"
# versions
qemu_kernel_version: "4.10.0"
kernel_version: "4.14.34"
kernel_version: "4.19.57"
kiwix_version: "2.1.0"
kalite_version: "0.17.4"
edupi_version: "1.4.10"
python3_version: "3.5"
php_version: "7.3"
# Apps path
venvs_root: /home/{{ username }}/venvs
......
---
- name: Unblock wlan
command: rfkill unblock wlan
when: (ansible_architecture == 'x86_64' or ansible_architecture == 'i386')
- name: Unblock RF
command: rfkill unblock all
ignore_errors: yes
tags: master
......@@ -42,5 +41,17 @@
systemd:
daemon-reload: yes
- name: unmask hostapd
become: true
command: systemctl unmask hostapd
tags: master
- name: unmask hostapd
become: true
systemd:
masked: no
name: hostapd
tags: master
- include_tasks: enable_service.yml service=hostapd
tags: master
---
- name: Install iptables
apt:
name: iptables
name: iptables,arptables,ebtables
state: latest
autoremove: yes
autoclean: yes
tags: master
- name: use iptables instead of the default nftables
command: update-alternatives --set {{ item }} /usr/sbin/{{ item }}-legacy
with_items:
- iptables
- ip6tables
- arptables
- ebtables
when: ansible_distribution_release == "buster"
tags: master
- name: Authorize routing
replace:
dest: /etc/sysctl.conf
......
......@@ -25,7 +25,7 @@
- include_tasks: enable_service.yml service=memcached
when: ansible_local.config.wikifundi_languages | length
- include_tasks: enable_service.yml service=php7.0-fpm
- include_tasks: enable_service.yml service=php{{ php_version }}-fpm
when: ansible_local.config.wikifundi_languages | length
- include_tasks: enable_vhost.yml name={{ item }}.wikifundi
......
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
LANGUAGE=en_US.UTF-8
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
deb http://deb.debian.org/debian/ buster main contrib non-free
deb http://security.debian.org/debian-security buster/updates main contrib non-free
# buster-updates, previously known as 'volatile'
deb http://deb.debian.org/debian/ buster-updates main contrib non-free
# buster-backports, previously on backports.debian.org
deb http://deb.debian.org/debian/ buster-backports main contrib non-free
deb http://raspbian.raspberrypi.org/raspbian/ jessie main contrib non-free rpi
#deb-src http://raspbian.raspberrypi.org/raspbian/ jessie main contrib non-free rpi
deb http://deb.debian.org/debian/ jessie main contrib non-free
deb http://security.debian.org/debian-security jessie/updates main contrib non-free
# jessie-updates, previously known as 'volatile'
deb http://deb.debian.org/debian/ jessie-updates main contrib non-free
# jessie-backports, previously on backports.debian.org
deb http://deb.debian.org/debian/ jessie-backports main contrib non-free
[Unit]
Description=Ublock RF devices
DefaultDependencies=no
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin rfkill ublock all
......@@ -28,7 +28,7 @@
- name: download exfat kernel module
unarchive:
src: "{{ mirror }}/dev/exfat_{{ kernel_version }}.tar"
src: "{{ mirror }}/dev/exfat_{{ kernel_version }}_buster.tar"
dest: /tmp/
remote_src: True
tags: master
......@@ -38,6 +38,7 @@
with_items:
- "{{ kernel_version }}"
- "{{ kernel_version }}-v7"
- "{{ kernel_version }}-v7l"
tags: master
- name: make temp directories to fool depmod
......@@ -47,9 +48,10 @@
with_items:
- "{{ kernel_version }}"
- "{{ kernel_version }}-v7"
- "{{ kernel_version }}-v7l"
tags: master
- name: create symlinks to fool depmod
- name: create symlinks to fool depmod (qemu)
file:
src: /lib/modules/{{ item }}+
dest: /tmp/{{ item }}/lib/modules/{{ qemu_kernel_version }}
......@@ -57,6 +59,52 @@
with_items:
- "{{ kernel_version }}"
- "{{ kernel_version }}-v7"
- "{{ kernel_version }}-v7l"
when: running_kernel_version.stdout[:7] == qemu_kernel_version
tags: master
- name: create symlinks to fool depmod on Pi 1
file:
src: /lib/modules/{{ item }}+
dest: /tmp/{{ item }}/lib/modules/{{ item }}
state: link
with_items:
- "{{ kernel_version }}"
- "{{ kernel_version }}-v7"
- "{{ kernel_version }}-v7l"
when: running_kernel_version.stdout[:7] == kernel_version
tags: master
- name: create symlinks to fool depmod on Pi 2
file:
src: /lib/modules/{{ item }}+
dest: /tmp/{{ kernel_version }}/lib/modules/{{ item }}+
state: link
with_items:
- "{{ kernel_version }}"
- "{{ kernel_version }}-v7"
- "{{ kernel_version }}-v7l"
when: running_kernel_version.stdout[:7] == kernel_version
tags: master
- name: create symlinks to fool depmod on Pi 3
file:
src: /lib/modules/{{ item }}+
dest: /tmp/{{ item }}/lib/modules/{{ item }}+
state: link
with_items:
- "{{ kernel_version }}"
- "{{ kernel_version }}-v7"
- "{{ kernel_version }}-v7l"
when: running_kernel_version.stdout[:7] == kernel_version
tags: master
- name: create symlinks to fool depmod on Pi 4
file:
src: /lib/modules/{{ kernel_version }}-v7l+
dest: /tmp/{{ kernel_version }}-v7/lib/modules/{{ kernel_version }}-v7l+
state: link
when: running_kernel_version.stdout[:7] == kernel_version
tags: master
- name: regenerate modules list
......@@ -64,6 +112,7 @@
with_items:
- "{{ kernel_version }}"
- "{{ kernel_version }}-v7"
- "{{ kernel_version }}-v7l"
tags: master
- name: add exfat module to startup list
......@@ -83,35 +132,45 @@
when: has_exfat.stdout.strip()|int == 0
tags: master
- name: remove raspi sources
file:
path: /etc/apt/sources.list.d/raspi.list
state: absent
- name: create systemd-service to ublock RF on start
copy:
src: unblock-rf.service
dest: /etc/systemd/system/unblock-rf.service
tags: master
- name: Run apt update
apt:
update_cache: yes
- name: reload systemd
command: systemctl daemon-reload
tags: master
- name: install stretch debian keyring
apt:
deb: http://ftp.fr.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2017.5_all.deb
when: ansible_distribution_release == "stretch"
tags: master
# - name: remove raspi sources
# file:
# path: /etc/apt/sources.list.d/raspi.list
# state: absent
# tags: master
- name: install jessie debian keyring
apt:
deb: http://ftp.fr.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2017.5~deb8u1_all.deb
when: ansible_distribution_release == "jessie"
tags: master
# - name: Run apt update
# apt:
# update_cache: yes
# tags: master
- name: Drop a complete sources.list
copy:
src: sources_{{ ansible_distribution_release }}.list
dest: /etc/apt/sources.list
when: ansible_distribution == "Debian"
tags: master
# - name: install buster debian keyring
# apt:
# deb: http://ftp.fr.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2019.1_all.deb
# when: ansible_distribution_release == "buster"
# tags: master
# - name: install stretch debian keyring
# apt:
# deb: http://ftp.fr.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2017.5_all.deb
# when: ansible_distribution_release == "stretch"
# tags: master
# - name: Drop a complete sources.list
# copy:
# src: sources_{{ ansible_distribution_release }}.list
# dest: /etc/apt/sources.list
# when: ansible_distribution == "Debian"
# tags: master
- name: Run apt update
apt:
......@@ -133,7 +192,7 @@
- name: Install or upgrade all required package
apt:
name: python-dev,git,sudo,lsb-release,vim,locate,git,unzip,bash-completion,aptitude,ntpdate,fake-hwclock,hdparm,ncurses-term,libffi-dev,libssl-dev,tree,screen,iftop,tmux,mtr-tiny,libwww-perl,httpie,lshw,hwinfo,sqlite3,elinks,mosh,curl,apt-transport-https,tar,exfat-utils,gzip,hostname,liblzma5,pkg-config,systemd,systemd-sysv,tzdata,wget,xz-utils,adduser,libpam-systemd,policykit-1
name: python-dev,git,sudo,lsb-release,vim,locate,git,unzip,bash-completion,aptitude,ntpdate,fake-hwclock,hdparm,ncurses-term,libffi-dev,libssl-dev,tree,screen,iftop,tmux,mtr-tiny,libwww-perl,httpie,lshw,hwinfo,sqlite3,elinks,mosh,curl,apt-transport-https,tar,exfat-fuse,exfat-utils,gzip,hostname,liblzma5,pkg-config,systemd,systemd-sysv,tzdata,wget,xz-utils,adduser,libpam-systemd,policykit-1,python3-setuptools
state: latest
autoremove: yes
autoclean: yes
......@@ -142,11 +201,6 @@
- import_tasks: clean_apt.yml
tags: master
- name: install newer exfat-utils from bower
apt:
deb: "{{ mirror }}/dev/exfat-utils_1.2.8-1_armhf.deb"
tags: master
- name: Install avahi packages
apt:
name: "{{ item }}"
......@@ -213,6 +267,13 @@
- en_US.UTF-8
tags: master
- name: set default locale to en_US
copy:
src: locale
dest: /etc/default/locale
mode: 0644
tags: master
- name: Copy a blank rc.local
copy:
src: rc.local
......@@ -307,6 +368,14 @@
notify: update timezone
tags: ['master', 'setup', 'reconfigure']
- name: add rfkill unblock to startup
cron:
name: "Unblock RF devices"
special_time: reboot
job: "/usr/sbin/rfkill unblock all"
state: present
tags: master
- name: Checking if grub conf file is there
stat:
path: /etc/default/grub
......
......@@ -2,6 +2,15 @@
- debug: msg="Start playbook {{ ansible_date_time["date"] }} - {{ ansible_date_time["time"] }}"
tags: always
- name: Check running kernel version
command: uname -r
register: running_kernel_version
tags: always
- debug:
msg: "Running Kernel: {{ running_kernel_version.stdout }} / {{ running_kernel_version.stdout[:7] }}"
tags: always
- name: DEBUG list {{ data_path }} content
command: ls -lh {{ data_path }}
ignore_errors: yes
......@@ -16,16 +25,26 @@
- block:
- name: set python3.4 for jessie
set_fact:
python3_version: "3.4"
when: ansible_distribution_release == "jessie"
- name: set python3.5 for stretch
set_fact:
python3_version: "3.5"
when: ansible_distribution_release == "stretch"
- name: set python3.7 for buster
set_fact:
python3_version: "3.7"
when: ansible_distribution_release == "buster"
- name: set php7.0 for stretch
set_fact:
php_version: "7.0"
when: ansible_distribution_release == "stretch"
- name: set php7.3 for buster
set_fact:
php_version: "7.3"
when: ansible_distribution_release == "buster"
tags: always
# set hostname and variants
......
upstream php {
server unix:/run/php/php7.0-fpm.sock;
}
......@@ -38,19 +38,19 @@
environment:
RUNLEVEL: 1
apt:
name: php7.0-fpm,php7.0-sqlite3,php7.0-intl,php7.0-mbstring,php7.0-xml,php7.0-curl
name: php{{ php_version }}-fpm,php{{ php_version }}-sqlite3,php{{ php_version }}-intl,php{{ php_version }}-mbstring,php{{ php_version }}-xml,php{{ php_version }}-curl
state: latest
autoremove: yes
autoclean: yes
tags: setup
- include_tasks: disable_service.yml service=php7.0-fpm
- include_tasks: disable_service.yml service=php{{ php_version }}-fpm
tags: setup
- name: change PHP7 settings to allow file uploads up to 5MiB
copy:
src: 90-wikifundi.ini
dest: /etc/php/7.0/fpm/conf.d/90-wikifundi.ini
dest: /etc/php/{{ php_version }}/fpm/conf.d/90-wikifundi.ini
tags: setup
- import_tasks: clean_apt.yml
......@@ -60,7 +60,7 @@
environment:
RUNLEVEL: 1
apt:
name: git,vim,unzip,imagemagick,libicu-dev,libav-tools,librsvg2-bin,poppler-utils,memcached,redis-server,lua5.1,python3,locales
name: git,vim,unzip,imagemagick,libicu-dev,ffmpeg,librsvg2-bin,poppler-utils,memcached,redis-server,lua5.1,python3,locales
state: latest
autoremove: yes
autoclean: yes
......@@ -214,8 +214,8 @@
tags: setup
- name: copy php conf for nginx
copy:
src: php.conf
template:
src: php.conf.j2
dest: /etc/nginx/conf.d/php.conf
tags: setup
......
upstream php {
server unix:/run/php/php{{ php_version }}-fpm.sock;
}
{
"raspbian_image": {
"url": "http://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2018-04-19/2018-04-18-raspbian-stretch-lite.zip",
"name": "2018-04-18-raspbian-stretch-lite.zip",
"kernel_version": "4.14.34",
"url": "http://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2019-07-12/2019-07-10-raspbian-buster-lite.zip",
"name": "2019-07-10-raspbian-buster-lite.zip",
"kernel_version": "4.19.57",
"checksum": "5a0747b2bfb8c8664192831b7dc5b22847718a1cb77639a1f3db3683b242dc96",
"archive_size": 366646269,
"expanded_size": 1862270976
......
......@@ -72,13 +72,13 @@ def run_for_image(machine, root_partition_size, disk_size):
""" initial launch of a bare raspbian to create a base (master) image """
tags = ["master", "rename", "setup"]
machine.exec_cmd("sudo apt-get update")
machine.exec_cmd("sudo apt-get update -y")
# install ansible dependencies (packages)
machine.exec_cmd(
"sudo apt-get install -y " "python-dev libffi-dev libssl-dev git lsb-release"
"sudo apt-get install -y python-dev libffi-dev libssl-dev git lsb-release"
)
# install the latest pip
machine.exec_cmd("wget https://bootstrap.pypa.io/get-pip.py " "-O /tmp/get-pip.py")
machine.exec_cmd("wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py")
machine.exec_cmd("sudo python /tmp/get-pip.py")
# install latest ansible and important python dependencies
machine.exec_cmd(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment