teslamotors / ansible_puller

Ansible daemon for massively-scaleable Ansible
MIT License
125 stars 33 forks source link

Add auth header support. #52

Open dmeulen opened 2 weeks ago

dmeulen commented 2 weeks ago

This makes it possible to authenticate with the gitlab or github API by specifying a PRIVATE-TOKEN or Authorization header with the http request.

Now you can download the ansible source tarball and md5 directly from the gitlab or github package registry using the gitlab API.

example config:

{
  "http-url": "gitlab.ops.catdevbrain.lan/api/v4/projects/4/jobs/artifacts/main/raw/catdevbrain-ansible-latest.tar.gz?job=build_latest",
  "http-checksum-url": "gitlab.ops.catdevbrain.lan/api/v4/projects/4/jobs/artifacts/main/raw/catdevbrain-ansible-latest.tar.gz.md5?job=build_latest",
  "http-proto": "https",
  "http-header-name": "PRIVATE-TOKEN",
  "http-header-value": "<REDACTED>",
  "ansible-dir": "ansible",
  "ansible-inventory": ["inventories/catdevbrain"],
  "playbook": "site.yml",
  "sleep": "10",
  "sleep-jitter": "5"
}