Skip to content

Commit

Permalink
Merge pull request #1279 from grycap/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
micafer authored Feb 7, 2022
2 parents 0be1da7 + 738772b commit baf736d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
20 changes: 11 additions & 9 deletions ansible_install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
connection: local
tasks:
- name: Yum install epel-release
action: yum pkg=epel-release state=installed
command: yum install -y epel-release
when: ansible_os_family == "RedHat" and ansible_distribution != "Fedora"

- name: Install libselinux-python in RH
action: yum pkg=libselinux-python state=installed
command: yum install -y libselinux-python
when: ansible_os_family == "RedHat" and ansible_distribution != "Fedora"

################################################ Configure Ansible ###################################################
Expand Down Expand Up @@ -38,13 +38,17 @@
apt: update_cache=yes cache_valid_time=3600
when: ansible_os_family == "Debian"

- name: Debian/Ubuntu install requisites
apt: name=gcc,openssh-client,sshpass install_recommends=no
when: ansible_os_family == "Debian"

- name: Debian/Ubuntu install python3-pip with apt
apt: name=python3-pip,python3-dev,gcc,openssh-client,sshpass install_recommends=no
when: ansible_distribution == "Debian" or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int >= 20)
apt: name=python3-pip,python3-dev install_recommends=no
when: ansible_os_family == "Debian" and ansible_python_version is version('3', '>=')

- name: Debian/Ubuntu install python-pip with apt
apt: name=python-pip,python-dev,gcc,openssh-client,sshpass install_recommends=no
when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int < 20
apt: name=python-pip,python-dev install_recommends=no
when: ansible_os_family == "Debian" and ansible_python_version is version('3', '<')

- name: Apt install requirements Debian
apt: name=default-libmysqlclient-dev
Expand All @@ -63,7 +67,7 @@
when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int < 20

- name: Yum install requirements RH
yum: name=python3-pip,wget,openssh-clients,sshpass,gcc,python3-devel,mysql-devel
command: yum install -y python3-pip wget openssh-clients sshpass gcc python3-devel mysql-devel
when: ansible_os_family == "RedHat" and ansible_distribution != "Fedora"

- name: Yum install requirements Fedora
Expand All @@ -85,14 +89,12 @@
pip:
name: pip>18.0,<21.0
executable: "{{pip_exec}}"
extra_args: --prefer-binary
when: ansible_python_version is version('3.6', '<')

- name: Upgrade pip in py3.6 +
pip:
name: pip>18.0
executable: "{{pip_exec}}"
extra_args: --prefer-binary
when: ansible_python_version is version('3.6', '>=')

- name: Install setuptools with pip
Expand Down
15 changes: 11 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ distribution_major_version() {
}

ansible_installed=`type -p ansible-playbook`
ansible3_installed=`type -p ansible-playbook-3`

if [ x${ansible_installed}x != "xx" ]
if [ x${ansible_installed}x == "xx" ] && [ x${ansible3_installed}x == "xx" ]
then
echo "Ansible installed. Do not install."
else
echo "Ansible not installed. Installing ..."
DISTRO=$(distribution_id)
case $DISTRO in
Expand Down Expand Up @@ -100,6 +99,8 @@ else
echo "Unsupported distribution: $DISTRO"
;;
esac
else
echo "Ansible installed. Do not install."
fi

if [ -f "ansible_install.yaml" ]
Expand All @@ -111,4 +112,10 @@ else
fi

echo "Call Ansible playbook to install the IM."
ansible-playbook ansible_install.yaml
ansible3_installed=`type -p ansible-playbook-3`
if [ x${ansible3_installed}x != "xx" ]
then
ansible-playbook-3 ansible_install.yaml
else
ansible-playbook ansible_install.yaml
fi

0 comments on commit baf736d

Please sign in to comment.