P3affects_2.8easyfixfeaturehacktoberfesthas_prmodule
Repository metrics
- Stars
- (68,548 stars)
- PR merge metrics
- (Avg merge 8d 18h) (74 merged PRs in 30d)
Description
SUMMARY
I'm using uri module to send the vaulted file, but Ansible doesn't decrypt it.
uri:
url: "http://localhost:8888/"
method: POST
src: file-encrypted.json
Instead, it's sending raw vault format, despite specifying --ask-vault-pass.
ISSUE TYPE
Bug Report- Feature Idea
COMPONENT NAME
uri
ANSIBLE VERSION
ansible 2.8.0
CONFIGURATION
n/a
OS / ENVIRONMENT
macOS
STEPS TO REPRODUCE
- Create a
file.jsonwith{'foo': 'bar'}content. - Vault it via:
ansible-vault encrypt file.json - Create the following playbook (e.g.
uri.yml):
---
- hosts: localhost
tasks:
- name: Send JSON file
uri:
url: "http://localhost:8888/"
method: POST
src: file.json
headers:
Content-Type: "application/json"
- On the other terminal, run the netcat on port 8888:
nc -vl 8888. - Run playbook via:
ansible-playbook uri.yml --ask-vault-pass -vvv
EXPECTED RESULTS
Original content of JSON file is sent.
ACTUAL RESULTS
Encrypted version is received instead:
$ nc -vl 8888
POST / HTTP/1.1
Accept-Encoding: identity
Host: localhost:8888
User-Agent: ansible-httpget
Content-Type: application/json
Content-Length: 355
Connection: close
$ANSIBLE_VAULT;1.1;AES256
39373739353265643239323865303463303638656538663366663330343835353834306462646232
3332326234303438396263663337646134393563333165640a616433366364666161366231326463