Skip to content

Commit

Permalink
Update converge.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
buluma authored Jul 14, 2024
1 parent c2ff1e6 commit a08ecd5
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,35 @@
become: true
gather_facts: true

pre_tasks:
- name: Update apt cache.
apt: update_cache=yes cache_valid_time=600
when: ansible_os_family == 'Debian'
changed_when: false

- name: Check if python3.11 EXTERNALLY-MANAGED file exists
ansible.builtin.stat:
path: /usr/lib/python3.11/EXTERNALLY-MANAGED
register: externally_managed_file_py311

- name: Rename python3.11 EXTERNALLY-MANAGED file if it exists
ansible.builtin.command:
cmd: mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/EXTERNALLY-MANAGED.old
when: externally_managed_file_py311.stat.exists
args:
creates: /usr/lib/python3.11/EXTERNALLY-MANAGED.old

- name: Check if python3.12 EXTERNALLY-MANAGED file exists
ansible.builtin.stat:
path: /usr/lib/python3.12/EXTERNALLY-MANAGED
register: externally_managed_file_py312

- name: Rename python3.12 EXTERNALLY-MANAGED file if it exists
ansible.builtin.command:
cmd: mv /usr/lib/python3.12/EXTERNALLY-MANAGED /usr/lib/python3.12/EXTERNALLY-MANAGED.old
when: externally_managed_file_py312.stat.exists
args:
creates: /usr/lib/python3.12/EXTERNALLY-MANAGED.old

roles:
- role: ansible-role-python_pip

0 comments on commit a08ecd5

Please sign in to comment.