Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
common update ansible
  • Loading branch information
MrDoobPG authored and MrDoobPG committed Aug 25, 2019
1 parent 13aa5f8 commit 281da75
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 1 deletion.
1 change: 1 addition & 0 deletions menu/functions/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ if [ "$newinstall" == "4" ]; then
ansible-playbook /opt/plexguide/menu/pg.yml --tags kernel
ansible-playbook /opt/plexguide/menu/pg.yml --tags nvidia
ansible-playbook /opt/plexguide/menu/pg.yml --tags system
ansible-playbook /opt/plexguide/menu/pg.yml --tags common
echo "8" >/var/plexguide/kcgpnv.numbers
fi

Expand Down
3 changes: 2 additions & 1 deletion menu/pg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
- { role: plex, tags: ['plex'] }
- { role: traktarr, tags: ['traktarr'] }
- { role: sub-zero-plugin, tags: ['sub-zero-plugin'] }
- { role: trakttv-plugin, tags: ['trakttv-plugin'] }
- { role: trakttv-plugin, tags: ['trakttv-plugin'] }
- { role: common, tags: ['common'] }
2 changes: 2 additions & 0 deletions menu/roles/common/files/pip.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[global]
disable-pip-version-check = True
148 changes: 148 additions & 0 deletions menu/roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
#########################################################################
# Title: Cloudbox: Common Role #
# Author(s): l3uddz, desimaniac #
# URL: https://github.com/cloudbox/cloudbox #
# -- #
# Part of the Cloudbox project: https://cloudbox.works #
#########################################################################
# GNU General Public License v3.0 #
#########################################################################
---
- name: Install required packages
apt:
state: present
name:
- apt-transport-https
- ca-certificates
- software-properties-common

- name: Add Ubuntu repositories
apt_repository:
repo: "{{ item }}"
state: present
update_cache: yes
with_items:
- 'deb http://archive.ubuntu.com/ubuntu {{ ansible_distribution_release }} multiverse'
- 'deb-src http://archive.ubuntu.com/ubuntu {{ ansible_distribution_release }} multiverse'
- 'deb http://archive.ubuntu.com/ubuntu {{ ansible_distribution_release }}-updates multiverse'
- 'deb-src http://archive.ubuntu.com/ubuntu {{ ansible_distribution_release }}-updates multiverse'
when: ansible_distribution == 'Ubuntu'

- name: Add Debian repositories
apt_repository:
repo: "{{ item }}"
state: present
update_cache: yes
with_items:
- deb https://deb.debian.org/debian {{ ansible_distribution_release }} main contrib non-free
- deb-src https://deb.debian.org/debian {{ ansible_distribution_release }} main contrib non-free
- deb https://deb.debian.org/debian-security/ {{ ansible_distribution_release }}/updates main contrib non-free
- deb-src https://deb.debian.org/debian-security/ {{ ansible_distribution_release }}/updates main contrib non-free
- deb https://deb.debian.org/debian {{ ansible_distribution_release }}-updates main contrib non-free
- deb-src https://deb.debian.org/debian {{ ansible_distribution_release }}-updates main contrib non-free
- deb https://deb.debian.org/debian {{ ansible_distribution_release }}-backports main contrib non-free
- deb-src https://deb.debian.org/debian {{ ansible_distribution_release }}-backports main contrib non-free
when: ansible_distribution == 'Debian'

- name: Fetch pci info
shell: "lspci -v -s $(lspci | grep -E '.*VGA.*Intel.*' | cut -d' ' -f 1) 2>/dev/null || :"
register: lscpi_resp

- name: Install common packages
apt:
state: present
name:
- "nano"
- "zip"
- "unzip"
- "p7zip"
- "curl"
- "httpie"
- "sqlite3"
- "tree"
- "lsof"
- "man-db"
- "ksmtuned"
- "git"
- "pwgen"
- "rsync"
- "logrotate"
- "htop"
- "iotop"
- "nload"
- "fail2ban"
- "ufw"
- "ncdu"
- "mc"
- "speedtest-cli"
- "dnsutils"
- "screen"
- "tmux"
- "apache2-utils"
- "jq"
- "lib32z1"
ignore_errors: yes

- name: Install extra packages
apt:
state: present
name:
- "run-one"
ignore_errors: yes

- name: Install 'intel-gpu-tools'
apt: "name=intel-gpu-tools state=present"
when: ('i915' not in lscpi_resp.stdout)

- name: Install unrar
apt:
name: unrar
state: present
ignore_errors: yes

- name: Check to see if unrar installed
stat:
path: "/usr/bin/unrar"
register: unrar_binary

- name: Install unrar-free if unrar was not installed
apt:
name: unrar-free
state: present
ignore_errors: yes
when: (not unrar_binary.stat.exists)

- name: "Import pip.conf into /home/{{ user.name }}/.config/pip/pip.conf"
copy:
src: "pip.conf"
dest: "/home/{{ user.name }}/.config/pip/pip.conf"
owner: "{{ user.name }}"
group: "{{ user.name }}"
mode: 0775
force: yes

- name: Install common pip modules
pip:
state: present
name:
- passlib
- certbot
- ansible-toolbox
- ndg-httpsclient
- dnspython
- yq
- lxml
- apprise
- jmespath
ignore_errors: yes

- name: Uninstall apt glances
apt:
name: glances
state: absent
ignore_errors: yes
tags: glances

- name: Install pip glances
shell: pip install glances[action,browser,cloud,cpuinfo,docker,folders,gpu,graph,ip,raid,snmp,web]
tags: glances

0 comments on commit 281da75

Please sign in to comment.