Skip to content

Commit

Permalink
versuch nr 20
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDoobPG authored and MrDoobPG committed Sep 11, 2019
1 parent f8825ae commit 9d7aba6
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 50 deletions.
1 change: 0 additions & 1 deletion menu/dependency/dependencydeb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
- { package: 'acl' }
- { package: 'bc' }
- { package: 'python-docker' }
- { package: 'gnupg2' }

- name: Update pip packages for python3
pip:
Expand Down
45 changes: 18 additions & 27 deletions menu/functions/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -423,36 +423,27 @@ pgui() {
# }

dockerinstall() {
ospgversion=$(cat /var/plexguide/os.version)
if [ "$ospgversion" == "debian" ]; then
osname=$(lsb_release -si)
if [ $osname == "Debian" 2>&1 >> /dev/null ]; then
ansible-playbook /opt/plexguide/menu/pg.yml --tags dockerdeb
else
elif [ $osname == "Ubuntu" 2>&1 >> /dev/null ]; then
ansible-playbook /opt/plexguide/menu/pg.yml --tags docker
# If Docker FAILED, Emergency Install
file="/usr/bin/docker"
if [ ! -e "$file" ]; then
clear
echo "Installing Docker the Old School Way - (Please Be Patient)"
sleep 2
clear
curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.sh
echo ""
echo "Starting Docker (Please Be Patient)"
sleep 2
systemctl start docker
sleep 2
fi
elif [ $osname == "Rasbian" || "Fedora" || "CentOS" ]; then

##### Checking Again, if fails again; warns user
file="/usr/bin/docker"
if [ -e "$file" ]; then
sleep 5
else
echo "INFO - FAILED: Docker Failed to Install! Exiting PGBlitz!"
exit
fi
fi
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔ Argggggg ...... System Warning!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Supported: UBUNTU 16.xx - 18.10 ~ LTS/SERVER and Debian 9.* / 10
This server may not be supported due to having the incorrect OS detected!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 10
fi
}

serverid() {
Expand Down
54 changes: 32 additions & 22 deletions menu/roles/dockerdeb/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
- name: Install required packages
apt: 'name={{item}} state=present'
with_items:
- apt-transport-https
- ca-certificates
- software-properties-common
- { package: 'apt-transport-https' }
- { package: 'ca-certificates' }
- { package: 'gnupg2' }
- { package: 'software-properties-common' }
- { package: 'curl' }
when: switch == "on"

- name: Add official gpg signing key
Expand All @@ -48,7 +50,7 @@

- name: Official Repo
apt_repository:
repo: 'deb [arch=amd64] https://download.docker.com/linux/debian {{ ansible_distribution_release }} edge'
repo: 'deb [arch=amd64] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable'
register: apt_docker_repositories
when: switch == "on"

Expand All @@ -57,25 +59,33 @@
update_cache: yes
when: apt_docker_repositories.changed and switch == "on"

- name: Release docker-ce from hold
dpkg_selections:
name: docker-ce
selection: install
when: switch == "on"

- name: Install docker-ce
apt:
name: docker-ce
state: present
update_cache: yes
when: switch == "on"

- name: Put docker-ce into hold
dpkg_selections:
name: docker-ce
selection: hold
# - name: Release docker-ce from hold
# dpkg_selections:
# name: docker-ce
# selection: install
# when: switch == "on"

# - name: Install docker-ce
# apt:
# name: docker-ce
# state: present
# update_cache: yes
# when: switch == "on"

# - name: Put docker-ce into hold
# dpkg_selections:
# name: docker-ce
# selection: hold
# when: switch == "on"

- name: Install Docker Parts
apt: 'name={{item}} state=present'
with_items:
- { package: 'docker-ce' }
- { package: 'docker-ce-cli' }
- { package: 'containerd.io' }
when: switch == "on"

- name: Uninstall docker-py pip module
pip:
name: docker-py
Expand Down

0 comments on commit 9d7aba6

Please sign in to comment.