首页 > 其他 > 详细

gitlab安装

时间:2020-07-11 19:03:02      阅读:55      评论:0      收藏:0      [点我收藏+]
- name: disable selinux
  shell: setenforce 0
  ignore_errors: yes

- name: disable selinux conf
  lineinfile:
    path: /etc/selinux/config
    regexp: ^SELINUX=.*$
    line: SELINUX=disabled

- name: Install requirements package
  yum: name={{ item }} state=installed
  with_items:
    - policycoreutils-python
    - postfix
    - openssh-server
    - curl

- name: start and enable  postfix
  service:
    name: postfix
    state: started
    enabled: yes

- name: Add Gitlab package
  get_url:
    url: "{{ gitlab_download_url }}"
    dest: "{{ gitlab_package_url }}"

- name: install gitlab-ce
  yum: name={{ gitlab_package_url }}  state=present

- name: copy cinfigure  file
  shell: cd /etc/gitlab/  && cp gitlab.rb gitlab.rb.bak

 
- name: ensure gitlab-ce is installed
  shell: cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
  register: gitlab_installed
  ignore_errors: yes

- name: add conf file info
  blockinfile:
    path: /etc/gitlab/gitlab.rb
    block: |
      git_data_dirs({  "default" => { "path" => "/data/software/git-data" } })
      postgresql[data_dir] = "/data/software/postgresql/data"
      gitlab_rails[backup_path] = "/data/software/backups"

  
- name: edit host name
  lineinfile:
    path: /etc/gitlab/gitlab.rb
    regexp: ^external_url.*gitlab.example.com.*
    line: "external_url ‘http://{{ host }}‘"


- name: Initialize gitlab
  shell: gitlab-ctl reconfigure

  
- name: systemctl start gitlab-runsvdir.service and enable
  service:
    name: gitlab-runsvdir
    state: started
    enabled: yes

 

gitlab安装

原文:https://www.cnblogs.com/zhuhaofeng/p/13284809.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!