PageRenderTime 45ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/attributes/default.rb

https://gitlab.com/conrado/cookbook-gitlab
Ruby | 209 lines | 162 code | 25 blank | 22 comment | 3 complexity | 028c9ba126f84e2e66c22305d6916310 MD5 | raw file
Possible License(s): CC-BY-3.0
  1. # Packages
  2. if platform_family?("rhel")
  3. packages = %w{
  4. libicu-devel libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel
  5. libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git mysql-devel gcc-c++
  6. ImageMagick-devel ImageMagick
  7. }
  8. else
  9. packages = %w{
  10. build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev
  11. curl openssh-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev python-docutils
  12. logrotate vim curl wget checkinstall
  13. }
  14. end
  15. default['gitlab']['packages'] = packages
  16. default['gitlab']['ruby'] = "2.0.0-p353"
  17. # GitLab shell
  18. default['gitlab']['shell_repository'] = "https://github.com/gitlabhq/gitlab-shell.git"
  19. default['gitlab']['shell_revision'] = "v1.8.0"
  20. # GitLab shell configuration
  21. default['gitlab']['repos_path'] = "/home/git/repositories"
  22. default['gitlab']['shell_path'] = "/home/git/gitlab-shell"
  23. default['gitlab']['redis_path'] = "/usr/local/bin/redis-cli"
  24. default['gitlab']['redis_host'] = "127.0.0.1"
  25. default['gitlab']['redis_port'] = "6379"
  26. default['gitlab']['namespace'] = "resque:gitlab"
  27. default['gitlab']['self_signed_cert'] = false
  28. # GitLab
  29. default['gitlab']['repository'] = "https://github.com/gitlabhq/gitlabhq.git"
  30. default['gitlab']['deploy_key'] = "" # Optional. Private key used to connect to private GitLab repository.
  31. # Setup environments
  32. if node['gitlab']['env'] == "development"
  33. default['gitlab']['environments'] = %w{development test}
  34. default['gitlab']['revision'] = "master"
  35. default['gitlab']['url'] = "http://localhost:3000/"
  36. default['gitlab']['port'] = "3000"
  37. default['gitlab']['ssh_port'] = "2222"
  38. else
  39. default['gitlab']['environments'] = %w{production}
  40. default['gitlab']['revision'] = "6-6-stable" # Must be branch, otherwise GitLab update will run on each chef run
  41. default['gitlab']['url'] = "http://localhost:80/"
  42. default['gitlab']['port'] = "80"
  43. default['gitlab']['ssh_port'] = "22"
  44. end
  45. # GitLab configuration
  46. default['gitlab']['git_path'] = "/usr/local/bin/git"
  47. default['gitlab']['host'] = "localhost"
  48. default['gitlab']['email_from'] = "gitlab@localhost"
  49. default['gitlab']['support_email'] = "support@localhost"
  50. default['gitlab']['signup_enabled'] = false
  51. default['gitlab']['projects_limit'] = 10
  52. default['gitlab']['oauth_enabled'] = false
  53. default['gitlab']['oauth_block_auto_created_users'] = true
  54. default['gitlab']['oauth_allow_single_sign_on'] = false
  55. default['gitlab']['oauth_providers'] = [] # Example: default['gitlab']['oauth_providers'] = [ { "name": "google_oauth2", "app_id": "YOUR APP ID", "app_secret": "YOUR APP SECRET", "args": "access_type: 'offline', approval_prompt: ''" }, { "name": "twitter", "app_id": "YOUR APP ID", "app_secret": "YOUR APP SECRET" }, { "name":"github", "app_id": "YOUR APP ID", "app_secret": "YOUR APP SECRET" }]
  56. default['gitlab']['extra']['google_analytics_id'] = "" # Example: "AA-1231231-1"
  57. default['gitlab']['extra']['sign_in_text'] = "" # Example: "![Company Logo](http://www.example.com/logo.png)"
  58. default['gitlab']['ldap']['enabled'] = false
  59. default['gitlab']['ldap']['host'] = "_your_ldap_server"
  60. default['gitlab']['ldap']['base'] = "_the_base_where_you_search_for_users"
  61. default['gitlab']['ldap']['port'] = 636
  62. default['gitlab']['ldap']['uid'] = "sAMAccountName"
  63. default['gitlab']['ldap']['method'] = "ssl"
  64. default['gitlab']['ldap']['bind_dn'] = "_the_full_dn_of_the_user_you_will_bind_with"
  65. default['gitlab']['ldap']['password'] = "_the_password_of_the_bind_user"
  66. default['gitlab']['ldap']['allow_username_or_email_login'] = true
  67. default['gitlab']['gravatar'] = true
  68. default['gitlab']['default_projects_features']['issues'] = true
  69. default['gitlab']['default_projects_features']['merge_requests'] = true
  70. default['gitlab']['default_projects_features']['wiki'] = true
  71. default['gitlab']['default_projects_features']['wall'] = false
  72. default['gitlab']['default_projects_features']['snippets'] = false
  73. default['gitlab']['default_projects_features']['visibility_level'] = "private"
  74. # Gems
  75. default['gitlab']['bundle_install'] = "SSL_CERT_FILE=/opt/local/etc/certs/cacert.pem bundle install --path=.bundle --deployment"
  76. # Databases
  77. # Assumed defaults
  78. # database: postgresql (option: mysql)
  79. # environment: production (option: development)
  80. default['gitlab']['external_database'] = false
  81. default['gitlab']['database_adapter'] = "postgresql"
  82. default['gitlab']['database_password'] = "datapass"
  83. default['gitlab']['database_user'] = "git"
  84. default['gitlab']['env'] = "production"
  85. # MySQL attributes
  86. default['mysql']['server_host'] = "localhost" # Host of the server that hosts the database.
  87. default['mysql']['client_host'] = "localhost" # Host where user connections are allowed from.
  88. default['mysql']['server_root_username'] = "root"
  89. default['mysql']['server_root_password'] = "rootpass"
  90. default['mysql']['server_repl_password'] = "replpass"
  91. default['mysql']['server_debian_password'] = "debianpass"
  92. # PostgreSQL attributes
  93. include_attribute 'postgresql'
  94. default['postgresql']['version'] = "9.3"
  95. case node["platform_family"]
  96. when "debian"
  97. default['postgresql']['enable_pgdg_apt'] = true
  98. default['postgresql']['client']['packages'] = %w{postgresql-client-9.3 libpq-dev}
  99. default['postgresql']['server']['packages'] = %w{postgresql-9.3}
  100. # due to the way attributes are organized we have to override the default paths too
  101. default['postgresql']['dir'] = "/etc/postgresql/#{node['postgresql']['version']}/main"
  102. default['postgresql']['config']['data_directory'] = "/var/lib/postgresql/#{node['postgresql']['version']}/main"
  103. default['postgresql']['config']['hba_file'] = "/etc/postgresql/#{node['postgresql']['version']}/main/pg_hba.conf"
  104. default['postgresql']['config']['ident_file'] = "/etc/postgresql/#{node['postgresql']['version']}/main/pg_ident.conf"
  105. default['postgresql']['config']['external_pid_file'] = "/var/run/postgresql/#{node['postgresql']['version']}-main.pid"
  106. default['postgresql']['config']['ssl'] = false
  107. default['postgresql']['config']['unix_socket_directory'] = nil
  108. default['postgresql']['config']['unix_socket_directories'] = '/var/run/postgresql'
  109. default['gitlab']['postgresql']['configuration_dir'] = nil
  110. when "rhel"
  111. default['postgresql']['enable_pgdg_yum'] = true
  112. default['postgresql']['client']['packages'] = ["postgresql#{node['postgresql']['version'].split('.').join}-devel"]
  113. default['postgresql']['server']['packages'] = ["postgresql#{node['postgresql']['version'].split('.').join}-server"]
  114. default['postgresql']['contrib']['packages'] = ["postgresql#{node['postgresql']['version'].split('.').join}-contrib"]
  115. default['postgresql']['dir'] = "/var/lib/pgsql/data"
  116. default['postgresql']['server']['service_name'] = "postgresql-#{node['postgresql']['version']}"
  117. default['gitlab']['postgresql']['configuration_dir'] = "/usr/pgsql-#{node['postgresql']['version']}/bin"
  118. end
  119. default['postgresql']['username']['postgres'] = "postgres"
  120. default['postgresql']['password']['postgres'] = "psqlpass"
  121. default['postgresql']['server_host'] = "localhost"
  122. # Postfix
  123. default['postfix']['mail_type'] = "client"
  124. default['postfix']['myhostname'] = "mail.localhost"
  125. default['postfix']['mydomain'] = "localhost"
  126. default['postfix']['myorigin'] = "mail.localhost"
  127. default['postfix']['smtp_use_tls'] = "no"
  128. # User
  129. default['gitlab']['user'] = "git" # Do not change this attribute in production since some code from the GitLab repo such as init.d script assume it is git.
  130. default['gitlab']['group'] = "git"
  131. default['gitlab']['user_uid'] = nil # Use to specify user id.
  132. default['gitlab']['user_gid'] = nil # Use to specify group id.
  133. default['gitlab']['home'] = "/home/git"
  134. # GitLab hq
  135. default['gitlab']['path'] = "/home/git/gitlab" # Do not change this attribute in production since some code from the GitLab repo such as init.d assume this path.
  136. default['gitlab']['satellites_path'] = "/home/git/gitlab-satellites"
  137. # Unicorn specific configuration
  138. default['gitlab']['unicorn_workers_number'] = 2
  139. default['gitlab']['unicorn_timeout'] = 30
  140. # Nginx ssl certificates
  141. default['gitlab']['ssl_certificate_path'] = "/etc/ssl" # Path to .crt file. If it directory doesn't exist it will be created
  142. default['gitlab']['ssl_certificate_key_path'] = "/etc/ssl" # Path to .key file. If directory doesn't exist it will be created
  143. default['gitlab']['ssl_certificate'] = "" # SSL certificate
  144. default['gitlab']['ssl_certificate_key'] = "" # SSL certificate key
  145. # SMTP email
  146. default['gitlab']['smtp'] = {
  147. :enabled => false,
  148. :address => "email.server.com",
  149. :port => 456,
  150. :username => "smtp",
  151. :password => "123456",
  152. :domain => "gitlab.example.com",
  153. :authentication => "login",
  154. :enable_starttls_auto => true
  155. }
  156. # AWS is disabled by default. If enabled is set to true, bundler will install gems from aws group and use the credentials to populate config/aws.yml
  157. default['gitlab']['aws'] = {
  158. :enabled => false,
  159. :provider => 'AWS', # required
  160. :aws_access_key_id => 'yyy', # required
  161. :aws_secret_access_key => 'xxx', # required
  162. :bucket => 'zzz', # optional
  163. :region => 'eu-west-1', # optional, defaults to 'us-east-1'
  164. :host => 's3.example.com', # optional, defaults to nil
  165. :endpoint => 'https://s3.example.com:8080' # optional, defaults to nil
  166. }
  167. # Monit specific configuration
  168. default['gitlab']['monitrc']['sidekiq'] = {
  169. :pid_path => "#{default['gitlab']['path']}/tmp/pids/sidekiq.pid",
  170. :start_timeout => "80", # in seconds
  171. :stop_timeout => "40", # in seconds
  172. :cpu_threshold => "40", # in %. Assuming our server has two cores, 40% totalcpu means pinning 80% of a single core
  173. :cpu_cycles_number => "10",
  174. :mem_threshold => "225", # in MB
  175. :mem_cycles_number => "10",
  176. :restart_number => "5", # Number of consecutive restarts before alerting.
  177. :restart_cycles_number => "5" # Number of cycles to monitor for consecutive restarts.
  178. }
  179. default['gitlab']['monitrc']['unicorn'] = {
  180. :pid_path => "#{default['gitlab']['path']}/tmp/pids/unicorn.pid",
  181. :mem_threshold => "1000.0", # in MB
  182. :mem_cycles_number => "25"
  183. }
  184. default['gitlab']['monitrc']['notify_email'] = "monitrc@localhost"