# install git # dependencies: pb_redmine_server-1.yml - hosts: redmine_servers become: true become_method: su environment: "{{ proxy_env }}" vars: redmine_path: /srv/redmine tasks: - name: check facts fail: msg: "Not compatible with [{{ ansible_os_family }}] {{ ansible_distribution }} {{ ansible_distribution_major_version }}." when: ansible_os_family != 'RedHat' or ansible_distribution_major_version|int != 7 - name: check redmine stat: path={{ redmine_path }} register: result01 - fail: msg: "pb_redmine_server.yml has been executed yet." when: result01.stat.exists == false - name: install RPMs yum: name: - httpd - git - mod_perl - perl-Digest-SHA - perl-DBI - perl-DBD-mysql - gitweb state: latest - name: modify apache user for git user: name=apache groups=users append=yes notify: - restart Apache - copy: dest: /etc/systemd/system/httpd.service force: no content: ".include /lib/systemd/system/httpd.service\n[Service]\nUMask=002\n" notify: - restart Apache - name: copy Redmine.pm file: path=/etc/httpd/Apache/Authn state=directory - shell: docker cp redmine:/usr/src/redmine/extra/svn/Redmine.pm /etc/httpd/Apache/Authn/Redmine.pm - name: create gitrepos.conf copy: src: gitrepos.conf dest: /etc/httpd/conf.d/gitrepos.conf force: no mode: 0640 - slurp: src: "{{ redmine_path }}/.env" register: result03 - lineinfile: dest: /etc/httpd/conf.d/gitrepos.conf regexp: "^ RedmineDbPass" line: " RedmineDbPass {{ result03['content'] | b64decode | regex_findall('REDMINE_DB_PASSWORD=(.+)\\n') | first }}" - name: modify gitweb lineinfile: dest: /etc/httpd/conf.d/git.conf regexp: '^Alias /git /var/www/git$' line: 'Alias /gitweb /var/www/git' handlers: - name: restart Apache systemd: name: httpd state: restarted daemon_reload: yes enabled: yes