NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
22.89k stars 2.66k forks source link

Autoconfig hosts via ansible #871

Open Secarius opened 3 years ago

Secarius commented 3 years ago

Describe the solution you'd like We are using ansible to deploy hosts and configs, is there a way to have an ansible plugin to add proxy hosts via ansible?

Describe alternatives you've considered a simple way to add an new proxy host via ansible playbook

chaptergy commented 3 years ago

Maybe looking at the api could help you write an ansible script for this

m-chingis commented 2 years ago

Hello @Secarius , I have almost the same task to accomplish. Did you find a suitable solution?

Secarius commented 2 years ago

@m-chingis no sorry, i had no time to look into the api

m-chingis commented 2 years ago

@Secarius in on of the threads related to this topic I found this repo https://github.com/Xantios/nginx-proxy-manager-assistant it is written in JavaScript, so very easy to understand how to work with API. already tried to adapt as bash script. Later will make ansible wrapper.

DenAV commented 2 years ago

Hello @chaptergy , I tried to create a script. Almost everything worked, only I can't find how to enter email for certbot. warning Command failed: certbot certonly --config "/etc/letsencrypt.ini" --cert-name "npm-1" --agree-tos --authenticator webroot --email "undefined" --preferred-challenges "dns,http" --domains "site-2.xxx.net" Saving debug log to /var/log/letsencrypt/letsencrypt.log Unable to register an account with ACME server

Script: https://github.com/DenAV/nginx-proxy-manager-ansible

If I have created a first certificate with WebUI, then I can create the next certificates, no longer shows an error.

info Command: certbot certonly --config "/etc/letsencrypt.ini" --cert-name "npm-6" --agree-tos --authenticator webroot --email "undefined" --preferred-challenges "dns,http" --domains "site-2.xxx.net" success Requesting a certificate for site-2.xxx.net

what have I missed?

github-actions[bot] commented 7 months ago

Issue is now considered stale. If you want to keep it open, please comment :+1: