Skip to content

Commit

Permalink
Removed ansible_pkg_mgr variable in provision playbook
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcr01 committed Aug 28, 2024
1 parent 549f9b3 commit 6706efc
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/ansible-playbooks/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@
dnf:
name: "{{ rpm_deps }}"
state: present
when: ansible_pkg_mgr == "dnf"
when: ansible_os_family == 'RedHat'

# ---------------------------------------------------------------------

- name: Install required dependencies YUM
yum:
name: "{{ rpm_deps }}"
state: present
when: ansible_pkg_mgr == "yum"
when: ansible_os_family == 'RedHat'

# ---------------------------------------------------------------------

Expand All @@ -61,7 +61,7 @@
name: "{{ apt_deps }}"
state: present
update_cache: yes
when: ansible_pkg_mgr == "apt"
when: ansible_os_family == 'Debian'
when:
- install_deps is defined
- install_deps == true
Expand All @@ -76,7 +76,7 @@
apt_repository:
repo: 'ppa:deadsnakes/ppa'
when:
- ansible_pkg_mgr == "apt"
- ansible_os_family == 'Debian'
- ansible_distribution == "Ubuntu"

- name: Install Python3.9 on Ubuntu Jammy
Expand All @@ -87,21 +87,20 @@
state: present
update_cache: yes
when:
- ansible_pkg_mgr == "apt"
- ansible_os_family == 'Debian'
- ansible_distribution == "Ubuntu"
- ansible_distribution_release == "jammy"

- name: Change Python link Ubuntu Jammy
command: ln -sf /usr/bin/python3.9 /usr/bin/python3
when:
- ansible_pkg_mgr == "apt"
- ansible_distribution == "Ubuntu"
- ansible_os_family == 'Debian'
- ansible_distribution_release == "jammy"

- name: Change Python link Ubuntu Xenial
command: ln -sf /usr/local/bin/python3.8 /usr/bin/python3
when:
- ansible_pkg_mgr == "apt"
- ansible_os_family == 'Debian'
- ansible_distribution == "Ubuntu"
- ansible_distribution_release == "xenial"

Expand All @@ -112,12 +111,12 @@
path: /usr/bin/pip3
register: stat_pip3
when:
- ansible_pkg_mgr == "apt"
- ansible_os_family == 'Debian'

- name: Install pip Ubuntu\Debian
shell: curl https://bootstrap.pypa.io/get-pip.py | python3 -
when:
- ansible_pkg_mgr == "apt"
- ansible_os_family == 'Debian'
- stat_pip3.stat.exists == False
- ansible_distribution_release != "xenial"
- ansible_distribution_release != "focal"
Expand All @@ -126,7 +125,7 @@
- name: Install pip Ubuntu Xenial
shell: curl https://bootstrap.pypa.io/get-pip.py | python3 -
when:
- ansible_pkg_mgr == "apt"
- ansible_os_family == 'Debian'
- stat_pip3.stat.exists == False
- ansible_distribution_release == "xenial"

Expand Down

0 comments on commit 6706efc

Please sign in to comment.