From 896186f8c78f14277c9efe45b229fc2c32a70d3b Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Fri, 25 Oct 2019 13:14:16 -0500 Subject: [PATCH 01/20] add python3 debs --- scripts/ansible | 6 +++--- scripts/ansible-2.8.x | 6 +++--- scripts/ansible-2.9.x | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index e6b2bfe73..b01c0056b 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -74,9 +74,9 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e '\nIF YOU FACE ERROR "signatures couldn'"'"'t be verified because the public key is not available" THEN REPEATEDLY RE-RUN "sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 93C4A3FD7BB9C367"\n' apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 93C4A3FD7BB9C367 - echo -e "\napt update; apt install ansible\n" + echo -e "\napt update; apt install ansible and python3 dependencies\n" apt update - apt -y --allow-downgrades install ansible + apt -y --allow-downgrades install ansible python3-distutils python3-pymysql echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible'\n\n" # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") @@ -90,7 +90,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e 'PPA source "deb http://ppa.launchpad.net/ansible/ansible/ubuntu bionic main"' echo -e "successfully saved to /etc/apt/sources.list.d/iiab-ansible.list\n" - + echo -e "IF *OTHER* ANSIBLE SOURCES APPEAR BELOW, PLEASE MANUALLY REMOVE THEM TO" echo -e "ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n" grep '^deb .*ansible' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -v '^/etc/apt/sources.list.d/iiab-ansible.list:' || true # Override bash -e (instead of aborting at 1st error) diff --git a/scripts/ansible-2.8.x b/scripts/ansible-2.8.x index 921a13323..6e7a8e84b 100755 --- a/scripts/ansible-2.8.x +++ b/scripts/ansible-2.8.x @@ -74,9 +74,9 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e '\nIF YOU FACE ERROR "signatures couldn'"'"'t be verified because the public key is not available" THEN REPEATEDLY RE-RUN "sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 93C4A3FD7BB9C367"\n' apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 93C4A3FD7BB9C367 - echo -e "\napt update; apt install ansible\n" + echo -e "\napt update; apt install ansible and python3 dependencies\n" apt update - apt -y --allow-downgrades install ansible + apt -y --allow-downgrades install ansible python3-distutils python3-pymysql echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible'\n\n" # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") @@ -90,7 +90,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e 'PPA source "deb http://ppa.launchpad.net/ansible/ansible-2.8/ubuntu bionic main"' echo -e "successfully saved to /etc/apt/sources.list.d/iiab-ansible.list\n" - + echo -e "IF *OTHER* ANSIBLE SOURCES APPEAR BELOW, PLEASE MANUALLY REMOVE THEM TO" echo -e "ENSURE ANSIBLE UPDATES CLEANLY: (then re-run this script to be sure!)\n" grep '^deb .*ansible' /etc/apt/sources.list /etc/apt/sources.list.d/*.list | grep -v '^/etc/apt/sources.list.d/iiab-ansible.list:' || true # Override bash -e (instead of aborting at 1st error) diff --git a/scripts/ansible-2.9.x b/scripts/ansible-2.9.x index 162f19cde..cc09385e6 100755 --- a/scripts/ansible-2.9.x +++ b/scripts/ansible-2.9.x @@ -74,9 +74,9 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e '\nIF YOU FACE ERROR "signatures couldn'"'"'t be verified because the public key is not available" THEN REPEATEDLY RE-RUN "sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 93C4A3FD7BB9C367"\n' apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 93C4A3FD7BB9C367 - echo -e "\napt update; apt install ansible\n" + echo -e "\napt update; apt install ansible and python3 dependencies\n" apt update - apt -y --allow-downgrades install ansible + apt -y --allow-downgrades install ansible python3-distutils python3-pymysql echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible'\n\n" # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") From c2ca70b346c865a2e292af5345d397f291e3f113 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Fri, 25 Oct 2019 13:14:44 -0500 Subject: [PATCH 02/20] cherry-pick 57d77774fb7602ab39b3a4613b1623e83e8c526c --- iiab-install | 5 ++--- iiab-network | 3 ++- iiab-support | 5 +++-- runrole | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/iiab-install b/iiab-install index 6b9e0622e..294f66f4c 100755 --- a/iiab-install +++ b/iiab-install @@ -150,7 +150,6 @@ echo -e "Running local playbooks....Stage 0 will now run....followed by Stages $ export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" -ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null -ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local - +ansible -m setup -i $INVENTORY localhost --connection=local -e ansible_python_interpreter=/usr/bin/python3 | grep python +ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local -e ansible_python_interpreter=/usr/bin/python3 echo -e "./iiab-install $* COMPLETED IN $CWD\n\n" diff --git a/iiab-network b/iiab-network index 563ecace6..d473e2053 100755 --- a/iiab-network +++ b/iiab-network @@ -25,7 +25,8 @@ fi echo "Ansible will now run iiab-network.yml -- log file is iiab-network.log" Start=`date` -ansible-playbook -i ansible_hosts iiab-network.yml --connection=local +ansible -m setup -i $INVENTORY localhost --connection=local -e ansible_python_interpreter=/usr/bin/python3 | grep python +ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local -e ansible_python_interpreter=/usr/bin/python3 End=`date` diff --git a/iiab-support b/iiab-support index 7cb48c0c2..8f229a51d 100755 --- a/iiab-support +++ b/iiab-support @@ -55,13 +55,14 @@ else else echo "openvpn_install: True" >> /etc/iiab/local_vars.yml fi - + if [ -d /opt/iiab/iiab ]; then cd /opt/iiab/iiab #CWD=`pwd` #export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" export ANSIBLE_LOG_PATH="/opt/iiab/iiab/iiab-install.log" - ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local + ansible -m setup -i $INVENTORY localhost --connection=local -e ansible_python_interpreter=/usr/bin/python3 | grep python + ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local -e ansible_python_interpreter=/usr/bin/python3 # Above is tighter/better than running all of "./runrole 1-prep" echo else diff --git a/runrole b/runrole index 8a8d72986..203694d30 100755 --- a/runrole +++ b/runrole @@ -33,4 +33,5 @@ if [[ $# -eq 0 ]] ; then exit 0 fi -ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local -e "role_to_run=$1" +ansible -m setup -i $INVENTORY localhost --connection=local -e ansible_python_interpreter=/usr/bin/python3 | grep python +ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local -e ansible_python_interpreter=/usr/bin/python3 From dfd25470a10b757c8676d07c00c05b7cf76ffd61 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Sun, 27 Oct 2019 22:16:10 -0500 Subject: [PATCH 03/20] revisons --- iiab-install | 3 ++- iiab-network | 4 ++-- runrole | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iiab-install b/iiab-install index 294f66f4c..bf4f7cb3d 100755 --- a/iiab-install +++ b/iiab-install @@ -151,5 +151,6 @@ echo -e "Running local playbooks....Stage 0 will now run....followed by Stages $ export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" ansible -m setup -i $INVENTORY localhost --connection=local -e ansible_python_interpreter=/usr/bin/python3 | grep python -ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local -e ansible_python_interpreter=/usr/bin/python3 +ansible -m setup -i $INVENTORY localhost --connection=local -e ansible_python_interpreter=/usr/bin/python3 >> /dev/null +ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local -e ansible_python_interpreter=/usr/bin/python3 echo -e "./iiab-install $* COMPLETED IN $CWD\n\n" diff --git a/iiab-network b/iiab-network index d473e2053..aabcc8578 100755 --- a/iiab-network +++ b/iiab-network @@ -25,8 +25,8 @@ fi echo "Ansible will now run iiab-network.yml -- log file is iiab-network.log" Start=`date` -ansible -m setup -i $INVENTORY localhost --connection=local -e ansible_python_interpreter=/usr/bin/python3 | grep python -ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local -e ansible_python_interpreter=/usr/bin/python3 +ansible -m setup -i ansible_hosts localhost --connection=local -e ansible_python_interpreter=/usr/bin/python3 | grep python +ansible-playbook -i ansible_hosts iiab-network.yml --connection=local -e ansible_python_interpreter=/usr/bin/python3 End=`date` diff --git a/runrole b/runrole index 203694d30..3e75c87bc 100755 --- a/runrole +++ b/runrole @@ -34,4 +34,4 @@ if [[ $# -eq 0 ]] ; then fi ansible -m setup -i $INVENTORY localhost --connection=local -e ansible_python_interpreter=/usr/bin/python3 | grep python -ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local -e ansible_python_interpreter=/usr/bin/python3 +ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local -e "role_to_run=$1" -e ansible_python_interpreter=/usr/bin/python3 From 311ef25262c2ce3f0384d9c1fb187f5add3f3645 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 30 Oct 2019 18:41:14 -0400 Subject: [PATCH 04/20] Gitea 1.9.4 -> 1.9.5 --- roles/gitea/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/gitea/defaults/main.yml b/roles/gitea/defaults/main.yml index 26393ec73..c931d6872 100644 --- a/roles/gitea/defaults/main.yml +++ b/roles/gitea/defaults/main.yml @@ -8,7 +8,7 @@ # https://git.coolaj86.com/coolaj86/gitea-installer.sh # Information needed to install Gitea -gitea_version: 1.9.4 +gitea_version: 1.9.5 iset_suffixes: i386: 386 x86_64: amd64 From aff014ae758e74eeb2f3b5b647fca9e369044e9d Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 30 Oct 2019 21:38:06 -0500 Subject: [PATCH 05/20] drop -e and just use ansible.cfg --- ansible.cfg | 2 ++ iiab-install | 6 +++--- iiab-network | 4 ++-- iiab-support | 4 ++-- runrole | 5 +++-- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ansible.cfg b/ansible.cfg index 5fff0c430..4030a931e 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -4,3 +4,5 @@ #[defaults] # Disallowed by Ansible 2.11+ -- see https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_2.7.html#using-a-loop-on-a-package-module-via-squash-actions #squash_actions = apk, apt, dnf, homebrew, openbsd_pkg, pacman, pkgng, yum, zypper, package +[defaults] +interpreter_python=/usr/bin/python3 diff --git a/iiab-install b/iiab-install index bf4f7cb3d..de9513616 100755 --- a/iiab-install +++ b/iiab-install @@ -150,7 +150,7 @@ echo -e "Running local playbooks....Stage 0 will now run....followed by Stages $ export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" -ansible -m setup -i $INVENTORY localhost --connection=local -e ansible_python_interpreter=/usr/bin/python3 | grep python -ansible -m setup -i $INVENTORY localhost --connection=local -e ansible_python_interpreter=/usr/bin/python3 >> /dev/null -ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local -e ansible_python_interpreter=/usr/bin/python3 +ansible -m setup -i $INVENTORY localhost --connection=local | grep python +ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null +ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local echo -e "./iiab-install $* COMPLETED IN $CWD\n\n" diff --git a/iiab-network b/iiab-network index aabcc8578..0bef05005 100755 --- a/iiab-network +++ b/iiab-network @@ -25,8 +25,8 @@ fi echo "Ansible will now run iiab-network.yml -- log file is iiab-network.log" Start=`date` -ansible -m setup -i ansible_hosts localhost --connection=local -e ansible_python_interpreter=/usr/bin/python3 | grep python -ansible-playbook -i ansible_hosts iiab-network.yml --connection=local -e ansible_python_interpreter=/usr/bin/python3 +ansible -m setup -i ansible_hosts localhost --connection=local | grep python +ansible-playbook -i ansible_hosts iiab-network.yml --connection=local End=`date` diff --git a/iiab-support b/iiab-support index 8f229a51d..66c8e54ae 100755 --- a/iiab-support +++ b/iiab-support @@ -61,8 +61,8 @@ else #CWD=`pwd` #export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" export ANSIBLE_LOG_PATH="/opt/iiab/iiab/iiab-install.log" - ansible -m setup -i $INVENTORY localhost --connection=local -e ansible_python_interpreter=/usr/bin/python3 | grep python - ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local -e ansible_python_interpreter=/usr/bin/python3 + ansible -m setup -i $INVENTORY localhost --connection=local | grep python + ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local # Above is tighter/better than running all of "./runrole 1-prep" echo else diff --git a/runrole b/runrole index 3e75c87bc..4cd853dc6 100755 --- a/runrole +++ b/runrole @@ -33,5 +33,6 @@ if [[ $# -eq 0 ]] ; then exit 0 fi -ansible -m setup -i $INVENTORY localhost --connection=local -e ansible_python_interpreter=/usr/bin/python3 | grep python -ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local -e "role_to_run=$1" -e ansible_python_interpreter=/usr/bin/python3 + +ansible -m setup -i $INVENTORY localhost ${ARGS} --connection=local | grep python +ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local -e "role_to_run=$1" From 7035bb38b22f115a48e2f2dd33033c5b5e3cecd1 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Wed, 30 Oct 2019 23:44:06 -0500 Subject: [PATCH 06/20] add python3-passlib --- scripts/ansible | 2 +- scripts/ansible-2.8.x | 2 +- scripts/ansible-2.9.x | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index b01c0056b..0e70b75d2 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -76,7 +76,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e "\napt update; apt install ansible and python3 dependencies\n" apt update - apt -y --allow-downgrades install ansible python3-distutils python3-pymysql + apt -y --allow-downgrades install ansible python3-distutils python3-pymysql python3-passlib echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible'\n\n" # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") diff --git a/scripts/ansible-2.8.x b/scripts/ansible-2.8.x index 6e7a8e84b..c0815b53e 100755 --- a/scripts/ansible-2.8.x +++ b/scripts/ansible-2.8.x @@ -76,7 +76,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e "\napt update; apt install ansible and python3 dependencies\n" apt update - apt -y --allow-downgrades install ansible python3-distutils python3-pymysql + apt -y --allow-downgrades install ansible python3-distutils python3-pymysql python3-passlib echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible'\n\n" # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") diff --git a/scripts/ansible-2.9.x b/scripts/ansible-2.9.x index cc09385e6..873f3d98a 100755 --- a/scripts/ansible-2.9.x +++ b/scripts/ansible-2.9.x @@ -76,7 +76,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e "\napt update; apt install ansible and python3 dependencies\n" apt update - apt -y --allow-downgrades install ansible python3-distutils python3-pymysql + apt -y --allow-downgrades install ansible python3-distutils python3-pymysql python3-passlib echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible'\n\n" # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") From 7fe2e22589356d92c56836ce94e405012e6da1c6 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 31 Oct 2019 05:02:43 -0500 Subject: [PATCH 07/20] use mysql.sock --- roles/mysql/templates/my.cnf.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/mysql/templates/my.cnf.j2 b/roles/mysql/templates/my.cnf.j2 index b63b4e63a..cb1e80ef4 100644 --- a/roles/mysql/templates/my.cnf.j2 +++ b/roles/mysql/templates/my.cnf.j2 @@ -1,3 +1,4 @@ [client] user=root password={{ mysql_root_password }} +socket=/run/mysqld/mysqld.sock From 37beab1c2e405fce15f99b470f248455384f0128 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 31 Oct 2019 05:43:21 -0500 Subject: [PATCH 08/20] don't install python-passlib --- roles/2-common/tasks/packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/2-common/tasks/packages.yml b/roles/2-common/tasks/packages.yml index a5705f0b9..0b48d5dce 100644 --- a/roles/2-common/tasks/packages.yml +++ b/roles/2-common/tasks/packages.yml @@ -67,7 +67,7 @@ - name: "Install 4 common Python packages: python-passlib, python-pip, python-setuptools, python-virtualenv" package: name: - - python-passlib +# - python-passlib - python-pip - python-setuptools - python-virtualenv From 199d1f34c4e104a3013af69fba35c676f652e42c Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 31 Oct 2019 05:46:58 -0500 Subject: [PATCH 09/20] use python3-mysqldb in place of python3-pymysql --- scripts/ansible | 2 +- scripts/ansible-2.8.x | 2 +- scripts/ansible-2.9.x | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ansible b/scripts/ansible index 0e70b75d2..ca7ab7c47 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -76,7 +76,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e "\napt update; apt install ansible and python3 dependencies\n" apt update - apt -y --allow-downgrades install ansible python3-distutils python3-pymysql python3-passlib + apt -y --allow-downgrades install ansible python3-distutils python3-mysqldb python3-passlib echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible'\n\n" # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") diff --git a/scripts/ansible-2.8.x b/scripts/ansible-2.8.x index c0815b53e..22e1029b8 100755 --- a/scripts/ansible-2.8.x +++ b/scripts/ansible-2.8.x @@ -76,7 +76,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e "\napt update; apt install ansible and python3 dependencies\n" apt update - apt -y --allow-downgrades install ansible python3-distutils python3-pymysql python3-passlib + apt -y --allow-downgrades install ansible python3-distutils python3-mysqldb python3-passlib echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible'\n\n" # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") diff --git a/scripts/ansible-2.9.x b/scripts/ansible-2.9.x index 873f3d98a..b438362cf 100755 --- a/scripts/ansible-2.9.x +++ b/scripts/ansible-2.9.x @@ -76,7 +76,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e "\napt update; apt install ansible and python3 dependencies\n" apt update - apt -y --allow-downgrades install ansible python3-distutils python3-pymysql python3-passlib + apt -y --allow-downgrades install ansible python3-distutils python3-mysqldb python3-passlib echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible'\n\n" # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") From 890e9557006cfd4d2ce08f61331da204c58c5c52 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 31 Oct 2019 06:38:00 -0500 Subject: [PATCH 10/20] use installed python3-mysqldb in place of python-mysqldb --- roles/mysql/tasks/main.yml | 2 +- roles/pbx/tasks/freepbx_dependencies.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index a4f6af054..0bb50fd07 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -3,7 +3,7 @@ name: - mariadb-server - mariadb-client - - python-mysqldb +# - python-mysqldb - php{{ php_version }} - php{{ php_version }}-mysql - php-pear diff --git a/roles/pbx/tasks/freepbx_dependencies.yml b/roles/pbx/tasks/freepbx_dependencies.yml index 18ce5d878..37c235fbb 100644 --- a/roles/pbx/tasks/freepbx_dependencies.yml +++ b/roles/pbx/tasks/freepbx_dependencies.yml @@ -25,6 +25,6 @@ - php-snmp - php-fpm - libapache2-mod-php - - python-mysqldb # https://github.com/Yannik/ansible-role-freepbx/blob/master/tasks/freepbx.yml#L33 +# - python-mysqldb # https://github.com/Yannik/ansible-role-freepbx/blob/master/tasks/freepbx.yml#L33 - libapache2-mpm-itk # To serve FreePBX through a VirtualHost as asterisk user state: latest From 7bf4e94234dfd19c2fec8bc7fa495d53fd18d1f9 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 31 Oct 2019 09:05:38 -0500 Subject: [PATCH 11/20] add python3 versions of pip, setuptools, virtualenv --- roles/2-common/tasks/packages.yml | 2 ++ scripts/ansible | 3 ++- scripts/ansible-2.8.x | 2 +- scripts/ansible-2.9.x | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/roles/2-common/tasks/packages.yml b/roles/2-common/tasks/packages.yml index 0b48d5dce..66e22d9a9 100644 --- a/roles/2-common/tasks/packages.yml +++ b/roles/2-common/tasks/packages.yml @@ -64,6 +64,8 @@ - wget state: present +# These are added to scripts/ansible for python3 support and will be removed +# once the pip calls are ported to use python3 - name: "Install 4 common Python packages: python-passlib, python-pip, python-setuptools, python-virtualenv" package: name: diff --git a/scripts/ansible b/scripts/ansible index ca7ab7c47..b41b810ff 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -76,7 +76,8 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e "\napt update; apt install ansible and python3 dependencies\n" apt update - apt -y --allow-downgrades install ansible python3-distutils python3-mysqldb python3-passlib + apt -y --allow-downgrades install ansible python3-distutils python3-mysqldb python3-passlib python3-pip python3-setuptools python3-virtualenv + echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible'\n\n" # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") diff --git a/scripts/ansible-2.8.x b/scripts/ansible-2.8.x index 22e1029b8..a9bbfe311 100755 --- a/scripts/ansible-2.8.x +++ b/scripts/ansible-2.8.x @@ -76,7 +76,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e "\napt update; apt install ansible and python3 dependencies\n" apt update - apt -y --allow-downgrades install ansible python3-distutils python3-mysqldb python3-passlib + apt -y --allow-downgrades install ansible python3-distutils python3-mysqldb python3-passlib python3-pip python3-setuptools python3-virtualenv echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible'\n\n" # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") diff --git a/scripts/ansible-2.9.x b/scripts/ansible-2.9.x index b438362cf..106aec67f 100755 --- a/scripts/ansible-2.9.x +++ b/scripts/ansible-2.9.x @@ -76,7 +76,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e "\napt update; apt install ansible and python3 dependencies\n" apt update - apt -y --allow-downgrades install ansible python3-distutils python3-mysqldb python3-passlib + apt -y --allow-downgrades install ansible python3-distutils python3-mysqldb python3-passlib python3-pip python3-setuptools python3-virtualenv echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible'\n\n" # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") From e3d0d454c0f74429820f356b5f4c8683072404dc Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 31 Oct 2019 09:30:53 -0500 Subject: [PATCH 12/20] requested changes --- roles/2-common/tasks/packages.yml | 3 +-- roles/mysql/tasks/main.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/roles/2-common/tasks/packages.yml b/roles/2-common/tasks/packages.yml index 66e22d9a9..7b9f604ec 100644 --- a/roles/2-common/tasks/packages.yml +++ b/roles/2-common/tasks/packages.yml @@ -66,10 +66,9 @@ # These are added to scripts/ansible for python3 support and will be removed # once the pip calls are ported to use python3 -- name: "Install 4 common Python packages: python-passlib, python-pip, python-setuptools, python-virtualenv" +- name: "Install 3 common Python packages: python-pip, python-setuptools, python-virtualenv" package: name: -# - python-passlib - python-pip - python-setuptools - python-virtualenv diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index 0bb50fd07..cf7636964 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -1,9 +1,8 @@ -- name: 'Install MySQL packages: mariadb-server, mariadb-client, python-mysqldb and 8 php packages (debuntu)' +- name: 'Install MySQL packages: mariadb-server, mariadb-client, and 8 php packages (debuntu)' package: name: - mariadb-server - mariadb-client -# - python-mysqldb - php{{ php_version }} - php{{ php_version }}-mysql - php-pear From d68644be72ba38b6854ef51ec80c6e57caff5404 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 31 Oct 2019 09:48:39 -0500 Subject: [PATCH 13/20] supply my.cnf file before accessing DBs --- roles/mysql/tasks/main.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/roles/mysql/tasks/main.yml b/roles/mysql/tasks/main.yml index cf7636964..966148a22 100644 --- a/roles/mysql/tasks/main.yml +++ b/roles/mysql/tasks/main.yml @@ -124,6 +124,14 @@ enabled: yes when: mysql_enabled | bool +- name: Install .my.cnf file from template, with root password credentials, if mysql_enabled + template: + src: my.cnf.j2 + dest: /root/.my.cnf + owner: root + mode: 0600 + when: mysql_enabled | bool + # 'localhost' needs to be the last item for idempotency, see # http://ansible.cc/docs/modules.html#mysql-user # unfortunately it still doesn't work @@ -135,14 +143,6 @@ priv: "*.*:ALL,GRANT" when: mysql_enabled | bool -- name: Install .my.cnf file from template, with root password credentials, if mysql_enabled - template: - src: my.cnf.j2 - dest: /root/.my.cnf - owner: root - mode: 0600 - when: mysql_enabled | bool - - name: Update MySQL root password for all remaining root accounts (127.0.0.1, ::1) if mysql_enabled mysql_user: name: root From 3179a53ed1b3d9dab46c416e18db82feae834dfa Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 31 Oct 2019 10:23:13 -0500 Subject: [PATCH 14/20] python-psycopg2 -> python3-psycopg2 --- roles/moodle/tasks/main.yml | 3 +-- scripts/ansible | 2 +- scripts/ansible-2.8.x | 2 +- scripts/ansible-2.9.x | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/roles/moodle/tasks/main.yml b/roles/moodle/tasks/main.yml index f86785f5a..5495f230b 100644 --- a/roles/moodle/tasks/main.yml +++ b/roles/moodle/tasks/main.yml @@ -6,10 +6,9 @@ state: present when: not is_debuntu -- name: Install python-psycopg2 and 4 php packages (debuntu) +- name: Install 4 php packages (debuntu) package: name: - - python-psycopg2 - php{{ php_version }}-pgsql - php{{ php_version }}-curl #- php{{ php_version }}-zip diff --git a/scripts/ansible b/scripts/ansible index b41b810ff..7d60c147c 100755 --- a/scripts/ansible +++ b/scripts/ansible @@ -76,7 +76,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e "\napt update; apt install ansible and python3 dependencies\n" apt update - apt -y --allow-downgrades install ansible python3-distutils python3-mysqldb python3-passlib python3-pip python3-setuptools python3-virtualenv + apt -y --allow-downgrades install ansible python3-distutils python3-mysqldb python3-passlib python3-pip python3-setuptools python3-virtualenv python3-psycopg2 echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible'\n\n" diff --git a/scripts/ansible-2.8.x b/scripts/ansible-2.8.x index a9bbfe311..f789c965f 100755 --- a/scripts/ansible-2.8.x +++ b/scripts/ansible-2.8.x @@ -76,7 +76,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e "\napt update; apt install ansible and python3 dependencies\n" apt update - apt -y --allow-downgrades install ansible python3-distutils python3-mysqldb python3-passlib python3-pip python3-setuptools python3-virtualenv + apt -y --allow-downgrades install ansible python3-distutils python3-mysqldb python3-passlib python3-pip python3-setuptools python3-virtualenv python3-psycopg2 echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible'\n\n" # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") diff --git a/scripts/ansible-2.9.x b/scripts/ansible-2.9.x index 106aec67f..f33f00960 100755 --- a/scripts/ansible-2.9.x +++ b/scripts/ansible-2.9.x @@ -76,7 +76,7 @@ elif [ -f /etc/debian_version ]; then # Includes Debian, Ubuntu & Raspbian echo -e "\napt update; apt install ansible and python3 dependencies\n" apt update - apt -y --allow-downgrades install ansible python3-distutils python3-mysqldb python3-passlib python3-pip python3-setuptools python3-virtualenv + apt -y --allow-downgrades install ansible python3-distutils python3-mysqldb python3-passlib python3-pip python3-setuptools python3-virtualenv python3-psycopg2 echo -e "\nSUCCESS: verify Ansible using 'ansible --version' and/or 'apt -a list ansible'\n\n" # TEMPORARILY USE ANSIBLE 2.4.4 (REMOVE IT WITH "pip uninstall ansible") From 005b5e30544d574c575c32c0425a5c9775de22f4 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 31 Oct 2019 09:11:30 -0500 Subject: [PATCH 15/20] port kalite's pip to use python3 --- roles/kalite/tasks/install.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/roles/kalite/tasks/install.yml b/roles/kalite/tasks/install.yml index 89312d114..c5b46f402 100644 --- a/roles/kalite/tasks/install.yml +++ b/roles/kalite/tasks/install.yml @@ -1,10 +1,4 @@ # For OS's other than Fedora 18 - -- name: Install package python-virtualenv allowing KA Lite install into {{ kalite_venv }} - package: - name: python-virtualenv - state: present - - name: Download {{ kalite_requirements }} to {{ pip_packages_dir }}/kalite.txt get_url: url: "{{ kalite_requirements }}" @@ -26,6 +20,8 @@ version: "{{ kalite_version }}" virtualenv: "{{ kalite_venv }}" virtualenv_site_packages: no + virtualenv_command: /usr/bin/virtualenv + virtualenv_python: python2.7 extra_args: "--no-cache-dir" # extra_args="--disable-pip-version-check" when: internet_available and is_debuntu @@ -44,6 +40,8 @@ version: "{{ kalite_version }}" virtualenv: "{{ kalite_venv }}" virtualenv_site_packages: no + virtualenv_command: /usr/bin/virtualenv + virtualenv_python: python2.7 # extra_args="--no-cache-dir" # extra_args="--disable-pip-version-check" when: internet_available and not is_debuntu From 338ed86b7231bebfc835dbc5d5a8eaf6da5be3bd Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 31 Oct 2019 09:14:15 -0500 Subject: [PATCH 16/20] port calibre-web's pip to use python3 --- roles/calibre-web/tasks/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roles/calibre-web/tasks/main.yml b/roles/calibre-web/tasks/main.yml index 7882e00de..74833fe5f 100644 --- a/roles/calibre-web/tasks/main.yml +++ b/roles/calibre-web/tasks/main.yml @@ -51,6 +51,9 @@ requirements: "{{ calibreweb_venv_path }}/requirements.txt" virtualenv: "{{ calibreweb_venv_path }}" virtualenv_site_packages: no + virtualenv_command: /usr/bin/virtualenv + virtualenv_python: python2.7 + when: internet_available | bool - name: Symlink {{ calibreweb_venv_path }}/vendor to {{ calibreweb_venv_path }}/lib/python2.7/site-packages to keep cps.py happy From 9844db85cb0bd55a3d550d698e9dd65e63919042 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 31 Oct 2019 10:10:28 -0500 Subject: [PATCH 17/20] don't install python2 versions of pip setuptools virtualenv --- roles/2-common/tasks/packages.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/roles/2-common/tasks/packages.yml b/roles/2-common/tasks/packages.yml index 7b9f604ec..89b3bad4e 100644 --- a/roles/2-common/tasks/packages.yml +++ b/roles/2-common/tasks/packages.yml @@ -63,13 +63,3 @@ - usbutils - wget state: present - -# These are added to scripts/ansible for python3 support and will be removed -# once the pip calls are ported to use python3 -- name: "Install 3 common Python packages: python-pip, python-setuptools, python-virtualenv" - package: - name: - - python-pip - - python-setuptools - - python-virtualenv - state: present From 27439bcd71c83032add7d74a875340a18c0e2d03 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 31 Oct 2019 10:12:17 -0500 Subject: [PATCH 18/20] install python in 4-server-options and group related actions --- roles/3-base-server/tasks/main.yml | 5 ----- roles/4-server-options/tasks/main.yml | 21 ++++++++++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/roles/3-base-server/tasks/main.yml b/roles/3-base-server/tasks/main.yml index 6f43f84a2..2b1672f1a 100644 --- a/roles/3-base-server/tasks/main.yml +++ b/roles/3-base-server/tasks/main.yml @@ -21,11 +21,6 @@ state: restarted when: not installing -- name: Create a Python interface to iiab.env - template: - src: roles/1-prep/templates/iiab_env.py.j2 - dest: /etc/iiab/iiab_env.py - - name: Recording STAGE 3 HAS COMPLETED ===================== lineinfile: dest: "{{ iiab_env_file }}" diff --git a/roles/4-server-options/tasks/main.yml b/roles/4-server-options/tasks/main.yml index 2a226583c..82e5a1aab 100644 --- a/roles/4-server-options/tasks/main.yml +++ b/roles/4-server-options/tasks/main.yml @@ -13,11 +13,6 @@ when: named_install | bool tags: base, named, network, domain -- name: Installing captive portal - include_tasks: roles/captive-portal/tasks/main.yml - when: captive_portal_install | bool - tags: base, captive-portal, network, domain - - name: Installing dhcpd include_tasks: roles/network/tasks/dhcpd.yml when: dhcpd_install | bool @@ -28,6 +23,22 @@ when: squid_install | bool tags: base, squid, network, domain +# until porting is complete +- name: Install python2 + package: + name: python2 + state: present + +- name: Create a Python interface to iiab.env + template: + src: roles/1-prep/templates/iiab_env.py.j2 + dest: /etc/iiab/iiab_env.py + +- name: Installing captive portal + include_tasks: roles/captive-portal/tasks/main.yml + when: captive_portal_install | bool + tags: base, captive-portal, network, domain + - name: Install Bluetooth - only on Raspberry Pi include_role: name: bluetooth From eb466081195003b668424fbebb822ac31797839e Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Thu, 31 Oct 2019 12:43:29 -0500 Subject: [PATCH 19/20] python package exists on all platforms --- roles/4-server-options/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/4-server-options/tasks/main.yml b/roles/4-server-options/tasks/main.yml index 82e5a1aab..409ebf366 100644 --- a/roles/4-server-options/tasks/main.yml +++ b/roles/4-server-options/tasks/main.yml @@ -24,9 +24,9 @@ tags: base, squid, network, domain # until porting is complete -- name: Install python2 +- name: Install python package: - name: python2 + name: python state: present - name: Create a Python interface to iiab.env From 3ab8e6f5abe74ee794dffc5f074baf009a5d5ac3 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 31 Oct 2019 16:00:57 -0400 Subject: [PATCH 20/20] Code clarif & mandate 2.9.0 --- iiab-install | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iiab-install b/iiab-install index de9513616..43851997c 100755 --- a/iiab-install +++ b/iiab-install @@ -10,7 +10,7 @@ CWD=`pwd` OS=`grep ^ID= /etc/*release|cut -d= -f2` OS=${OS//\"/} MIN_RPI_KERN=4.9.59-v7+ # UPDATE THIS SOON...when Raspbian's Oct 2019 kernels are finally fixed (https://github.com/iiab/iiab/issues/1993 etc) -MIN_ANSIBLE_VER=2.7.14 +MIN_ANSIBLE_VER=2.9.0 if [ ! -f /etc/iiab/local_vars.yml ]; then @@ -151,6 +151,7 @@ echo -e "Running local playbooks....Stage 0 will now run....followed by Stages $ export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" ansible -m setup -i $INVENTORY localhost --connection=local | grep python -ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null +ansible -m setup -i $INVENTORY localhost --connection=local >> /dev/null # So vars are recorded in /opt/iiab/iiab/iiab-install.log ansible-playbook -i $INVENTORY $PLAYBOOK ${ARGS} --connection=local + echo -e "./iiab-install $* COMPLETED IN $CWD\n\n"