码迷,mamicode.com
首页 > 其他好文 > 详细

gitlab安装

时间:2020-07-11 19:40:00      阅读:79      评论:0      收藏:0      [点我收藏+]

标签:regexp   get   initial   shel   open   external   war   selinux   emc   

- 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安装

标签:regexp   get   initial   shel   open   external   war   selinux   emc   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!