Skip to content

Commit

Permalink
install python3 only when ansible_system == Linux (ansible-community#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 and dankow committed Mar 31, 2023
1 parent b42c9c3 commit 30739e6
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 30739e6

Please sign in to comment.