diff --git a/roles/gitlab/tasks/main.yml b/roles/gitlab/tasks/main.yml index 667e1f6..63768fe 100644 --- a/roles/gitlab/tasks/main.yml +++ b/roles/gitlab/tasks/main.yml @@ -85,6 +85,16 @@ force: yes repo: "https://gitlab.com/gitlab-org/gitlab-foss.git" version: 12-10-stable + - name: Create public directory + file: + path: "/home/git/public" + mode: "0755" + state: directory + - name: Create uploads directory + file: + path: "/home/git/public/uploads" + mode: "0700" + state: directory - name: Copy secrets copy: src: "/home/git/gitlab/config/secrets.yml.example" @@ -97,6 +107,8 @@ loop: - { src: "gitlab.yml", dest: "/home/git/gitlab/config/gitlab.yml" } - { src: "pumba.rb", dest: "/home/git/gitlab/config/puma.rb" } + - { src: "rack_attack.rb", dest: "/home/git/gitlab/config/initializers/rack_attack.rb" } + - { src: "resque.yml", dest: "/home/git/gitlab/config/resque.yml" } - name: Change permissions file: path: "{{ item.src }}" @@ -110,16 +122,16 @@ - { src: "/home/git/gitlab/builds", mode: "u+rwX" } - { src: "/home/git/gitlab/shared/artifacts", mode: "u+rwX" } - { src: "/home/git/gitlab/shared/pages", mode: "u+rwX" } - - name: Create public directory - file: - path: "/home/git/public" - mode: "0755" - state: directory - - name: Create uploads directory - file: - path: "/home/git/public/uploads" - mode: "0700" - state: directory + - name: Configure git + git_config: + name: "{{ item.name }}" + value: "{{ item.value }}" + loop: + - { name: "core.autocrlf", value: "input" } + - { name: "gc.auto", value: "0" } + - { name: "repack.writeBitmaps", value: "true" } + - { name: "receive.advertisePushOptions", value: "true" } + - { name: "core.fsyncObjectFiles", value: "true" } become: yes become_user: git - name: Set up Apache diff --git a/roles/gitlab/templates/database.yml b/roles/gitlab/templates/database.yml new file mode 100644 index 0000000..ebfb7af --- /dev/null +++ b/roles/gitlab/templates/database.yml @@ -0,0 +1,10 @@ +production: + adapter: mysql2 + encoding: utf8 + collation: utf8_general_ci + reconnect: false + database: gitlab + pool: 10 + username: gitlab + password: {{ gitlab_mysql_password }} + host: localhost