• gitlab安装


    - 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
  • 相关阅读:
    标准函数头部注释
    排序
    #define _INTSIZEOF(n)
    并发编程资料
    memory model
    Ubuntu搜狗输入法的使用
    gprof
    xml_editor
    创建本地Ubuntu镜像
    设计模式9:建造者模式
  • 原文地址:https://www.cnblogs.com/zhuhaofeng/p/13284809.html
Copyright © 2020-2023  润新知