Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
big fix
Browse files Browse the repository at this point in the history
  • Loading branch information
oEscal committed Sep 22, 2021
1 parent f64a94a commit d6ec6e7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 38 deletions.
6 changes: 6 additions & 0 deletions inventory/default/group_vars/edgenode_group/10-default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ os_yum_base_packages:
moreutils,jq,python-devel,createrepo,psmisc,bash-completion,rsync,patch,libselinux-python,libselinux-python3"
_os_yum_exclude_rpm_packages: "exclude=kernel-3* kernel-rt* kernel-rt-kvm* kernel-rt-devel*"

os_ubuntu_base_packages:
"vim-common,curl,lvm2,python3,wget,bridge-utils,libboost-all-dev,libpcre3,libpcre3-dev,zlib1g-dev,libglib2.0-dev,\
autoconf,automake,libtool,flex,bison,cmake,pciutils,python-websocket,libjsoncpp-dev,libfcgi-dev,libhiredis-dev,libnuma-dev,\
build-essential,psmisc,python-httplib2,libpixman-1-dev,moreutils,jq,python-dev-is-python2,psmisc,bash-completion,rsync,\
patch"

# URLs to docker images saved with `docker save <image>:<ver> | gzip > <image>.tar.gz` that are going to be preloaded after docker setup
docker_images: []

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
# Copyright (c) 2019-2020 Intel Corporation

---
- name: install necessary dependencies on Ubuntu
apt:
name:
- moreutils # for sponge command
- jq
update-cache: yes
become: yes

- name: create config directory
file:
path: "{{ _configs_dest }}"
Expand Down
57 changes: 27 additions & 30 deletions roles/infrastructure/os_setup/tasks/install_base_os_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

---
- debug:
msg: "Installing the following packages: {{ os_yum_base_packages }}"
msg: "Installing the following packages: {{ os_yum_base_packages if ansible_distribution == 'CentOS' else os_ubuntu_base_packages }}"

- name: install IUS repository
yum:
Expand All @@ -26,6 +26,29 @@
_openssl_url: "https://{{ hostvars[groups['controller_group'][0]]['ansible_host'] }}/{{ _openssl_package_name }}.tar.gz"
when: offline_enable

- name: install Python 2 and pip2 on Ubuntu
block:
- name: install Python 2 on Ubuntu
apt:
name: python2
state: present
update_cache: yes
become: yes
when: ansible_distribution == "Ubuntu"

- name: download pip2 on Ubuntu
get_url:
url: https://bootstrap.pypa.io/pip/2.7/get-pip.py
dest: /home/openness/get-pip.py
mode: '0777'
become: yes
when: ansible_distribution == "Ubuntu"

- name: Install pip2 in Ubuntu
command: python2 /home/openness/get-pip.py
become: yes
when: ansible_distribution == "Ubuntu"

- name: install base OS rpm packages
yum:
name: "{{ os_yum_base_packages }}"
Expand All @@ -35,41 +58,15 @@
become: yes
when: ansible_distribution == "CentOS"

- name: install make in Ubuntu distributions
apt:
name: make
state: present
become: yes
when: ansible_distribution == "Ubuntu"

- name: install gcc in Ubuntu distributions
- name: install base OS Ubuntu packages
apt:
name: gcc
state: present
become: yes
when: ansible_distribution == "Ubuntu"

- name: install Python 2 in Ubuntu
apt:
name: python2
name: "{{ os_ubuntu_base_packages }}"
state: present
skip_broken: yes
update_cache: yes
become: yes
when: ansible_distribution == "Ubuntu"

- name: Download pip2 in ubuntu
get_url:
url: https://bootstrap.pypa.io/pip/2.7/get-pip.py
dest: /home/openness/get-pip.py
mode: '0777'
become: yes
when: ansible_distribution == "Ubuntu"

- name: Install pip2 in Ubuntu
command: python2 /home/openness/get-pip.py
become: yes
when: ansible_distribution == "Ubuntu"

- name: upgrade python2-pip version
command: "python2 -m pip install {{ local_pip }} --upgrade pip=={{ _pip_version }}"
register: result
Expand Down

0 comments on commit d6ec6e7

Please sign in to comment.