https://github.com/slowki/ansible-jsonnet
A Jsonnet lookup plugin for Ansible
https://github.com/slowki/ansible-jsonnet
ansible jsonnet
Last synced: 3 months ago
JSON representation
A Jsonnet lookup plugin for Ansible
- Host: GitHub
- URL: https://github.com/slowki/ansible-jsonnet
- Owner: Slowki
- License: mit
- Created: 2023-03-17T16:20:47.000Z (over 3 years ago)
- Default Branch: develop
- Last Pushed: 2023-04-09T23:18:57.000Z (over 3 years ago)
- Last Synced: 2025-02-10T06:24:25.722Z (over 1 year ago)
- Topics: ansible, jsonnet
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `slowki.jsonnet` - Jsonnet for Ansible
A Jsonnet lookup plugin for Ansible.
## Example
**files/foo.jsonnet**
```jsonnet
local ansible_facts = import 'ansible_facts';
ansible_facts.ansible_host
```
**tasks/main.yaml**
```yaml
# Search for `foo.jsonnet` in the `files` subdirectory and return the evaluted object
- ansible.builtin.debug:
msg: "{{ lookup('slowki.jsonnet.jsonnet', 'foo.jsonnet') }}" # => my_hostname_here
```