Use simpler file structure

This commit is contained in:
Sonny Bakker 2021-01-31 10:46:42 +01:00
parent 3bca1176a4
commit 7f6381b33c
17 changed files with 152 additions and 122 deletions

60
tasks.yml Normal file
View file

@ -0,0 +1,60 @@
- 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
file:
path: /etc/gitlab
state: directory
owner: root
group: root
mode: '0644'
- name: copy gitlab config
template:
src: 'templates/gitlab.j2'
dest: '/etc/gitlab/gitlab.rb'
owner: root
group: root
mode: '0600'
- name: copy postfix config
template:
src: 'templates/postfix.j2'
dest: '/etc/postfix/main.cf'
owner: root
group: root
mode: '0644'
notify: restart postfix
- name: check installed packages
package_facts:
manager: apt
- 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