sw_ansible_webui
Ansible Role - Ansible-WebUI
Role to provision a basic WebUI for using Ansible on a linux server.
DISCLAIMER: This WebUI is an unofficial community project! Do not confuse it with the vanilla Ansible product!
Tested:
- Debian 12
Install
# latest
ansible-galaxy role install git+https://github.com/ansibleguy/sw_ansible_webui
# from galaxy
ansible-galaxy install ansibleguy.sw_ansible_webui
# or to custom role-path
ansible-galaxy install ansibleguy.sw_ansible_webui --roles-path ./roles
# install dependencies
ansible-galaxy install -r requirements.yml
Usage
Config
Define the config as needed:
Minimal config:
ansible_webui:
config:
AW_HOSTNAMES: 'ansible.template.ansibleguy.net'
Options:
ansible_webui:
manage:
webserver: true # install and configure local nginx with min-ca cert
backup: true # install service for daily local database backup (if database is managed)
user: true # create service-user 'ansible-webui'
ansible_cfg: true # provision /home/ansible-webui/ansible.cfg
requirements: # requirements your execution-environment needs
pip: ['httpx'] # any python3-modules
collections: ['community.general'] # any ansible-collections (if persistent_requirements=true)
roles: [] # any ansible-roles (if persistent_requirements=true)
config: # for options see: https://webui.ansibleguy.net/en/latest/usage/4_config.html#settings
AW_HOSTNAMES: 'ansible.template.ansibleguy.net'
# AW_SECRET: '...' # minimum 30 characters; random one will be used if none was provided
ansible_config: # /home/ansible-webui/ansible.cfg => if manage.ansible_cfg=true; see: https://docs.ansible.com/ansible/latest/reference_appendices/config.html
defaults: # section
remote_port: 48322
vault_id_match: 'webui'
diff:
context: 2
nginx:
... # configure the webserver settings => see: https://github.com/ansibleguy/infra_nginx
You might want to use 'ansible-vault' to encrypt your passwords:
ansible-vault encrypt_string
Execution
Run the playbook:
ansible-playbook -K -D -i inventory/hosts.yml playbook.yml
There are also some useful tags available:
- config
- webserver
To debug errors - you can set the 'debug' variable at runtime:
ansible-playbook -K -D -i inventory/hosts.yml playbook.yml -e debug=yes
Functionality
Package installation
- Python3, Python3-PIP, Python3-Virtualenv, Git, Git-LFS
- AnsibleGuy-WebUI with its Python3 Module-dependencies
Configuration
Virtual-Environment used (
/home/ansible-webui/venv
)Default config:
- Cleanup logs older than 180 days
- Backup retention 30 days
Default opt-ins:
- Installing common Python3 modules ('jmespath', 'netaddr', 'passlib', 'pywinrm', 'requests', 'cryptography')
- Daily local backups
- Auto-Upgrade App and Requirements on service-startup
- Nginx proxy
- Create service-user
Info
Note: this role currently only supports debian-based systems
Note: Most of the role's functionality can be opted in or out.
For all available options - see the default-config located in the main defaults-file!
Warning: Not every setting/variable you provide will be checked for validity. Bad config might break the role!
Ansible role to provision a basic WebUI for using Ansible on a linux server
ansible-galaxy install ansibleguy/sw_ansible_webui