From d9200602740fff0b5bc6800230244f9a42566c7d Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Wed, 7 Dec 2016 20:17:06 +0200 Subject: [PATCH] - Consistent indentation. - Don't install apache2, already covered by apache dependency. - Removed support for Trusty, don't have cgit packaged. --- meta/main.yml | 1 - molecule.yml | 9 ---- tasks/cgit.yml | 134 +++++++++++++++++++++++-------------------------- tasks/main.yml | 5 +- 4 files changed, 65 insertions(+), 84 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index d654a8a..7125e5a 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -11,7 +11,6 @@ galaxy_info: - jessie - name: Ubuntu versions: - - trusty - xenial galaxy_tags: [ git, scm, gitolite ] dependencies: diff --git a/molecule.yml b/molecule.yml index 7868963..d39abbf 100644 --- a/molecule.yml +++ b/molecule.yml @@ -18,8 +18,6 @@ vagrant: box: kaorimatz/openbsd-6.0-amd64 - name: jessie box: debian/jessie64 - - name: trusty - box: ubuntu/trusty64 - name: xenial box: ubuntu/xenial64 instances: @@ -57,10 +55,3 @@ docker: environment: DEBIAN_FRONTEND: noninteractive container: docker - - name: gitolite-trusty - image: ubuntu - image_version: trusty - command: /sbin/init - environment: - DEBIAN_FRONTEND: noninteractive - container: docker diff --git a/tasks/cgit.yml b/tasks/cgit.yml index 37bdf57..edb74a5 100644 --- a/tasks/cgit.yml +++ b/tasks/cgit.yml @@ -2,15 +2,10 @@ # tasks file for cgit - name: APT install cgit apt: - name: '{{ item }}' - state: present - update_cache: yes - cache_valid_time: 3600 - with_items: - - cgit - - git - - apache2 - - python-docutils + name: ['cgit', 'python-docutils'] + state: present + update_cache: yes + cache_valid_time: 3600 - name: Allow Apache to access to gitolite repositories user: @@ -23,10 +18,10 @@ - name: Enable CGI Apache module (always changes) apache2_module: - name: cgi - state: present + name: cgi + state: present notify: - - Restart Apache + - Restart Apache - name: Add cgit Apache site template: @@ -38,66 +33,65 @@ notify: - Reload Apache -- name: Add symlink for rst2html (hack, fixed in Stretch) - when: ansible_distribution_major_version|int < 9 +- name: Add symlink for rst2html (workaround, bug fixed in Stretch) file: - src: /usr/share/docutils/scripts/python2/rst2html - dest: /usr/local/bin/rst2html.py - owner: root - group: root - state: link + src: /usr/share/docutils/scripts/python2/rst2html + dest: /usr/local/bin/rst2html.py + owner: root + group: root + state: link - name: Configure cgit lineinfile: - dest: /etc/cgitrc - line: '{{ item.line }}' - regexp: '{{ item.regexp|default(omit) }}' - insertbefore: '{{ item.insertbefore|default(omit) }}' + dest: /etc/cgitrc + line: '{{ item.line }}' + regexp: '{{ item.regexp|default(omit) }}' + insertbefore: '{{ item.insertbefore|default(omit) }}' with_items: - - line: 'css=/cgit/css/cgit.css' - regexp: '^css=' - - line: 'logo=/cgit/css/cgit.png' - regexp: '^logo=' - - line: 'favicon=/cgit/css/favicon.ico' - regexp: '^favicon=' - - line: 'about-filter=/usr/lib/cgit/filters/about-formatting.sh' - regexp: '^about-filter=' - insertbefore: 'scan-path=' - - line: 'enable-git-config=1' - regexp: '^enable-git-config=' - - line: 'remove-suffix=1' - regexp: '^remove-suffix=' - insertbefore: 'scan-path=' - - line: 'project-list=/srv/git/projects.list' - regexp: 'project-list=' - insertbefore: 'scan-path=' - - line: 'scan-path=/srv/git/repositories' - regexp: 'scan-path=' - - line: 'readme=:README.md' - - line: 'readme=:readme.md' - - line: 'readme=:README.mkd' - - line: 'readme=:readme.mkd' - - line: 'readme=:README.rst' - - line: 'readme=:readme.rst' - - line: 'readme=:README.html' - - line: 'readme=:readme.html' - - line: 'readme=:README.htm' - - line: 'readme=:readme.htm' - - line: 'readme=:README.txt' - - line: 'readme=:readme.txt' - - line: 'readme=:README' - - line: 'readme=:readme' - - line: 'readme=:INSTALL.md' - - line: 'readme=:install.md' - - line: 'readme=:INSTALL.mkd' - - line: 'readme=:install.mkd' - - line: 'readme=:INSTALL.rst' - - line: 'readme=:install.rst' - - line: 'readme=:INSTALL.html' - - line: 'readme=:install.html' - - line: 'readme=:INSTALL.htm' - - line: 'readme=:install.htm' - - line: 'readme=:INSTALL.txt' - - line: 'readme=:install.txt' - - line: 'readme=:INSTALL' - - line: 'readme=:install' + - line: 'css=/cgit/css/cgit.css' + regexp: '^css=' + - line: 'logo=/cgit/css/cgit.png' + regexp: '^logo=' + - line: 'favicon=/cgit/css/favicon.ico' + regexp: '^favicon=' + - line: 'about-filter=/usr/lib/cgit/filters/about-formatting.sh' + regexp: '^about-filter=' + insertbefore: 'scan-path=' + - line: 'enable-git-config=1' + regexp: '^enable-git-config=' + - line: 'remove-suffix=1' + regexp: '^remove-suffix=' + insertbefore: 'scan-path=' + - line: 'project-list=/srv/git/projects.list' + regexp: 'project-list=' + insertbefore: 'scan-path=' + - line: 'scan-path=/srv/git/repositories' + regexp: 'scan-path=' + - line: 'readme=:README.md' + - line: 'readme=:readme.md' + - line: 'readme=:README.mkd' + - line: 'readme=:readme.mkd' + - line: 'readme=:README.rst' + - line: 'readme=:readme.rst' + - line: 'readme=:README.html' + - line: 'readme=:readme.html' + - line: 'readme=:README.htm' + - line: 'readme=:readme.htm' + - line: 'readme=:README.txt' + - line: 'readme=:readme.txt' + - line: 'readme=:README' + - line: 'readme=:readme' + - line: 'readme=:INSTALL.md' + - line: 'readme=:install.md' + - line: 'readme=:INSTALL.mkd' + - line: 'readme=:install.mkd' + - line: 'readme=:INSTALL.rst' + - line: 'readme=:install.rst' + - line: 'readme=:INSTALL.html' + - line: 'readme=:install.html' + - line: 'readme=:INSTALL.htm' + - line: 'readme=:install.htm' + - line: 'readme=:INSTALL.txt' + - line: 'readme=:install.txt' + - line: 'readme=:INSTALL' + - line: 'readme=:install' diff --git a/tasks/main.yml b/tasks/main.yml index 28f4d52..6cbb35e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,13 +4,10 @@ assert: that: - ansible_os_family in ['Debian'] - - ansible_distribution_release in ['xenial', 'trusty', 'jessie'] + - ansible_distribution_release in ['xenial', 'jessie'] - gitolite_public_key is defined - name: APT install - with_items: - - gitolite3 - - curl apt: name: ['curl', 'gitolite3'] state: present -- GitLab