>我想知道是否可以覆盖剧本中ansible.cfg
文件中设置的executable
值。下面这样...
---
- name: 'New Server Setup'
hosts: 'all'
gather_facts: false
pre_tasks:
- name: 'setup : installing python for ansible'
raw: 'test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)'
changed_when: false
- setup: # aka gather_facts
tags: setup
user: root
become: yes
become_method: sudo
executable: '/bin/bash'
roles:
- setup
我已经尝试了我能想到的一切,但似乎没有任何效果。
根据 ansible,
从版本 2.1 开始,这可以被清单 var ansible_shell_executable覆盖。