Skip to content

Commit

Permalink
install python3 only when ansible_system == Linux (#110)
Browse files Browse the repository at this point in the history
* assume windows when ansible_connection is winrm

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* replace raw: with package:

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* revert back to raw

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

* use uname to check if it's a Linux system

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>

---------

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
  • Loading branch information
konstruktoid authored Mar 23, 2023
1 parent bfb20e5 commit a3f3d2f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/molecule_plugins/vagrant/playbooks/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
hosts: all
gather_facts: false
tasks:
- name: Gather system info
ansible.builtin.raw: uname
register: raw_uname
changed_when: false
failed_when: false

- name: Bootstrap python for Ansible
ansible.builtin.raw: |
command -v python3 python || (
Expand All @@ -16,3 +22,4 @@
)
become: true
changed_when: false
when: raw_uname.rc == 0 and raw_uname.stdout | trim == "Linux"

0 comments on commit a3f3d2f

Please sign in to comment.