Hello,
Ansible has a variable “{{ playbook_dir }}” that gives the playbook directory path.
Currently, I am doing in this way to get the playbook directory in the hive(python source code) task, but is there any other way to directly get the “{{ playbook_dir }}” path without passing as an option explicitly?
---
- name: hive playbook
hosts: yum_hosts
tasks:
- name: execute a DDL statement from a HQL file.
hive:
playbook_path: "{{ playbook_dir }}"
register: result_execute
- name: dump
debug:
msg: '{{ result_execute }}'
Thank you