Initial commit

This commit is contained in:
sonny 2023-03-04 17:04:02 +01:00
parent 2ec50be98a
commit ae90907e4e
12 changed files with 68 additions and 2680 deletions

View file

@ -1,60 +1,39 @@
- name: copy gitlab firewall template
template:
src: 'templates/nftables.j2'
dest: '/etc/nftables.conf'
owner: root
group: root
mode: '0600'
notify: restart nftables
- name: create gitlab config dir
- name: create gitlab home directory
file:
path: /etc/gitlab
path: '{{ gitlab_home }}'
state: directory
owner: root
group: root
mode: '0644'
mode: '0755'
- name: copy gitlab config
- name: create gitlab app directory
become: true
file:
path: '{{ app_dir }}'
state: directory
mode: '0755'
owner: 'sonny'
group: 'sonny'
- name: copy docker-compose file
become: true
template:
src: 'templates/gitlab.j2'
dest: '/etc/gitlab/gitlab.rb'
owner: root
group: root
mode: '0600'
src: 'templates/docker-compose.j2'
dest: '{{ app_dir }}/docker-compose.yml'
owner: 'sonny'
group: 'sonny'
mode: '0755'
- name: copy postfix config
template:
src: 'templates/postfix.j2'
dest: '/etc/postfix/main.cf'
owner: root
group: root
mode: '0644'
notify: restart postfix
- name: stop gitlab
docker_compose:
project_src: '{{ app_dir }}'
state: absent
environment:
GITLAB_HOME: '{{ gitlab_home }}'
- name: check installed packages
package_facts:
manager: apt
- name: start gitlab
docker_compose:
pull: true
project_src: '{{ app_dir }}'
environment:
GITLAB_HOME: '{{ gitlab_home }}'
- name: download gitlab setup script
get_url:
url: '{{ gitlab_setup_script }}'
dest: /tmp/
mode: '0750'
when: "'gitlab-ee' not in ansible_facts.packages"
- name: run gitlab setup script
command: /tmp/script.deb.sh
when: "'gitlab-ee' not in ansible_facts.packages"
- name: install gitlab
apt:
name: 'gitlab-ee'
update_cache: true
state: latest
register: package_install
# Updates reconfigure automatically
- name: reconfigure gitlab
command: 'gitlab-ctl reconfigure'
when: not package_install.changed
# TODO: update router config (for SSH)