Skip to content

Commit

Permalink
boostrap: set ansible_python_interpreter in vars
Browse files Browse the repository at this point in the history
Allows to override it locally at task level, unlike set_fact.
  • Loading branch information
VannTen committed Mar 8, 2024
1 parent cc95da5 commit be82f54
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 22 deletions.
4 changes: 0 additions & 4 deletions roles/bootstrap-os/tasks/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,3 @@
- '"changed its" in bootstrap_update_apt_result.stdout'
- '"value from" in bootstrap_update_apt_result.stdout'
ignore_errors: true

- name: Set the ansible_python_interpreter fact
set_fact:
ansible_python_interpreter: "/usr/bin/python3"
6 changes: 0 additions & 6 deletions roles/bootstrap-os/tasks/fedora-coreos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,3 @@
delay: 5
sleep: 5
when: need_bootstrap.rc != 0

- name: Store the fact if this is an fedora core os host
set_fact:
is_fedora_coreos: True
tags:
- facts
12 changes: 0 additions & 12 deletions roles/bootstrap-os/tasks/flatcar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,13 @@
tags:
- facts

- name: Force binaries directory for Flatcar Container Linux by Kinvolk
set_fact:
bin_dir: "/opt/bin"
tags:
- facts

- name: Run bootstrap.sh
script: bootstrap.sh
become: true
environment: "{{ proxy_env }}"
when:
- need_bootstrap.rc != 0

- name: Set the ansible_python_interpreter fact
set_fact:
ansible_python_interpreter: "{{ bin_dir }}/python"
tags:
- facts

- name: Disable auto-upgrade
systemd:
name: locksmithd.service
Expand Down
2 changes: 2 additions & 0 deletions roles/bootstrap-os/vars/debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
ansible_python_interpreter: "/usr/bin/python3"
2 changes: 2 additions & 0 deletions roles/bootstrap-os/vars/fedora-coreos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
is_fedora_coreos: True
3 changes: 3 additions & 0 deletions roles/bootstrap-os/vars/flatcar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bin_dir: "/opt/bin"
ansible_python_interpreter: "{{ bin_dir }}/python"
1 change: 1 addition & 0 deletions roles/bootstrap-os/vars/ubuntu.yml

0 comments on commit be82f54

Please sign in to comment.