diff --git a/menu/functions/install.sh b/menu/functions/install.sh index 6bcc4cff..89bd8f62 100644 --- a/menu/functions/install.sh +++ b/menu/functions/install.sh @@ -13,10 +13,6 @@ updateprime() { chmod 0775 ${abc} chown 1000:1000 ${abc} - # mkdir -p /opt/appdata/plexguide - # chmod 0775 /opt/appdata/plexguide - # chown 1000:1000 /opt/appdata/plexguide - variable /var/plexguide/pgfork.project "UPDATE ME" variable /var/plexguide/pgfork.version "changeme" variable /var/plexguide/tld.program "portainer" @@ -63,7 +59,6 @@ updateprime() { echo "1" >${abc}/pg.installer echo "7" >${abc}/pg.prune echo "21" >${abc}/pg.mountcheck - } pginstall() { @@ -75,6 +70,7 @@ pginstall() { core folders core dependency core mergerinstall + rcloneinstall core dockerinstall core docstart @@ -211,54 +207,16 @@ hetzner() { } gcloud() { - export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" - echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list - curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - sudo apt-get update -yqq && sudo apt-get install google-cloud-sdk -yqq + ansible-playbook /opt/plexguide/menu/pg.yml --tags gcloud_sdk } mergerinstall() { ansible-playbook /opt/plexguide/menu/pg.yml --tags mergerfs } -##old way - all ovver cmline - # ub16check=$(cat /etc/*-release | grep xenial) - # ub18check=$(cat /etc/*-release | grep bionic) - # deb9check=$(cat /etc/*-release | grep stretch) - # activated=false - - # apt --fix-broken install -y - # apt-get remove mergerfs -y - # mkdir -p /var/plexguide - - # if [ "$ub16check" != "" ]; then - # activated=true - # echo "ub16" >/var/plexguide/mergerfs.version - # wget "https://github.com/trapexit/mergerfs/releases/download/2.28.1/mergerfs_2.28.1.ubuntu-xenial_amd64.deb" - - # elif [ "$ub18check" != "" ]; then - # activated=true - # echo "ub18" >/var/plexguide/mergerfs.version - # wget "https://github.com/trapexit/mergerfs/releases/download/2.28.1/mergerfs_2.28.1.ubuntu-bionic_amd64.deb" - - # elif [ "$deb9check" != "" ]; then - # activated=true - # echo "deb9" >/var/plexguide/mergerfs.version - # wget "https://github.com/trapexit/mergerfs/releases/download/2.28.1/mergerfs_2.28.1.debian-stretch_amd64.deb" - - # elif [ "$activated" != "true" ]; then - # activated=true && echo "ub18 - but didn't detect correctly" >/var/plexguide/mergerfs.version - # wget "https://github.com/trapexit/mergerfs/releases/download/2.28.1/mergerfs_2.28.1.ubuntu-bionic_amd64.deb" - # else - # apt-get install g++ pkg-config git git-buildpackage pandoc debhelper libfuse-dev libattr1-dev -y - # git clone https://github.com/trapexit/mergerfs.git - # cd mergerfs - # make clean - # make deb - # cd .. - # fi - - # apt install -y ./mergerfs*_amd64.deb - # rm mergerfs*_amd64.deb + +rcloneinstall() { + ansible-playbook /opt/plexguide/menu/pg.yml --tags rcloneinstall +} motd() { ansible-playbook /opt/plexguide/menu/motd/motd.yml diff --git a/menu/roles/mergerfs/tasks/main.yml b/menu/roles/mergerfs/tasks/main.yml index 9aa2122c..088c7f7b 100644 --- a/menu/roles/mergerfs/tasks/main.yml +++ b/menu/roles/mergerfs/tasks/main.yml @@ -59,6 +59,10 @@ shell: 'docker restart $(docker ps -a -q)' ignore_errors: yes +- name: 'Restart check.sh' + shell: 'bash /opt/plexguide/menu/pgui/check.sh >/dev/null 2>&1' + ignore_errors: yes + - name: Check if docker is running and works command: systemctl status "{{ item }}" with_items: diff --git a/menu/roles/update/tasks/main.yml b/menu/roles/update/tasks/main.yml index f2333923..cec32644 100644 --- a/menu/roles/update/tasks/main.yml +++ b/menu/roles/update/tasks/main.yml @@ -8,8 +8,9 @@ - name: Install a list of packages apt: - name: "{{ packages }}" - state: latest + name: "{{ packages }}" + state: present + update_cache: yes vars: packages: - ctop @@ -18,6 +19,18 @@ - sysstat - nmon +- name: Replace false to true in systat + lineinfile: + path: /etc/default/sysstat + regexp: '^ENABLED=false' + line: ENABLED=true + +- name: Ensure systat is ENABLED=true + lineinfile: + path: /etc/default/sysstat + regexp: '^ENABLED=' + line: ENABLED=true + - name: Autoremove unused packages command: apt-get -y autoremove register: apt_result