From 8edbfe63b92549b05622f400d331a8f10572dbcc Mon Sep 17 00:00:00 2001 From: Stonewall Jackson Date: Fri, 10 Feb 2023 20:31:58 -0500 Subject: add cgit documentation --- roles/cgit/README.md | 59 ++++++++++++++++++++++++++++++++++++++++++++ roles/cgit/defaults/main.yml | 3 +-- 2 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 roles/cgit/README.md (limited to 'roles/cgit') diff --git a/roles/cgit/README.md b/roles/cgit/README.md new file mode 100644 index 0000000..5752229 --- /dev/null +++ b/roles/cgit/README.md @@ -0,0 +1,59 @@ +cgit +==== + +Description +----------- + +The `cgit` role installs and configures [cgit](https://git.zx2c4.com/cgit/about/), +a web frontend for Git. It does _not_ configure a webserver. + + +Variables +--------- + +This role **accepts** the following variables: + +Variable | Default | Description +-------------------------|------------------------------------------------------------------|------------ +`cgit_clone_prefixes` | `['https://{{ ansible_fqdn }}', 'ssh://git@{{ ansible_fqdn }}']` | Clone URLs to show on repository pages +`cgit_title` | `{{ organization }} Git Repository` | Title shown on index page +`cgit_description` | `Source code for various {{ organization }} projects` | Subtitle shown on index page +`cgit_cache_size` | 1000 | Number of pages to cache +`cgit_project_list` | `/var/www/git/projects.list` | Path to repository list +`cgit_scan_path` | `/var/www/git/repositories` | Path containing Git repositories +`cgit_enable_http_clone` | no | Let cgit handle clones over HTTP +`cgit_repository_sort` | `name` | Sort repositories by either `name` or `age` +`cgit_branch_sort` | `name` | Sort branches by either `name` or `age` +`cgit_about_html` | see [default vars](defaults/main.yml) | HTML to include in About page +`cgit_favicon` |   | Path to custom favicon image +`cgit_logo` |   | Path to custom logo image (ideally 96x64) +`cgit_css` |   | Path to custom CSS file +`cgit_head_include` |   | Path to custom HTML `` include +`cgit_header` |   | Path to custom HTML header + +This role **exports** the following variables: + +Variable | Description +------------------|------------ +`cgit_static_dir` | Path to static assets +`cgit_cgi_script` | Path to CGI binary + + +Usage +----- + +Example playbook: + +````yaml +- name: configure git repository + hosts: git_servers + roles: + - role: cgit + tags: cgit,git + vars: + cgit_clone_prefixes: + - https://git.example.com + cgit_title: Example Org Git Repository + cgit_logo: ~/Pictures/cgit_logo.png + cgit_favicon: ~/Pictures/cgit_favicon.ico +```` diff --git a/roles/cgit/defaults/main.yml b/roles/cgit/defaults/main.yml index 72b8b8a..5866296 100644 --- a/roles/cgit/defaults/main.yml +++ b/roles/cgit/defaults/main.yml @@ -1,12 +1,11 @@ cgit_clone_prefixes: - https://{{ ansible_fqdn }} - - ssh://{{ ansible_fqdn }} + - ssh://git@{{ ansible_fqdn }} cgit_title: '{{ organization }} Git Repository' cgit_description: Source code of various {{ organization }} projects. cgit_cache_size: 1000 -cgit_user: git cgit_project_list: /var/www/git/projects.list cgit_scan_path: /var/www/git/repositories -- cgit