Repository URL to install this package:
|
Version:
1.0.0 ▾
|
---
#
# Copyright (c) 2018, Markus Binsteiner
#
# Licensed under The Parity Public license, Version 6.0.0 (the "license");
# and you may not use this file except in compliance with the license.
# You may obtain a copy of the License at
#
# https://licensezero.com/licenses/parity
#
#- name: "[checking for python]"
# raw: sh -c "test -e /usr/bin/python"
# ignore_errors: true
# register: python_exists
- name: "[testing sudo]"
raw: sh -c "true"
become: true
ignore_errors: true
register: can_sudo
changed_when: false
when: "not box_very_basics['root_init_done']"
- name: "[running root init tasks if possible]"
include_tasks: "{{ playbook_dir }}/../task_lists/box_basics_root.yml"
when: "not box_very_basics['root_init_done'] and not can_sudo.failed and can_sudo.rc == 0"
- name: setting python interpreter
set_fact:
freckles_python_interpreter: "{{ box_very_basics | select_python_interpreter }}"
ansible_python_interpreter: "{{ box_very_basics | select_python_interpreter }}"
#when: "box_very_basics['root_init_done'] or (can_sudo.failed or can_sudo.rc != 0)"
- name: fail if no python interpreter
fail:
msg: "Could not find usable Python interpreter, and can't install one because no sudo permissions."
when: "freckles_python_interpreter is not defined or not freckles_python_interpreter"
#- name: setting python interpreter
# set_fact:
# ansible_python_interpreter: "{{ box_very_basics['python'] }}"
# when: "box_very_basics['root_init_done'] or (can_sudo.failed or can_sudo.rc != 0)"
- name: "[gathering facts]"
setup: {}
tags: "always"
#when: "box_very_basics['root_init_done'] or (can_sudo.failed or can_sudo.rc != 0)"