-
-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathinstall_packages_yum.yml
37 lines (34 loc) · 1.2 KB
/
install_packages_yum.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
- name: Install EPEL repository
yum:
name: epel-release
state: installed
when: netbox_install_epel
- name: Install required packages for selected NetBox configuration
yum:
name: "{{ _netbox_yum_packages | flatten }}"
state: present
update_cache: true
vars:
_netbox_yum_packages:
- "{{ netbox_python_packages }}"
- "{{ netbox_packages }}"
- "{{ netbox_ldap_packages if netbox_ldap_enabled else [] }}"
- "{{ 'git' if netbox_git else [] }}"
- "{{ 'acl' if ('SUDO_USER' in ansible_env and ansible_env.SUDO_USER != 'root') else [] }}"
# python3 pip package not available on EPEL.
- name: Ensure pip is available on Red Hat-based distros
shell: "{{ netbox_python_binary }} -m pip -V || {{ netbox_python_binary }} -m ensurepip"
register: _existence_of_pip
changed_when: "'Successfully installed pip' in _existence_of_pip.stdout"
# python3 psycopg2/selinux packages are not available on EPEL.
- name: Install psycopg2/selinux via pip on Red Hat-based distros
pip:
name:
- psycopg2-binary
- selinux
state: present
vars:
ansible_python_interpreter: "{{ netbox_python_binary }}"
environment:
PATH: "/usr/local/bin:{{ _path }}"