Skip to content

Commit a3f3d2f

Browse files
authored
install python3 only when ansible_system == Linux (#110)
* assume windows when ansible_connection is winrm Signed-off-by: Thomas Sjögren <[email protected]> * replace raw: with package: Signed-off-by: Thomas Sjögren <[email protected]> * revert back to raw Signed-off-by: Thomas Sjögren <[email protected]> * use uname to check if it's a Linux system Signed-off-by: Thomas Sjögren <[email protected]> --------- Signed-off-by: Thomas Sjögren <[email protected]>
1 parent bfb20e5 commit a3f3d2f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/molecule_plugins/vagrant/playbooks/prepare.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
hosts: all
44
gather_facts: false
55
tasks:
6+
- name: Gather system info
7+
ansible.builtin.raw: uname
8+
register: raw_uname
9+
changed_when: false
10+
failed_when: false
11+
612
- name: Bootstrap python for Ansible
713
ansible.builtin.raw: |
814
command -v python3 python || (
@@ -16,3 +22,4 @@
1622
)
1723
become: true
1824
changed_when: false
25+
when: raw_uname.rc == 0 and raw_uname.stdout | trim == "Linux"

0 commit comments

Comments
 (0)