├── git1.8 ├── hosts ├── site.yml ├── Rakefile ├── roles │ └── git │ │ ├── vars │ │ └── main.yml │ │ └── tasks │ │ └── main.yml ├── README.md └── spec │ ├── git │ └── git_spec.rb │ └── spec_helper.rb ├── gitlab ├── hosts ├── roles │ ├── apache │ │ ├── vars │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── passenger │ │ ├── vars │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── gitlab │ │ ├── templates │ │ │ ├── .gitconfig │ │ │ ├── database.yml.j2 │ │ │ ├── gitlab.conf │ │ │ ├── logrotate.j2 │ │ │ ├── rack_attack.rb.j2 │ │ │ ├── gitlab-shell-config.yml.j2 │ │ │ └── gitlab.yml.j2 │ │ ├── handlers │ │ │ └── main.yml │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── common │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── git │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── redis │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── mysql │ │ ├── tasks │ │ │ └── main.yml │ │ └── templates │ │ │ └── my.cnf.j2 │ └── ruby │ │ ├── vars │ │ └── main.yml │ │ └── tasks │ │ └── main.yml ├── Rakefile ├── site.yml ├── spec │ ├── gitlab-server │ │ ├── selinux_spec.rb │ │ ├── httpd_spec.rb │ │ ├── mysql_spec.rb │ │ ├── passenger_spec.rb │ │ ├── ruby_spec.rb │ │ └── gitlab_spec.rb │ └── spec_helper.rb └── README.md ├── jenkins ├── hosts ├── roles │ ├── apache │ │ ├── vars │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── jenkins │ │ ├── vars │ │ │ └── main.yml │ │ ├── templates │ │ │ └── jenkins.conf │ │ └── tasks │ │ │ └── main.yml │ └── common │ │ └── tasks │ │ └── main.yml ├── Rakefile ├── site.yml ├── spec │ ├── jenkins-server │ │ ├── selinux_spec.rb │ │ ├── httpd_spec.rb │ │ └── jenkins_spec.rb │ └── spec_helper.rb └── README.md ├── lokka ├── hosts ├── roles │ ├── apache │ │ ├── vars │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── passenger │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── mysql │ │ ├── handlers │ │ │ └── main.yml │ │ ├── tasks │ │ │ └── main.yml │ │ └── templates │ │ │ └── my.cnf.j2 │ ├── lokka │ │ ├── templates │ │ │ ├── config.ru │ │ │ ├── lokka.conf │ │ │ └── database.default.yml.j2 │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── common │ │ └── tasks │ │ │ └── main.yml │ └── ruby │ │ ├── vars │ │ └── main.yml │ │ └── tasks │ │ └── main.yml ├── Rakefile ├── site.yml ├── spec │ ├── lokka-server │ │ ├── selinux_spec.rb │ │ ├── httpd_spec.rb │ │ ├── mysql_spec.rb │ │ ├── passenger_spec.rb │ │ ├── lokka_spec.rb │ │ └── ruby_spec.rb │ └── spec_helper.rb └── README.md ├── mysql5.6 ├── hosts ├── site.yml ├── Rakefile ├── roles │ └── mysql │ │ ├── handlers │ │ └── main.yml │ │ ├── templates │ │ ├── my.cnf.j2 │ │ └── .my.cnf.j2 │ │ ├── vars │ │ └── main.yml │ │ └── tasks │ │ └── main.yml ├── README.md └── spec │ ├── spec_helper.rb │ └── mysql-server │ └── mysql_spec.rb ├── redmine ├── hosts ├── roles │ ├── apache │ │ ├── vars │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── passenger │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── mysql │ │ ├── handlers │ │ │ └── main.yml │ │ ├── tasks │ │ │ └── main.yml │ │ └── templates │ │ │ └── my.cnf.j2 │ ├── redmine │ │ ├── templates │ │ │ ├── database.yml.j2 │ │ │ └── redmine.conf │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── common │ │ └── tasks │ │ │ └── main.yml │ └── ruby │ │ ├── vars │ │ └── main.yml │ │ └── tasks │ │ └── main.yml ├── Rakefile ├── site.yml ├── spec │ ├── redmine-server │ │ ├── selinux_spec.rb │ │ ├── httpd_spec.rb │ │ ├── mysql_spec.rb │ │ ├── passenger_spec.rb │ │ ├── redmine_spec.rb │ │ └── ruby_spec.rb │ └── spec_helper.rb └── README.md ├── ruby2.0 ├── hosts ├── site.yml ├── Rakefile ├── README.md ├── roles │ └── ruby │ │ ├── vars │ │ └── main.yml │ │ └── tasks │ │ └── main.yml └── spec │ ├── spec_helper.rb │ └── app-server │ └── ruby_spec.rb ├── .gitignore ├── gitlab-unicorn ├── hosts ├── roles │ ├── nginx │ │ ├── vars │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── gitlab │ │ ├── handlers │ │ │ └── main.yml │ │ ├── templates │ │ │ ├── .gitconfig │ │ │ ├── database.yml.j2 │ │ │ ├── logrotate.j2 │ │ │ ├── rack_attack.rb.j2 │ │ │ ├── gitlab-shell-config.yml.j2 │ │ │ ├── nginx_gitlab.j2 │ │ │ ├── unicorn.rb.j2 │ │ │ └── gitlab.yml.j2 │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── common │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── git │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── redis │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── mysql │ │ ├── tasks │ │ │ └── main.yml │ │ └── templates │ │ │ └── my.cnf.j2 │ └── ruby │ │ ├── vars │ │ └── main.yml │ │ └── tasks │ │ └── main.yml ├── Rakefile ├── site.yml ├── spec │ ├── gitlab-server │ │ ├── selinux_spec.rb │ │ ├── httpd_spec.rb │ │ ├── mysql_spec.rb │ │ ├── ruby_spec.rb │ │ └── gitlab_spec.rb │ └── spec_helper.rb └── README.md ├── webistrano ├── hosts ├── roles │ ├── apache │ │ ├── vars │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── passenger │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── mysql │ │ ├── handlers │ │ │ └── main.yml │ │ ├── tasks │ │ │ └── main.yml │ │ └── templates │ │ │ └── my.cnf.j2 │ ├── webistrano │ │ ├── vars │ │ │ └── main.yml │ │ ├── templates │ │ │ ├── database.yml.j2 │ │ │ ├── webistrano.conf │ │ │ ├── webistrano_config.rb.j2 │ │ │ └── Gemfile.j2 │ │ └── tasks │ │ │ └── main.yml │ ├── common │ │ └── tasks │ │ │ └── main.yml │ └── ruby │ │ ├── vars │ │ └── main.yml │ │ └── tasks │ │ └── main.yml ├── Rakefile ├── site.yml ├── spec │ ├── webistrano-server │ │ ├── selinux_spec.rb │ │ ├── httpd_spec.rb │ │ ├── mysql_spec.rb │ │ ├── passenger_spec.rb │ │ ├── ruby_spec.rb │ │ └── webistrano_spec.rb │ └── spec_helper.rb └── README.md ├── redis-replication ├── group_vars │ └── all ├── roles │ ├── common │ │ ├── templates │ │ │ ├── sysconfig-redis.j2 │ │ │ └── limits-redis.conf.j2 │ │ ├── handlers │ │ │ └── main.yml │ │ ├── vars │ │ │ └── main.yml │ │ └── tasks │ │ │ └── main.yml │ ├── redis-master │ │ ├── vars │ │ │ └── main.yml │ │ ├── handlers │ │ │ └── main.yml │ │ ├── tasks │ │ │ └── main.yml │ │ └── templates │ │ │ └── redis.conf.j2 │ └── redis-slave │ │ ├── vars │ │ └── main.yml │ │ ├── handlers │ │ └── main.yml │ │ └── tasks │ │ └── main.yml ├── hosts ├── Rakefile ├── site.yml ├── README.md └── spec │ ├── redis-master │ └── redis_spec.rb │ ├── spec_helper.rb │ └── redis-slave │ └── redis_spec.rb ├── Gemfile ├── snippets ├── README.md ├── change_password.yml ├── add_user.yml ├── add_third_party_repositories_for_yum.yml └── virtualenv-mysql-python.yml ├── README.md └── LICENSE.txt /git1.8/hosts: -------------------------------------------------------------------------------- 1 | [git] 2 | 192.0.2.1 3 | -------------------------------------------------------------------------------- /gitlab/hosts: -------------------------------------------------------------------------------- 1 | [gitlab-server] 2 | 192.0.2.1 3 | -------------------------------------------------------------------------------- /jenkins/hosts: -------------------------------------------------------------------------------- 1 | [jenkins-server] 2 | 192.0.2.1 3 | -------------------------------------------------------------------------------- /lokka/hosts: -------------------------------------------------------------------------------- 1 | [lokka-server] 2 | 192.0.2.1 3 | -------------------------------------------------------------------------------- /mysql5.6/hosts: -------------------------------------------------------------------------------- 1 | [mysql-server] 2 | 192.0.2.1 3 | -------------------------------------------------------------------------------- /redmine/hosts: -------------------------------------------------------------------------------- 1 | [redmine-server] 2 | 192.0.2.1 3 | -------------------------------------------------------------------------------- /ruby2.0/hosts: -------------------------------------------------------------------------------- 1 | [app-server] 2 | 192.0.2.1 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .bundle 2 | vendor/bundle 3 | Gemfile.lock 4 | -------------------------------------------------------------------------------- /gitlab-unicorn/hosts: -------------------------------------------------------------------------------- 1 | [gitlab-server] 2 | 192.0.2.1 3 | -------------------------------------------------------------------------------- /webistrano/hosts: -------------------------------------------------------------------------------- 1 | [webistrano-server] 2 | 192.0.2.1 3 | -------------------------------------------------------------------------------- /gitlab/roles/apache/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | httpd_port: 80 3 | -------------------------------------------------------------------------------- /jenkins/roles/apache/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | httpd_port: 80 3 | -------------------------------------------------------------------------------- /lokka/roles/apache/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | httpd_port: 80 3 | -------------------------------------------------------------------------------- /redis-replication/group_vars/all: -------------------------------------------------------------------------------- 1 | --- 2 | redis_port: 6379 3 | -------------------------------------------------------------------------------- /redmine/roles/apache/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | httpd_port: 80 3 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/nginx/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | httpd_port: 80 3 | -------------------------------------------------------------------------------- /webistrano/roles/apache/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | httpd_port: 80 3 | -------------------------------------------------------------------------------- /gitlab/roles/passenger/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | passenger_ver: "4.0.10" 3 | -------------------------------------------------------------------------------- /lokka/roles/passenger/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | passenger_ver: "4.0.10" 3 | -------------------------------------------------------------------------------- /redmine/roles/passenger/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | passenger_ver: "4.0.10" 3 | -------------------------------------------------------------------------------- /webistrano/roles/passenger/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | passenger_ver: "4.0.10" 3 | -------------------------------------------------------------------------------- /redis-replication/roles/common/templates/sysconfig-redis.j2: -------------------------------------------------------------------------------- 1 | ulimit -n 10000 2 | -------------------------------------------------------------------------------- /redis-replication/roles/redis-master/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | redis_max_memory: 5G 3 | -------------------------------------------------------------------------------- /redis-replication/roles/redis-slave/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | redis_max_memory: 5G 3 | -------------------------------------------------------------------------------- /redis-replication/hosts: -------------------------------------------------------------------------------- 1 | [redis-master] 2 | 192.0.2.1 3 | [redis-slave] 4 | 192.0.2.2 5 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # A sample Gemfile 2 | source "https://rubygems.org" 3 | 4 | gem "serverspec" 5 | -------------------------------------------------------------------------------- /gitlab/roles/gitlab/templates/.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = GitLab 3 | email = gitlab@localhost 4 | -------------------------------------------------------------------------------- /lokka/roles/mysql/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart mysql 3 | service: name=mysqld state=restarted 4 | -------------------------------------------------------------------------------- /git1.8/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Git 1.8 3 | hosts: git 4 | user: root 5 | 6 | roles: 7 | - git 8 | -------------------------------------------------------------------------------- /gitlab/roles/gitlab/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart sidekiq 3 | service: name=sidekiq state=restarted 4 | -------------------------------------------------------------------------------- /gitlab/roles/passenger/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart httpd 3 | service: name=httpd state=restarted 4 | -------------------------------------------------------------------------------- /lokka/roles/lokka/templates/config.ru: -------------------------------------------------------------------------------- 1 | Encoding.default_external = 'UTF-8' 2 | require './init' 3 | run Lokka::App 4 | -------------------------------------------------------------------------------- /redis-replication/roles/common/templates/limits-redis.conf.j2: -------------------------------------------------------------------------------- 1 | redis soft nofile 10000 2 | redis hard nofile 10000 3 | -------------------------------------------------------------------------------- /redmine/roles/mysql/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart mysql 3 | service: name=mysqld state=restarted 4 | -------------------------------------------------------------------------------- /webistrano/roles/mysql/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart mysql 3 | service: name=mysqld state=restarted 4 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/gitlab/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart nginx 3 | service: name=nginx state=restarted 4 | -------------------------------------------------------------------------------- /gitlab/roles/apache/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart iptables 3 | service: name=iptables state=restarted 4 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/nginx/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart iptables 3 | service: name=iptables state=restarted 4 | -------------------------------------------------------------------------------- /gitlab/roles/common/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | paco: http://dl.fedoraproject.org/pub/epel/6/x86_64/paco-2.0.9-6.el6.x86_64.rpm 3 | -------------------------------------------------------------------------------- /ruby2.0/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Ruby 2.0 3 | hosts: app-server 4 | user: root 5 | 6 | roles: 7 | - ruby 8 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/common/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | paco: http://dl.fedoraproject.org/pub/epel/6/x86_64/paco-2.0.9-6.el6.x86_64.rpm 3 | -------------------------------------------------------------------------------- /mysql5.6/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install MySQL 5.6 3 | hosts: mysql-server 4 | user: root 5 | 6 | roles: 7 | - mysql 8 | -------------------------------------------------------------------------------- /redis-replication/roles/common/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart iptables 3 | service: name=iptables state=restarted 4 | -------------------------------------------------------------------------------- /redis-replication/roles/redis-master/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart redis 3 | service: name=redis state=restarted 4 | -------------------------------------------------------------------------------- /redis-replication/roles/redis-slave/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart redis 3 | service: name=redis state=restarted 4 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/gitlab/templates/.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = GitLab 3 | email = gitlab@localhost 4 | [core] 5 | autocrlf = input 6 | -------------------------------------------------------------------------------- /git1.8/Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'rspec/core/rake_task' 3 | 4 | RSpec::Core::RakeTask.new(:spec) do |t| 5 | t.pattern = 'spec/*/*_spec.rb' 6 | end 7 | -------------------------------------------------------------------------------- /gitlab/Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'rspec/core/rake_task' 3 | 4 | RSpec::Core::RakeTask.new(:spec) do |t| 5 | t.pattern = 'spec/*/*_spec.rb' 6 | end 7 | -------------------------------------------------------------------------------- /lokka/Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'rspec/core/rake_task' 3 | 4 | RSpec::Core::RakeTask.new(:spec) do |t| 5 | t.pattern = 'spec/*/*_spec.rb' 6 | end 7 | -------------------------------------------------------------------------------- /jenkins/Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'rspec/core/rake_task' 3 | 4 | RSpec::Core::RakeTask.new(:spec) do |t| 5 | t.pattern = 'spec/*/*_spec.rb' 6 | end 7 | -------------------------------------------------------------------------------- /mysql5.6/Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'rspec/core/rake_task' 3 | 4 | RSpec::Core::RakeTask.new(:spec) do |t| 5 | t.pattern = 'spec/*/*_spec.rb' 6 | end 7 | -------------------------------------------------------------------------------- /redmine/Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'rspec/core/rake_task' 3 | 4 | RSpec::Core::RakeTask.new(:spec) do |t| 5 | t.pattern = 'spec/*/*_spec.rb' 6 | end 7 | -------------------------------------------------------------------------------- /ruby2.0/Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'rspec/core/rake_task' 3 | 4 | RSpec::Core::RakeTask.new(:spec) do |t| 5 | t.pattern = 'spec/*/*_spec.rb' 6 | end 7 | -------------------------------------------------------------------------------- /webistrano/Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'rspec/core/rake_task' 3 | 4 | RSpec::Core::RakeTask.new(:spec) do |t| 5 | t.pattern = 'spec/*/*_spec.rb' 6 | end 7 | -------------------------------------------------------------------------------- /gitlab-unicorn/Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'rspec/core/rake_task' 3 | 4 | RSpec::Core::RakeTask.new(:spec) do |t| 5 | t.pattern = 'spec/*/*_spec.rb' 6 | end 7 | -------------------------------------------------------------------------------- /jenkins/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Jenkins 3 | hosts: jenkins-server 4 | user: root 5 | 6 | roles: 7 | - common 8 | - apache 9 | - jenkins 10 | -------------------------------------------------------------------------------- /lokka/roles/lokka/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | lokka_mysql_user: lokka 3 | lokka_mysql_password: lokka 4 | lokka_repo: git://github.com/lokka/lokka.git 5 | deploy_dir: /var/apps 6 | -------------------------------------------------------------------------------- /redis-replication/Rakefile: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | require 'rspec/core/rake_task' 3 | 4 | RSpec::Core::RakeTask.new(:spec) do |t| 5 | t.pattern = 'spec/*/*_spec.rb' 6 | end 7 | -------------------------------------------------------------------------------- /jenkins/roles/jenkins/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | jenkins_repo: http://pkg.jenkins-ci.org/redhat/jenkins.repo 3 | jenkins_repo_key: http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key 4 | -------------------------------------------------------------------------------- /jenkins/roles/apache/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart httpd 3 | service: name=httpd state=restarted 4 | 5 | - name: restart iptables 6 | service: name=iptables state=restarted 7 | -------------------------------------------------------------------------------- /lokka/roles/apache/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart httpd 3 | service: name=httpd state=restarted 4 | 5 | - name: restart iptables 6 | service: name=iptables state=restarted 7 | -------------------------------------------------------------------------------- /mysql5.6/roles/mysql/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart iptables 3 | service: name=iptables state=restarted 4 | 5 | - name: restart mysql 6 | service: name=mysql state=restarted 7 | -------------------------------------------------------------------------------- /redis-replication/roles/redis-master/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: copy /etc/redis.conf file 3 | template: src=redis.conf.j2 dest=/etc/redis.conf owner=root 4 | notify: restart redis 5 | -------------------------------------------------------------------------------- /redis-replication/roles/redis-slave/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: copy /etc/redis.conf file 3 | template: src=redis.conf.j2 dest=/etc/redis.conf owner=root 4 | notify: restart redis 5 | -------------------------------------------------------------------------------- /redmine/roles/apache/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart httpd 3 | service: name=httpd state=restarted 4 | 5 | - name: restart iptables 6 | service: name=iptables state=restarted 7 | -------------------------------------------------------------------------------- /gitlab/roles/git/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | git_ver: "1.8.5" 3 | git_archive: http://git-core.googlecode.com/files/git-{{ git_ver }}.tar.gz 4 | download_path: /usr/local/src 5 | install_prefix: /usr 6 | -------------------------------------------------------------------------------- /webistrano/roles/apache/handlers/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: restart httpd 3 | service: name=httpd state=restarted 4 | 5 | - name: restart iptables 6 | service: name=iptables state=restarted 7 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/git/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | git_ver: "1.8.4.4" 3 | git_archive: http://git-core.googlecode.com/files/git-{{ git_ver }}.tar.gz 4 | download_path: /usr/local/src 5 | install_prefix: /usr 6 | -------------------------------------------------------------------------------- /webistrano/roles/webistrano/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | webistrano_mysql_password: webistrano 3 | webistrano_repo: git://github.com/waka/webistrano.git 4 | webistrano_branch: "rails3" 5 | deploy_dir: /var/apps 6 | -------------------------------------------------------------------------------- /lokka/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Lokka 3 | hosts: lokka-server 4 | user: root 5 | 6 | roles: 7 | - common 8 | - ruby 9 | - mysql 10 | - apache 11 | - passenger 12 | - lokka 13 | -------------------------------------------------------------------------------- /redmine/roles/redmine/templates/database.yml.j2: -------------------------------------------------------------------------------- 1 | production: 2 | adapter: mysql2 3 | database: redmine 4 | host: localhost 5 | username: redmine 6 | password: {{ redmine_mysql_password }} 7 | encoding: utf8 8 | -------------------------------------------------------------------------------- /redmine/roles/redmine/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | redmine_ver: "2.3.2" 3 | redmine_archive: http://rubyforge.org/frs/download.php/77023/redmine-{{ redmine_ver }}.tar.gz 4 | redmine_mysql_password: redmine 5 | deploy_dir: /var/apps 6 | -------------------------------------------------------------------------------- /redmine/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Redmine 3 | hosts: redmine-server 4 | user: root 5 | 6 | roles: 7 | - common 8 | - ruby 9 | - mysql 10 | - apache 11 | - passenger 12 | - redmine 13 | -------------------------------------------------------------------------------- /webistrano/roles/webistrano/templates/database.yml.j2: -------------------------------------------------------------------------------- 1 | production: 2 | adapter: mysql2 3 | database: webistrano 4 | host: localhost 5 | username: webistrano 6 | password: {{ webistrano_mysql_password }} 7 | encoding: utf8 8 | -------------------------------------------------------------------------------- /webistrano/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install Webistrano 3 | hosts: webistrano-server 4 | user: root 5 | 6 | roles: 7 | - common 8 | - ruby 9 | - mysql 10 | - apache 11 | - passenger 12 | - webistrano 13 | -------------------------------------------------------------------------------- /gitlab-unicorn/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install GitLab 3 | hosts: gitlab-server 4 | user: root 5 | 6 | roles: 7 | - common 8 | - ruby 9 | - git 10 | - redis 11 | - mysql 12 | - nginx 13 | - gitlab 14 | -------------------------------------------------------------------------------- /gitlab/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Install GitLab 3 | hosts: gitlab-server 4 | user: root 5 | 6 | roles: 7 | - common 8 | - ruby 9 | - git 10 | - redis 11 | - mysql 12 | - apache 13 | - passenger 14 | - gitlab 15 | -------------------------------------------------------------------------------- /git1.8/roles/git/vars/main.yml: -------------------------------------------------------------------------------- 1 | git_ver: "1.8.3.4" 2 | git_archive: http://git-core.googlecode.com/files/git-{{ git_ver }}.tar.gz 3 | download_path: /usr/local/src 4 | install_prefix: /usr 5 | paco-rpm: http://dl.fedoraproject.org/pub/epel/6/x86_64/paco-2.0.9-6.el6.x86_64.rpm 6 | -------------------------------------------------------------------------------- /jenkins/roles/common/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install python-selinux 3 | yum: pkg=libselinux-python state=latest 4 | 5 | - name: selinux setenforce 0 6 | command: setenforce 0 7 | ignore_errors: True 8 | 9 | - name: disable selinux 10 | selinux: state=disabled 11 | 12 | -------------------------------------------------------------------------------- /lokka/roles/common/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install python-selinux 3 | yum: pkg=libselinux-python state=latest 4 | 5 | - name: selinux setenforce 0 6 | command: setenforce 0 7 | ignore_errors: True 8 | 9 | - name: disable selinux 10 | selinux: state=disabled 11 | 12 | -------------------------------------------------------------------------------- /redmine/roles/common/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install python-selinux 3 | yum: pkg=libselinux-python state=latest 4 | 5 | - name: selinux setenforce 0 6 | command: setenforce 0 7 | ignore_errors: True 8 | 9 | - name: disable selinux 10 | selinux: state=disabled 11 | 12 | -------------------------------------------------------------------------------- /snippets/README.md: -------------------------------------------------------------------------------- 1 | # Snippets 2 | 3 | 1 ファイルで動作する簡単な Playbook のサンプルです。 4 | 以下の環境で確認しています。 5 | 6 | * CentOS 6.4 x86_64 7 | * Ansible 1.2.2 8 | 9 | ## Usage 10 | 11 | clone 後、 hosts ファイル内に対象のホスト名または IP アドレスを記述して以下のように実行します。 12 | 13 | $ ansible-playbook site.yml -i hosts -k 14 | 15 | -------------------------------------------------------------------------------- /webistrano/roles/common/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install python-selinux 3 | yum: pkg=libselinux-python state=latest 4 | 5 | - name: selinux setenforce 0 6 | command: setenforce 0 7 | ignore_errors: True 8 | 9 | - name: disable selinux 10 | selinux: state=disabled 11 | 12 | -------------------------------------------------------------------------------- /mysql5.6/README.md: -------------------------------------------------------------------------------- 1 | # MySQL 5.6 2 | 3 | MySQL 5.6 の公式の RPM をインストールする Playbook です。 4 | 以下の環境で確認しています。 5 | 6 | * CentOS 6.4 x86_64 7 | * Ansible 1.2.2 8 | 9 | ## Usage 10 | 11 | clone 後、 hosts ファイル内に対象ホストのホスト名または IP アドレスを記述して以下のように実行します。 12 | 13 | $ ansible-playbook site.yml -i hosts -k 14 | 15 | -------------------------------------------------------------------------------- /gitlab/spec/gitlab-server/selinux_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe file('/etc/selinux/config') do 4 | it { should be_file } 5 | it { should contain "SELINUX=disabled" } 6 | end 7 | 8 | describe command('/usr/sbin/getenforce') do 9 | it { should return_stdout /Permissive|Disabled/} 10 | end 11 | -------------------------------------------------------------------------------- /jenkins/spec/jenkins-server/selinux_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe file('/etc/selinux/config') do 4 | it { should be_file } 5 | it { should contain "SELINUX=disabled" } 6 | end 7 | 8 | describe command('/usr/sbin/getenforce') do 9 | it { should return_stdout /Permissive|Disabled/} 10 | end 11 | -------------------------------------------------------------------------------- /lokka/spec/lokka-server/selinux_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe file('/etc/selinux/config') do 4 | it { should be_file } 5 | it { should contain "SELINUX=disabled" } 6 | end 7 | 8 | describe command('/usr/sbin/getenforce') do 9 | it { should return_stdout /Permissive|Disabled/} 10 | end 11 | -------------------------------------------------------------------------------- /redmine/spec/redmine-server/selinux_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe file('/etc/selinux/config') do 4 | it { should be_file } 5 | it { should contain "SELINUX=disabled" } 6 | end 7 | 8 | describe command('/usr/sbin/getenforce') do 9 | it { should return_stdout /Permissive|Disabled/} 10 | end 11 | -------------------------------------------------------------------------------- /gitlab-unicorn/spec/gitlab-server/selinux_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe file('/etc/selinux/config') do 4 | it { should be_file } 5 | it { should contain "SELINUX=disabled" } 6 | end 7 | 8 | describe command('/usr/sbin/getenforce') do 9 | it { should return_stdout /Permissive|Disabled/} 10 | end 11 | -------------------------------------------------------------------------------- /gitlab/roles/redis/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | gpg_keys: 3 | - http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6 4 | - http://rpms.famillecollet.com/RPM-GPG-KEY-remi 5 | repo_rpms: 6 | - http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm 7 | - http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 8 | -------------------------------------------------------------------------------- /webistrano/spec/webistrano-server/selinux_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe file('/etc/selinux/config') do 4 | it { should be_file } 5 | it { should contain "SELINUX=disabled" } 6 | end 7 | 8 | describe command('/usr/sbin/getenforce') do 9 | it { should return_stdout /Permissive|Disabled/} 10 | end 11 | -------------------------------------------------------------------------------- /gitlab/roles/gitlab/templates/database.yml.j2: -------------------------------------------------------------------------------- 1 | production: 2 | adapter: mysql2 3 | encoding: utf8 4 | reconnect: false 5 | database: gitlabhq_production 6 | pool: 10 7 | username: {{ gitlab_db_user }} 8 | password: {{ gitlab_db_password }} 9 | host: {{ gitlab_db_host }} 10 | # socket: /tmp/mysql.sock 11 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/redis/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | gpg_keys: 3 | - http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6 4 | - http://rpms.famillecollet.com/RPM-GPG-KEY-remi 5 | repo_rpms: 6 | - http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm 7 | - http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 8 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/gitlab/templates/database.yml.j2: -------------------------------------------------------------------------------- 1 | production: 2 | adapter: mysql2 3 | encoding: utf8 4 | reconnect: false 5 | database: gitlabhq_production 6 | pool: 10 7 | username: {{ gitlab_db_user }} 8 | password: {{ gitlab_db_password }} 9 | host: {{ gitlab_db_host }} 10 | # socket: /tmp/mysql.sock 11 | -------------------------------------------------------------------------------- /redis-replication/roles/common/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | gpg_keys: 3 | - http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6 4 | - http://rpms.famillecollet.com/RPM-GPG-KEY-remi 5 | repo_rpms: 6 | - http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm 7 | - http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 8 | -------------------------------------------------------------------------------- /git1.8/README.md: -------------------------------------------------------------------------------- 1 | # Git 1.8.x 2 | 3 | ソースコードから Git 1.8.x をビルドしてインストールする Playbook です。 4 | インストールは Paco 経由で行うので削除も簡単にできます。 5 | 6 | 以下の環境で確認しています。 7 | 8 | * CentOS 6.4 x86_64 9 | * Ansible 1.2.2 10 | 11 | ## Usage 12 | 13 | clone 後、 hosts ファイル内に対象のホスト名または IP アドレスを記述して以下のように実行します。 14 | 15 | $ ansible-playbook site.yml -i hosts -k 16 | 17 | -------------------------------------------------------------------------------- /gitlab/roles/common/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install python-selinux 3 | yum: pkg=libselinux-python state=latest 4 | 5 | - name: setenforce 0 6 | command: setenforce 0 7 | ignore_errors: True 8 | 9 | - name: disable selinux 10 | selinux: state=disabled 11 | 12 | - name: install paco 13 | action: yum name=${paco} state=installed 14 | -------------------------------------------------------------------------------- /gitlab/roles/mysql/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install mysql 3 | action: yum name=$item state=installed 4 | with_items: 5 | - mysql-devel 6 | - mysql-server 7 | 8 | - name: copy my.conf file 9 | template: src=my.cnf.j2 dest=/etc/my.cnf 10 | 11 | - name: start mysql 12 | action: service name=mysqld state=started enabled=yes 13 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/mysql/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install mysql 3 | action: yum name=$item state=installed 4 | with_items: 5 | - mysql-devel 6 | - mysql-server 7 | 8 | - name: copy my.conf file 9 | template: src=my.cnf.j2 dest=/etc/my.cnf 10 | 11 | - name: start mysql 12 | action: service name=mysqld state=started enabled=yes 13 | -------------------------------------------------------------------------------- /ruby2.0/README.md: -------------------------------------------------------------------------------- 1 | # Ruby 2.0.0 2 | 3 | ソースコードから Ruby 2.0.0 をビルドしてインストールする Playbook です。 4 | インストールは Paco 経由で行うので削除も簡単にできます。 5 | 6 | 以下の環境で確認しています。 7 | 8 | * CentOS 6.4 x86_64 9 | * Ansible 1.2.2 10 | 11 | ## Usage 12 | 13 | clone 後、 hosts ファイル内に対象ホストのホスト名または IP アドレスを記述して以下のように実行します。 14 | 15 | $ ansible-playbook site.yml -i hosts -k 16 | 17 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/common/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install python-selinux 3 | yum: pkg=libselinux-python state=latest 4 | 5 | - name: setenforce 0 6 | command: setenforce 0 7 | ignore_errors: True 8 | 9 | - name: disable selinux 10 | selinux: state=disabled 11 | 12 | - name: install paco 13 | action: yum name=${paco} state=installed 14 | -------------------------------------------------------------------------------- /redis-replication/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install redis 3 | hosts: all 4 | user: root 5 | roles: 6 | - common 7 | 8 | - name: configure redis-master 9 | hosts: redis-master 10 | user: root 11 | roles: 12 | - redis-master 13 | 14 | - name: configure redis-slave 15 | hosts: redis-slave 16 | user: root 17 | roles: 18 | - redis-slave 19 | -------------------------------------------------------------------------------- /lokka/roles/mysql/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install mysql 3 | action: yum name=$item state=installed 4 | with_items: 5 | - mysql-devel 6 | - mysql-server 7 | - MySQL-python 8 | 9 | - name: copy my.conf file 10 | template: src=my.cnf.j2 dest=/etc/my.cnf 11 | 12 | - name: start mysql 13 | action: service name=mysqld state=started enabled=yes 14 | -------------------------------------------------------------------------------- /jenkins/README.md: -------------------------------------------------------------------------------- 1 | # Jenkins 2 | 3 | Jenkins をインストールするための Playbook です。 4 | 動作環境としては以下をインストールします。 5 | 6 | * Apache 7 | * java-1.7.0-openjdk 8 | 9 | 以下の環境で確認しています。 10 | 11 | * CentOS 6.4 x86_64 12 | * Ansible 1.2.2 13 | 14 | ## Usage 15 | 16 | clone 後、 hosts ファイル内に対象ホストのホスト名または IP アドレスを記述して以下のように実行します。 17 | 18 | $ ansible-playbook site.yml -i hosts -k 19 | 20 | -------------------------------------------------------------------------------- /mysql5.6/roles/mysql/templates/my.cnf.j2: -------------------------------------------------------------------------------- 1 | [mysql] 2 | default-character-set=utf8 3 | 4 | [mysqld] 5 | character-set-server=utf8 6 | collation-server=utf8_bin 7 | lower_case_table_names=1 8 | 9 | sql_mode="STRICT_ALL_TABLES,NO_ZERO_DATE,NO_ZERO_IN_DATE" 10 | 11 | [mysqld_safe] 12 | character-set-server=utf8 13 | collation-server=utf8_bin 14 | lower_case_table_names=1 15 | -------------------------------------------------------------------------------- /redmine/roles/mysql/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install mysql 3 | action: yum name=$item state=installed 4 | with_items: 5 | - mysql-devel 6 | - mysql-server 7 | - MySQL-python 8 | 9 | - name: copy my.conf file 10 | template: src=my.cnf.j2 dest=/etc/my.cnf 11 | 12 | - name: start mysql 13 | action: service name=mysqld state=started enabled=yes 14 | -------------------------------------------------------------------------------- /webistrano/roles/mysql/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install mysql 3 | action: yum name=$item state=installed 4 | with_items: 5 | - mysql-devel 6 | - mysql-server 7 | - MySQL-python 8 | 9 | - name: copy my.conf file 10 | template: src=my.cnf.j2 dest=/etc/my.cnf 11 | 12 | - name: start mysql 13 | action: service name=mysqld state=started enabled=yes 14 | -------------------------------------------------------------------------------- /redis-replication/README.md: -------------------------------------------------------------------------------- 1 | # Redis Replication 2 | 3 | Redis のレプリケーション環境を構築するための Playbook です。 4 | 以下がインストールされます。 5 | 6 | * Redis 2.6(Remi リポジトリ) 7 | 8 | 以下の環境で確認しています。 9 | 10 | * CentOS 6.4 x86_64 11 | * Ansible 1.2.2 12 | 13 | ## Usage 14 | 15 | clone 後、 hosts ファイル内に対象ホストのホスト名または IP アドレスを記述して以下のように実行します。 16 | 17 | $ ansible-playbook site.yml -i hosts -k 18 | 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ansible Playbooks 2 | 3 | My ansible playbooks. 4 | 5 | * Expects CentOS 6.4 x86_64 hosts 6 | * Requires Ansible 1.2.2 or newer 7 | 8 | 自作の Ansible の Playbook 置き場です。 9 | 以下の環境で確認しています。 10 | 11 | * CentOS 6.4 x86_64 12 | * Ansible 1.2.2 13 | 14 | ## Install 15 | 16 | git clone git://github.com/akishin/ansible-playbooks.git 17 | 18 | ## License 19 | 20 | MIT License 21 | -------------------------------------------------------------------------------- /redmine/README.md: -------------------------------------------------------------------------------- 1 | # Redmine 2 | 3 | Redmine をインストールするための Playbook です。 4 | 動作環境としては以下をインストールします。 5 | 6 | * Ruby 2.0 7 | * MySQL 8 | * Apache 9 | * Passenger 10 | 11 | 以下の環境で確認しています。 12 | 13 | * CentOS 6.4 x86_64 14 | * Ansible 1.2.2 15 | 16 | ## Usage 17 | 18 | clone 後、 hosts ファイル内に対象ホストのホスト名または IP アドレスを記述して以下のように実行します。 19 | 20 | $ ansible-playbook site.yml -i hosts -k 21 | 22 | -------------------------------------------------------------------------------- /gitlab/README.md: -------------------------------------------------------------------------------- 1 | # GitLab 2 | 3 | GitLab 6.0.0 をインストールするための Playbook です。 4 | 動作環境として以下がインストールされます。 5 | 6 | * Ruby 2.0 7 | * Git 1.8 8 | * Redis 2.6 9 | * MySQL 10 | * Apache 11 | * Passenger 12 | 13 | 以下の環境で確認しています。 14 | 15 | * CentOS 6.4 x86_64 16 | * Ansible 1.2.2 17 | 18 | ## Usage 19 | 20 | clone 後、 hosts ファイル内に対象ホストのホスト名または IP アドレスを記述して以下のように実行します。 21 | 22 | $ ansible-playbook site.yml -i hosts -k 23 | 24 | -------------------------------------------------------------------------------- /gitlab/roles/ruby/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | libyaml: http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/libyaml-0.1.3-1.el6.x86_64.rpm 3 | libyaml_devel: http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/libyaml-devel-0.1.3-1.el6.x86_64.rpm 4 | ruby_ver: "2.0.0-p353" 5 | ruby_archive: ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-{{ ruby_ver }}.tar.gz 6 | download_path: /usr/local/src 7 | install_prefix: /usr 8 | configure_options: --enable-shared 9 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/ruby/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | libyaml: http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/libyaml-0.1.3-1.el6.x86_64.rpm 3 | libyaml_devel: http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/libyaml-devel-0.1.3-1.el6.x86_64.rpm 4 | ruby_ver: "2.0.0-p353" 5 | ruby_archive: ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-{{ ruby_ver }}.tar.gz 6 | download_path: /usr/local/src 7 | install_prefix: /usr 8 | configure_options: --enable-shared 9 | -------------------------------------------------------------------------------- /mysql5.6/roles/mysql/templates/.my.cnf.j2: -------------------------------------------------------------------------------- 1 | [client] 2 | default-character-set = utf8 3 | user = root 4 | password = {{ mysql_root_password }} 5 | 6 | [mysqld] 7 | character-set-server=utf8 8 | collation-server=utf8_bin 9 | lower_case_table_names=1 10 | 11 | sql_mode="STRICT_ALL_TABLES,NO_ZERO_DATE,NO_ZERO_IN_DATE" 12 | 13 | [mysqld_safe] 14 | character-set-server=utf8 15 | collation-server=utf8_bin 16 | lower_case_table_names=1 17 | -------------------------------------------------------------------------------- /gitlab/roles/gitlab/templates/gitlab.conf: -------------------------------------------------------------------------------- 1 | 2 | ServerName gitlab 3 | ServerAdmin gitlab@example.com 4 | DocumentRoot /home/git/gitlab/public 5 | ErrorLog logs/gitlab-error_log 6 | CustomLog logs/gitlab-access_log common 7 | 8 | 9 | AllowOverride all 10 | Options -MultiViews 11 | Allow from all 12 | 13 | 14 | -------------------------------------------------------------------------------- /gitlab-unicorn/README.md: -------------------------------------------------------------------------------- 1 | # GitLab 2 | 3 | GitLab 6.3.0 を Nginx + Unicorn で動作するようにインストールするための Playbook です。 4 | 動作環境として以下がインストールされます。 5 | 6 | * Ruby 2.0 7 | * Git 1.8 8 | * Redis 2.6 9 | * MySQL 10 | * Nginx 11 | 12 | 以下の環境で確認しています。 13 | 14 | * CentOS 6.4 x86_64 15 | * Ansible 1.2.2 16 | 17 | ## Usage 18 | 19 | clone 後、 hosts ファイル内に対象ホストのホスト名または IP アドレスを記述して以下のように実行します。 20 | 21 | $ ansible-playbook site.yml -i hosts -k 22 | 23 | -------------------------------------------------------------------------------- /lokka/roles/lokka/templates/lokka.conf: -------------------------------------------------------------------------------- 1 | 2 | ServerName lokka 3 | ServerAdmin lokka@example.com 4 | DocumentRoot /var/apps/lokka/public 5 | ErrorLog logs/lokka-error_log 6 | CustomLog logs/lokka-access_log common 7 | 8 | 9 | AllowOverride all 10 | Options -MultiViews 11 | Allow from all 12 | 13 | 14 | -------------------------------------------------------------------------------- /gitlab/roles/mysql/templates/my.cnf.j2: -------------------------------------------------------------------------------- 1 | [mysql] 2 | default-character-set = utf8 3 | [mysqld] 4 | default-character-set = utf8 5 | lower_case_table_names = 1 6 | 7 | datadir=/var/lib/mysql 8 | socket=/var/lib/mysql/mysql.sock 9 | user=mysql 10 | # Disabling symbolic-links is recommended to prevent assorted security risks 11 | symbolic-links=0 12 | 13 | [mysqld_safe] 14 | log-error=/var/log/mysqld.log 15 | pid-file=/var/run/mysqld/mysqld.pid 16 | -------------------------------------------------------------------------------- /gitlab/spec/gitlab-server/httpd_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('httpd') do 4 | it { should be_installed } 5 | end 6 | 7 | describe service('httpd') do 8 | it { should be_enabled } 9 | it { should be_running } 10 | end 11 | 12 | describe port(80) do 13 | it { should be_listening } 14 | end 15 | 16 | describe iptables do 17 | it { should have_rule('-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT') } 18 | end 19 | -------------------------------------------------------------------------------- /jenkins/spec/jenkins-server/httpd_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('httpd') do 4 | it { should be_installed } 5 | end 6 | 7 | describe service('httpd') do 8 | it { should be_enabled } 9 | it { should be_running } 10 | end 11 | 12 | describe port(80) do 13 | it { should be_listening } 14 | end 15 | 16 | describe iptables do 17 | it { should have_rule('-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT') } 18 | end 19 | -------------------------------------------------------------------------------- /lokka/spec/lokka-server/httpd_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('httpd') do 4 | it { should be_installed } 5 | end 6 | 7 | describe service('httpd') do 8 | it { should be_enabled } 9 | it { should be_running } 10 | end 11 | 12 | describe port(80) do 13 | it { should be_listening } 14 | end 15 | 16 | describe iptables do 17 | it { should have_rule('-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT') } 18 | end 19 | -------------------------------------------------------------------------------- /redmine/roles/redmine/templates/redmine.conf: -------------------------------------------------------------------------------- 1 | 2 | ServerName redmine 3 | ServerAdmin redmine@example.com 4 | DocumentRoot /var/apps/redmine/public 5 | ErrorLog logs/redmine-error_log 6 | CustomLog logs/redmine-access_log common 7 | 8 | 9 | AllowOverride all 10 | Options -MultiViews 11 | Allow from all 12 | 13 | 14 | -------------------------------------------------------------------------------- /redmine/spec/redmine-server/httpd_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('httpd') do 4 | it { should be_installed } 5 | end 6 | 7 | describe service('httpd') do 8 | it { should be_enabled } 9 | it { should be_running } 10 | end 11 | 12 | describe port(80) do 13 | it { should be_listening } 14 | end 15 | 16 | describe iptables do 17 | it { should have_rule('-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT') } 18 | end 19 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/mysql/templates/my.cnf.j2: -------------------------------------------------------------------------------- 1 | [mysql] 2 | default-character-set = utf8 3 | [mysqld] 4 | default-character-set = utf8 5 | lower_case_table_names = 1 6 | 7 | datadir=/var/lib/mysql 8 | socket=/var/lib/mysql/mysql.sock 9 | user=mysql 10 | # Disabling symbolic-links is recommended to prevent assorted security risks 11 | symbolic-links=0 12 | 13 | [mysqld_safe] 14 | log-error=/var/log/mysqld.log 15 | pid-file=/var/run/mysqld/mysqld.pid 16 | -------------------------------------------------------------------------------- /redmine/roles/mysql/templates/my.cnf.j2: -------------------------------------------------------------------------------- 1 | [mysql] 2 | default-character-set = utf8 3 | [mysqld] 4 | default-character-set = utf8 5 | lower_case_table_names = 1 6 | 7 | datadir=/var/lib/mysql 8 | socket=/var/lib/mysql/mysql.sock 9 | user=mysql 10 | # Disabling symbolic-links is recommended to prevent assorted security risks 11 | symbolic-links=0 12 | 13 | [mysqld_safe] 14 | log-error=/var/log/mysqld.log 15 | pid-file=/var/run/mysqld/mysqld.pid 16 | 17 | -------------------------------------------------------------------------------- /gitlab-unicorn/spec/gitlab-server/httpd_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('nginx') do 4 | it { should be_installed } 5 | end 6 | 7 | describe service('nginx') do 8 | it { should be_enabled } 9 | it { should be_running } 10 | end 11 | 12 | describe port(80) do 13 | it { should be_listening } 14 | end 15 | 16 | describe iptables do 17 | it { should have_rule('-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT') } 18 | end 19 | -------------------------------------------------------------------------------- /webistrano/roles/mysql/templates/my.cnf.j2: -------------------------------------------------------------------------------- 1 | [mysql] 2 | default-character-set = utf8 3 | [mysqld] 4 | default-character-set = utf8 5 | lower_case_table_names = 1 6 | 7 | datadir=/var/lib/mysql 8 | socket=/var/lib/mysql/mysql.sock 9 | user=mysql 10 | # Disabling symbolic-links is recommended to prevent assorted security risks 11 | symbolic-links=0 12 | 13 | [mysqld_safe] 14 | log-error=/var/log/mysqld.log 15 | pid-file=/var/run/mysqld/mysqld.pid 16 | 17 | -------------------------------------------------------------------------------- /webistrano/spec/webistrano-server/httpd_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('httpd') do 4 | it { should be_installed } 5 | end 6 | 7 | describe service('httpd') do 8 | it { should be_enabled } 9 | it { should be_running } 10 | end 11 | 12 | describe port(80) do 13 | it { should be_listening } 14 | end 15 | 16 | describe iptables do 17 | it { should have_rule('-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT') } 18 | end 19 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/nginx/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install nginx 3 | action: yum name=nginx state=installed 4 | 5 | - name: start nginx 6 | action: service name=nginx state=started enabled=yes 7 | 8 | - name: insert iptables rule 9 | lineinfile: dest=/etc/sysconfig/iptables state=present regexp="{{ httpd_port }}" 10 | insertafter="^:OUTPUT " line="-A INPUT -p tcp --dport {{ httpd_port }} -j ACCEPT" 11 | notify: restart iptables 12 | -------------------------------------------------------------------------------- /lokka/README.md: -------------------------------------------------------------------------------- 1 | # Lokka 2 | 3 | Lokka をインストールするための Playbook です。 4 | 動作環境として以下をインストールします。 5 | 6 | * Ruby 2.0 7 | * MySQL 8 | * Apache 9 | * Passenger 10 | 11 | 以下の環境で確認しています。 12 | 13 | * CentOS 6.4 x86_64 14 | * Ansible 1.2.2 15 | 16 | ## Usage 17 | 18 | clone 後、 hosts ファイル内に対象ホストのホスト名または IP アドレスを記述して以下のように実行します。 19 | 20 | $ ansible-playbook site.yml -i hosts -k 21 | 22 | ## TODO 23 | 24 | db:setup が たまにエラーになる時がある。 25 | 再実行すると動いたり、再度エラーになったりしてて原因不明。 26 | 27 | -------------------------------------------------------------------------------- /lokka/roles/mysql/templates/my.cnf.j2: -------------------------------------------------------------------------------- 1 | [mysql] 2 | default-character-set = utf8 3 | [mysqld] 4 | default-character-set = utf8 5 | lower_case_table_names = 1 6 | max_allowed_packet=16M 7 | 8 | datadir=/var/lib/mysql 9 | socket=/var/lib/mysql/mysql.sock 10 | user=mysql 11 | # Disabling symbolic-links is recommended to prevent assorted security risks 12 | symbolic-links=0 13 | 14 | [mysqld_safe] 15 | log-error=/var/log/mysqld.log 16 | pid-file=/var/run/mysqld/mysqld.pid 17 | 18 | -------------------------------------------------------------------------------- /webistrano/roles/webistrano/templates/webistrano.conf: -------------------------------------------------------------------------------- 1 | 2 | ServerName webistrano 3 | ServerAdmin webistrano@example.com 4 | DocumentRoot /var/apps/webistrano/public 5 | ErrorLog logs/webistrano-error_log 6 | CustomLog logs/webistrano-access_log common 7 | 8 | 9 | AllowOverride all 10 | Options -MultiViews 11 | Allow from all 12 | 13 | 14 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/gitlab/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | gitlab_shell_ver: "1.7.9" 3 | gitlab_shell_repo: https://github.com/gitlabhq/gitlab-shell.git 4 | gitlab_ver: "6-3-stable" 5 | gitlab_repo: https://github.com/gitlabhq/gitlabhq.git 6 | gitlab_user: git 7 | gitlab_host: ${inventory_hostname} 8 | gitlab_init_script: https://raw.github.com/gitlabhq/gitlab-recipes/master/init/sysvinit/centos/gitlab-unicorn 9 | gitlab_db_user: gitlab 10 | gitlab_db_password: gitlab 11 | gitlab_db_host: 127.0.0.1 12 | -------------------------------------------------------------------------------- /gitlab/roles/apache/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install httpd 3 | action: yum name=$item state=installed 4 | with_items: 5 | - httpd 6 | 7 | - name: start httpd 8 | action: service name=httpd state=started enabled=yes 9 | 10 | - name: insert iptables rule 11 | lineinfile: dest=/etc/sysconfig/iptables state=present regexp="{{ httpd_port }}" 12 | insertafter="^:OUTPUT " line="-A INPUT -p tcp --dport {{ httpd_port }} -j ACCEPT" 13 | notify: restart iptables 14 | -------------------------------------------------------------------------------- /gitlab/roles/gitlab/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | gitlab_shell_ver: "1.7.9" 3 | gitlab_shell_repo: https://github.com/gitlabhq/gitlab-shell.git 4 | gitlab_ver: "6-3-stable" 5 | gitlab_repo: https://github.com/gitlabhq/gitlabhq.git 6 | gitlab_user: git 7 | gitlab_host: ${inventory_hostname} 8 | sidekiq_init_script: https://gist.github.com/akishin/6104332/raw/6a36ea237aa676b1e01764198bdff2e0af1e5474/sidekiq 9 | gitlab_db_user: gitlab 10 | gitlab_db_password: gitlab 11 | gitlab_db_host: 127.0.0.1 12 | -------------------------------------------------------------------------------- /jenkins/roles/apache/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install httpd 3 | action: yum name=$item state=installed 4 | with_items: 5 | - httpd 6 | 7 | - name: start httpd 8 | action: service name=httpd state=started enabled=yes 9 | 10 | - name: insert iptables rule 11 | lineinfile: dest=/etc/sysconfig/iptables state=present regexp="{{ httpd_port }}" 12 | insertafter="^:OUTPUT " line="-A INPUT -p tcp --dport {{ httpd_port }} -j ACCEPT" 13 | notify: restart iptables 14 | -------------------------------------------------------------------------------- /lokka/roles/apache/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install httpd 3 | action: yum name=$item state=installed 4 | with_items: 5 | - httpd 6 | 7 | - name: start httpd 8 | action: service name=httpd state=started enabled=yes 9 | 10 | - name: insert iptables rule 11 | lineinfile: dest=/etc/sysconfig/iptables state=present regexp="{{ httpd_port }}" 12 | insertafter="^:OUTPUT " line="-A INPUT -p tcp --dport {{ httpd_port }} -j ACCEPT" 13 | notify: restart iptables 14 | -------------------------------------------------------------------------------- /redmine/roles/apache/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install httpd 3 | action: yum name=$item state=installed 4 | with_items: 5 | - httpd 6 | 7 | - name: start httpd 8 | action: service name=httpd state=started enabled=yes 9 | 10 | - name: insert iptables rule 11 | lineinfile: dest=/etc/sysconfig/iptables state=present regexp="{{ httpd_port }}" 12 | insertafter="^:OUTPUT " line="-A INPUT -p tcp --dport {{ httpd_port }} -j ACCEPT" 13 | notify: restart iptables 14 | -------------------------------------------------------------------------------- /gitlab/roles/gitlab/templates/logrotate.j2: -------------------------------------------------------------------------------- 1 | # GitLab logrotate settings 2 | # based on: http://stackoverflow.com/a/4883967 3 | 4 | /home/git/gitlab/log/*.log { 5 | weekly 6 | missingok 7 | rotate 52 8 | compress 9 | delaycompress 10 | notifempty 11 | copytruncate 12 | } 13 | 14 | /home/git/gitlab-shell/gitlab-shell.log { 15 | weekly 16 | missingok 17 | rotate 52 18 | compress 19 | delaycompress 20 | notifempty 21 | copytruncate 22 | } 23 | -------------------------------------------------------------------------------- /webistrano/roles/apache/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install httpd 3 | action: yum name=$item state=installed 4 | with_items: 5 | - httpd 6 | 7 | - name: start httpd 8 | action: service name=httpd state=started enabled=yes 9 | 10 | - name: insert iptables rule 11 | lineinfile: dest=/etc/sysconfig/iptables state=present regexp="{{ httpd_port }}" 12 | insertafter="^:OUTPUT " line="-A INPUT -p tcp --dport {{ httpd_port }} -j ACCEPT" 13 | notify: restart iptables 14 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/gitlab/templates/logrotate.j2: -------------------------------------------------------------------------------- 1 | # GitLab logrotate settings 2 | # based on: http://stackoverflow.com/a/4883967 3 | 4 | /home/git/gitlab/log/*.log { 5 | weekly 6 | missingok 7 | rotate 52 8 | compress 9 | delaycompress 10 | notifempty 11 | copytruncate 12 | } 13 | 14 | /home/git/gitlab-shell/gitlab-shell.log { 15 | weekly 16 | missingok 17 | rotate 52 18 | compress 19 | delaycompress 20 | notifempty 21 | copytruncate 22 | } 23 | -------------------------------------------------------------------------------- /mysql5.6/roles/mysql/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | mysql_url: http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.6 3 | mysql_ver: "5.6.12-2" 4 | mysql_rpms: 5 | - MySQL-client-{{ mysql_ver }}.el6.x86_64.rpm 6 | - MySQL-shared-compat-{{ mysql_ver }}.el6.x86_64.rpm 7 | - MySQL-shared-{{ mysql_ver }}.el6.x86_64.rpm 8 | - MySQL-devel-{{ mysql_ver }}.el6.x86_64.rpm 9 | - MySQL-server-{{ mysql_ver }}.el6.x86_64.rpm 10 | rpm_download_dir: /usr/local/src 11 | mysql_port: 3306 12 | mysql_root_password: root 13 | -------------------------------------------------------------------------------- /ruby2.0/roles/ruby/vars/main.yml: -------------------------------------------------------------------------------- 1 | ruby_ver: "2.0.0-p353" 2 | ruby_archive: ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-{{ ruby_ver }}.tar.gz 3 | download_path: /usr/local/src 4 | install_prefix: /usr 5 | configure_options: --enable-shared 6 | libyaml-rpm: http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/libyaml-0.1.3-1.el6.x86_64.rpm 7 | libyaml-devel-rpm: http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/libyaml-devel-0.1.3-1.el6.x86_64.rpm 8 | paco-rpm: http://dl.fedoraproject.org/pub/epel/6/x86_64/paco-2.0.9-6.el6.x86_64.rpm 9 | -------------------------------------------------------------------------------- /lokka/roles/ruby/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ruby_ver: "2.0.0-p247" 3 | ruby_archive: ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-{{ ruby_ver }}.tar.gz 4 | download_path: /usr/local/src 5 | install_prefix: /usr 6 | configure_options: --enable-shared 7 | libyaml-rpm: http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/libyaml-0.1.3-1.el6.x86_64.rpm 8 | libyaml-devel-rpm: http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/libyaml-devel-0.1.3-1.el6.x86_64.rpm 9 | paco-rpm: http://dl.fedoraproject.org/pub/epel/6/x86_64/paco-2.0.9-6.el6.x86_64.rpm 10 | -------------------------------------------------------------------------------- /redmine/roles/ruby/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ruby_ver: "2.0.0-p451" 3 | ruby_archive: ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-{{ ruby_ver }}.tar.gz 4 | download_path: /usr/local/src 5 | install_prefix: /usr 6 | configure_options: --enable-shared 7 | libyaml-rpm: http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/libyaml-0.1.5-1.el6.x86_64.rpm 8 | libyaml-devel-rpm: http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/libyaml-devel-0.1.5-1.el6.x86_64.rpm 9 | paco-rpm: http://dl.fedoraproject.org/pub/epel/6/x86_64/paco-2.0.9-6.el6.x86_64.rpm 10 | -------------------------------------------------------------------------------- /webistrano/roles/ruby/vars/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ruby_ver: "2.0.0-p247" 3 | ruby_archive: ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-{{ ruby_ver }}.tar.gz 4 | download_path: /usr/local/src 5 | install_prefix: /usr 6 | configure_options: --enable-shared 7 | libyaml-rpm: http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/libyaml-0.1.3-1.el6.x86_64.rpm 8 | libyaml-devel-rpm: http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/libyaml-devel-0.1.3-1.el6.x86_64.rpm 9 | paco-rpm: http://dl.fedoraproject.org/pub/epel/6/x86_64/paco-2.0.9-6.el6.x86_64.rpm 10 | -------------------------------------------------------------------------------- /jenkins/roles/jenkins/templates/jenkins.conf: -------------------------------------------------------------------------------- 1 | 2 | ServerName jenkins 3 | ServerAdmin jenkins@example.com 4 | DocumentRoot /var/www/html 5 | ErrorLog logs/jenkins-error_log 6 | CustomLog logs/jenkins-access_log common 7 | 8 | 9 | ProxyRequests Off 10 | 11 | Order deny,allow 12 | Allow from all 13 | 14 | ProxyPass / http://localhost:8080/ 15 | ProxyPassReverse / http://localhost:8080/ 16 | 17 | 18 | -------------------------------------------------------------------------------- /gitlab/spec/gitlab-server/mysql_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('mysql-server') do 4 | it { should be_installed } 5 | end 6 | 7 | describe package('mysql-devel') do 8 | it { should be_installed } 9 | end 10 | 11 | describe package('MySQL-python') do 12 | it { should be_installed } 13 | end 14 | 15 | describe service('mysqld') do 16 | it { should be_enabled } 17 | it { should be_running } 18 | end 19 | 20 | describe port(3306) do 21 | it { should be_listening } 22 | end 23 | 24 | describe file('/etc/my.cnf') do 25 | it { should be_file } 26 | end 27 | -------------------------------------------------------------------------------- /lokka/spec/lokka-server/mysql_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('mysql-server') do 4 | it { should be_installed } 5 | end 6 | 7 | describe package('mysql-devel') do 8 | it { should be_installed } 9 | end 10 | 11 | describe package('MySQL-python') do 12 | it { should be_installed } 13 | end 14 | 15 | describe service('mysqld') do 16 | it { should be_enabled } 17 | it { should be_running } 18 | end 19 | 20 | describe port(3306) do 21 | it { should be_listening } 22 | end 23 | 24 | describe file('/etc/my.cnf') do 25 | it { should be_file } 26 | end 27 | -------------------------------------------------------------------------------- /webistrano/README.md: -------------------------------------------------------------------------------- 1 | # Webistrano 2 | 3 | Webistrano をインストールするための Playbook です。 4 | オリジナルではなく、waka さんが fork して Rails 3.2.9 に対応させたバージョンをインストールします。 5 | 6 | waka/webistrano 7 | https://github.com/waka/webistrano 8 | 9 | 動作環境として以下をインストールします。 10 | 11 | * Ruby 2.0 12 | * MySQL 13 | * Apache 14 | * Passenger 15 | 16 | 以下の環境で確認しています。 17 | 18 | * CentOS 6.4 x86_64 19 | * Ansible 1.2.2 20 | 21 | ## Usage 22 | 23 | clone 後、 hosts ファイル内に対象ホストのホスト名または IP アドレスを記述して以下のように実行します。 24 | 25 | $ ansible-playbook site.yml -i hosts -k 26 | 27 | インストール後のデフォルトのログインID/パスワードは admin/admin! です。 28 | 29 | -------------------------------------------------------------------------------- /redmine/spec/redmine-server/mysql_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('mysql-server') do 4 | it { should be_installed } 5 | end 6 | 7 | describe package('mysql-devel') do 8 | it { should be_installed } 9 | end 10 | 11 | describe package('MySQL-python') do 12 | it { should be_installed } 13 | end 14 | 15 | describe service('mysqld') do 16 | it { should be_enabled } 17 | it { should be_running } 18 | end 19 | 20 | describe port(3306) do 21 | it { should be_listening } 22 | end 23 | 24 | describe file('/etc/my.cnf') do 25 | it { should be_file } 26 | end 27 | -------------------------------------------------------------------------------- /gitlab-unicorn/spec/gitlab-server/mysql_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('mysql-server') do 4 | it { should be_installed } 5 | end 6 | 7 | describe package('mysql-devel') do 8 | it { should be_installed } 9 | end 10 | 11 | describe package('MySQL-python') do 12 | it { should be_installed } 13 | end 14 | 15 | describe service('mysqld') do 16 | it { should be_enabled } 17 | it { should be_running } 18 | end 19 | 20 | describe port(3306) do 21 | it { should be_listening } 22 | end 23 | 24 | describe file('/etc/my.cnf') do 25 | it { should be_file } 26 | end 27 | -------------------------------------------------------------------------------- /webistrano/spec/webistrano-server/mysql_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('mysql-server') do 4 | it { should be_installed } 5 | end 6 | 7 | describe package('mysql-devel') do 8 | it { should be_installed } 9 | end 10 | 11 | describe package('MySQL-python') do 12 | it { should be_installed } 13 | end 14 | 15 | describe service('mysqld') do 16 | it { should be_enabled } 17 | it { should be_running } 18 | end 19 | 20 | describe port(3306) do 21 | it { should be_listening } 22 | end 23 | 24 | describe file('/etc/my.cnf') do 25 | it { should be_file } 26 | end 27 | -------------------------------------------------------------------------------- /gitlab/roles/redis/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: import gpg-keys 3 | command: rpm --import $item 4 | with_items: gpg_keys 5 | ignore_errors: True 6 | 7 | - name: install repositories 8 | yum: name=$item state=installed 9 | with_items: repo_rpms 10 | ignore_errors: True 11 | 12 | - name: install redis packages 13 | action: yum name=redis state=installed 14 | 15 | - name: add a vm.overcommit_memory setting at the end of the sysctl.conf 16 | sysctl: name=vm.overcommit_memory value=1 state=present reload=yes 17 | 18 | - name: start redis 19 | action: service name=redis state=started enabled=yes 20 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/redis/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: import gpg-keys 3 | command: rpm --import $item 4 | with_items: gpg_keys 5 | ignore_errors: True 6 | 7 | - name: install repositories 8 | yum: name=$item state=installed 9 | with_items: repo_rpms 10 | ignore_errors: True 11 | 12 | - name: install redis packages 13 | action: yum name=redis state=installed 14 | 15 | - name: add a vm.overcommit_memory setting at the end of the sysctl.conf 16 | sysctl: name=vm.overcommit_memory value=1 state=present reload=yes 17 | 18 | - name: start redis 19 | action: service name=redis state=started enabled=yes 20 | -------------------------------------------------------------------------------- /jenkins/spec/jenkins-server/jenkins_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('java-1.7.0-openjdk') do 4 | it { should be_installed } 5 | end 6 | 7 | describe package('jenkins') do 8 | it { should be_installed } 9 | end 10 | 11 | describe file('/etc/yum.repos.d/jenkins.repo') do 12 | it { should be_file } 13 | it { should be_owned_by 'root' } 14 | it { should be_grouped_into 'root' } 15 | end 16 | 17 | describe file('/etc/httpd/conf.d/jenkins.conf') do 18 | it { should be_file } 19 | it { should contain "ServerName jenkins" } 20 | it { should contain "ProxyPass / http://localhost:8080/" } 21 | end 22 | -------------------------------------------------------------------------------- /lokka/roles/lokka/templates/database.default.yml.j2: -------------------------------------------------------------------------------- 1 | # DSN (Data Source Name) examples 2 | # 3 | # sqlite3: 4 | # sqlite3://<%= root %>/db/development.sqlite3 5 | # mysql: 6 | # mysql://user:pass@host/database 7 | # postgres: 8 | # postgres://user:pass@host/database 9 | # heroku: 10 | # <%= ENV['DATABASE_URL'] %> 11 | production: 12 | #dsn: <%= ENV['DATABASE_URL'] %> 13 | dsn: mysql://{{ lokka_mysql_user }}:{{ lokka_mysql_password }}@localhost/lokka 14 | development: 15 | dsn: sqlite3://<%= root %>/db/development.sqlite3 16 | test: 17 | dsn: <%= ENV['DATABASE_URL'] || "sqlite3://#{root}/db/test.sqlite3" %> 18 | -------------------------------------------------------------------------------- /jenkins/roles/jenkins/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install jenkins dependency packages 3 | action: yum name=$item state=installed 4 | with_items: 5 | - java-1.7.0-openjdk 6 | 7 | - name: install jenkins gpg key 8 | command: rpm --import $jenkins_repo_key 9 | 10 | - name: install jenkins yum repository 11 | get_url: url=$jenkins_repo dest=/etc/yum.repos.d/jenkins.repo 12 | 13 | - name: install jenkins 14 | action: yum name=jenkins state=installed 15 | 16 | - name: start jenkins 17 | service: name=jenkins state=started enabled=yes 18 | 19 | - name: copy jenkins.conf file 20 | template: src=jenkins.conf dest=/etc/httpd/conf.d/jenkins.conf 21 | notify: restart httpd 22 | -------------------------------------------------------------------------------- /lokka/roles/passenger/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install passenger gem 3 | gem: name=passenger state=present version=$passenger_ver 4 | 5 | - name: install passenger dependency packages 6 | action: yum name=$item state=installed 7 | with_items: 8 | - gcc 9 | - gcc-c++ 10 | - curl-devel 11 | - openssl-devel 12 | - zlib-devel 13 | - httpd-devel 14 | 15 | - name: install passenger-install-apache2-module 16 | shell: passenger-install-apache2-module --auto creates=/usr/lib/ruby/gems/2.0.0/gems/passenger-${passenger_ver}/buildout/apache2/mod_passenger.so 17 | 18 | - name: generate passenger.conf file 19 | shell: passenger-install-apache2-module --snippet > /etc/httpd/conf.d/passenger.conf 20 | -------------------------------------------------------------------------------- /redmine/roles/passenger/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install passenger gem 3 | gem: name=passenger state=present version=$passenger_ver 4 | 5 | - name: install passenger dependency packages 6 | action: yum name=$item state=installed 7 | with_items: 8 | - gcc 9 | - gcc-c++ 10 | - curl-devel 11 | - openssl-devel 12 | - zlib-devel 13 | - httpd-devel 14 | 15 | - name: install passenger-install-apache2-module 16 | shell: passenger-install-apache2-module --auto creates=/usr/lib/ruby/gems/2.0.0/gems/passenger-${passenger_ver}/buildout/apache2/mod_passenger.so 17 | 18 | - name: generate passenger.conf file 19 | shell: passenger-install-apache2-module --snippet > /etc/httpd/conf.d/passenger.conf 20 | -------------------------------------------------------------------------------- /webistrano/roles/passenger/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install passenger gem 3 | gem: name=passenger state=present version=$passenger_ver 4 | 5 | - name: install passenger dependency packages 6 | action: yum name=$item state=installed 7 | with_items: 8 | - gcc 9 | - gcc-c++ 10 | - curl-devel 11 | - openssl-devel 12 | - zlib-devel 13 | - httpd-devel 14 | 15 | - name: install passenger-install-apache2-module 16 | shell: passenger-install-apache2-module --auto creates=/usr/lib/ruby/gems/2.0.0/gems/passenger-${passenger_ver}/buildout/apache2/mod_passenger.so 17 | 18 | - name: generate passenger.conf file 19 | shell: passenger-install-apache2-module --snippet > /etc/httpd/conf.d/passenger.conf 20 | -------------------------------------------------------------------------------- /snippets/change_password.yml: -------------------------------------------------------------------------------- 1 | - hosts: all 2 | user: root 3 | vars: 4 | username: johnd 5 | saltstr: saltstr 6 | vars_prompt: 7 | - name: "new_password" 8 | prompt: "Enter new password" 9 | confirm: true 10 | private: yes 11 | tasks: 12 | - name: "create password salt" 13 | shell: echo somesalt | /usr/bin/md5sum | awk '{print $1}' 14 | register: password_salt 15 | 16 | - name: "create new password hash" 17 | command: python -c 'import crypt; print crypt.crypt("{{ new_password }}", "$1${{ password_salt.stdout }}$")' 18 | register: password_hash 19 | 20 | - name: "change password" 21 | user: name={{ username }} password={{ password_hash.stdout }} state=present 22 | 23 | -------------------------------------------------------------------------------- /gitlab/roles/passenger/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install passenger gem 3 | gem: name=passenger state=present version=$passenger_ver 4 | 5 | - name: install passenger dependency packages 6 | action: yum name=$item state=installed 7 | with_items: 8 | - gcc 9 | - gcc-c++ 10 | - curl-devel 11 | - openssl-devel 12 | - zlib-devel 13 | - httpd-devel 14 | 15 | - name: install passenger-install-apache2-module 16 | shell: passenger-install-apache2-module --auto creates=/usr/lib/ruby/gems/2.0.0/gems/passenger-{{ passenger_ver }}/buildout/apache2/mod_passenger.so 17 | 18 | - name: generate passenger.conf file 19 | shell: passenger-install-apache2-module --snippet > /etc/httpd/conf.d/passenger.conf 20 | notify: restart httpd 21 | -------------------------------------------------------------------------------- /snippets/add_user.yml: -------------------------------------------------------------------------------- 1 | - hosts: all 2 | user: root 3 | vars: 4 | username: johnd 5 | comment: "John Doe" 6 | saltstr: saltstr 7 | vars_prompt: 8 | - name: "user_password" 9 | prompt: "Enter password" 10 | confirm: true 11 | private: yes 12 | tasks: 13 | - name: "create password salt" 14 | shell: echo somesalt | /usr/bin/md5sum | awk '{print $1}' 15 | register: password_salt 16 | 17 | - name: "create password hash" 18 | command: python -c 'import crypt; print crypt.crypt("{{ user_password }}", "$1${{ password_salt.stdout }}$")' 19 | register: password_hash 20 | 21 | - name: "create user" 22 | user: name={{ username }} comment="{{ comment }}" password={{ password_hash.stdout }} state=present 23 | 24 | -------------------------------------------------------------------------------- /gitlab/roles/gitlab/templates/rack_attack.rb.j2: -------------------------------------------------------------------------------- 1 | # 1. Rename this file to rack_attack.rb 2 | # 2. Review the paths_to_be_protected and add any other path you need protecting 3 | # 4 | 5 | paths_to_be_protected = [ 6 | "#{Rails.application.config.relative_url_root}/users/password", 7 | "#{Rails.application.config.relative_url_root}/users/sign_in", 8 | "#{Rails.application.config.relative_url_root}/api/#{API::API.version}/session.json", 9 | "#{Rails.application.config.relative_url_root}/api/#{API::API.version}/session", 10 | "#{Rails.application.config.relative_url_root}/users" 11 | ] 12 | 13 | unless Rails.env.test? 14 | Rack::Attack.throttle('protected paths', limit: 10, period: 60.seconds) do |req| 15 | req.ip if paths_to_be_protected.include?(req.path) && req.post? 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/gitlab/templates/rack_attack.rb.j2: -------------------------------------------------------------------------------- 1 | # 1. Rename this file to rack_attack.rb 2 | # 2. Review the paths_to_be_protected and add any other path you need protecting 3 | # 4 | 5 | paths_to_be_protected = [ 6 | "#{Rails.application.config.relative_url_root}/users/password", 7 | "#{Rails.application.config.relative_url_root}/users/sign_in", 8 | "#{Rails.application.config.relative_url_root}/api/#{API::API.version}/session.json", 9 | "#{Rails.application.config.relative_url_root}/api/#{API::API.version}/session", 10 | "#{Rails.application.config.relative_url_root}/users" 11 | ] 12 | 13 | unless Rails.env.test? 14 | Rack::Attack.throttle('protected paths', limit: 10, period: 60.seconds) do |req| 15 | req.ip if paths_to_be_protected.include?(req.path) && req.post? 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lokka/spec/lokka-server/passenger_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('gcc') do 4 | it { should be_installed } 5 | end 6 | 7 | describe package('gcc-c++') do 8 | it { should be_installed } 9 | end 10 | 11 | describe package('libcurl-devel') do 12 | it { should be_installed } 13 | end 14 | 15 | describe package('openssl-devel') do 16 | it { should be_installed } 17 | end 18 | 19 | describe package('zlib-devel') do 20 | it { should be_installed } 21 | end 22 | 23 | describe package('httpd-devel') do 24 | it { should be_installed } 25 | end 26 | 27 | describe package('passenger') do 28 | it { should be_installed.by('gem') } 29 | end 30 | 31 | describe file('/etc/httpd/conf.d/passenger.conf') do 32 | it { should be_file } 33 | end 34 | 35 | describe command('/usr/sbin/apachectl -M') do 36 | it { should return_stdout /passenger_module/} 37 | end 38 | -------------------------------------------------------------------------------- /gitlab/spec/gitlab-server/passenger_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('gcc') do 4 | it { should be_installed } 5 | end 6 | 7 | describe package('gcc-c++') do 8 | it { should be_installed } 9 | end 10 | 11 | describe package('libcurl-devel') do 12 | it { should be_installed } 13 | end 14 | 15 | describe package('openssl-devel') do 16 | it { should be_installed } 17 | end 18 | 19 | describe package('zlib-devel') do 20 | it { should be_installed } 21 | end 22 | 23 | describe package('httpd-devel') do 24 | it { should be_installed } 25 | end 26 | 27 | describe package('passenger') do 28 | it { should be_installed.by('gem') } 29 | end 30 | 31 | describe file('/etc/httpd/conf.d/passenger.conf') do 32 | it { should be_file } 33 | end 34 | 35 | describe command('/usr/sbin/apachectl -M') do 36 | it { should return_stdout /passenger_module/} 37 | end 38 | -------------------------------------------------------------------------------- /redmine/spec/redmine-server/passenger_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('gcc') do 4 | it { should be_installed } 5 | end 6 | 7 | describe package('gcc-c++') do 8 | it { should be_installed } 9 | end 10 | 11 | describe package('libcurl-devel') do 12 | it { should be_installed } 13 | end 14 | 15 | describe package('openssl-devel') do 16 | it { should be_installed } 17 | end 18 | 19 | describe package('zlib-devel') do 20 | it { should be_installed } 21 | end 22 | 23 | describe package('httpd-devel') do 24 | it { should be_installed } 25 | end 26 | 27 | describe package('passenger') do 28 | it { should be_installed.by('gem') } 29 | end 30 | 31 | describe file('/etc/httpd/conf.d/passenger.conf') do 32 | it { should be_file } 33 | end 34 | 35 | describe command('/usr/sbin/apachectl -M') do 36 | it { should return_stdout /passenger_module/} 37 | end 38 | -------------------------------------------------------------------------------- /git1.8/spec/git/git_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('gcc') do 4 | it { should be_installed } 5 | end 6 | 7 | describe package('make') do 8 | it { should be_installed } 9 | end 10 | 11 | describe package('openssl-devel') do 12 | it { should be_installed } 13 | end 14 | 15 | describe package('zlib-devel') do 16 | it { should be_installed } 17 | end 18 | 19 | describe package('gettext') do 20 | it { should be_installed } 21 | end 22 | 23 | describe package('perl-ExtUtils-MakeMaker') do 24 | it { should be_installed } 25 | end 26 | 27 | describe package('paco') do 28 | it { should be_installed } 29 | end 30 | 31 | describe command('paco -a') do 32 | it { should return_stdout /git-1\.8\./ } 33 | end 34 | 35 | describe file('/usr/bin/git') do 36 | it { should be_file } 37 | it { should be_mode 755 } 38 | it { should be_owned_by 'root' } 39 | end 40 | -------------------------------------------------------------------------------- /webistrano/spec/webistrano-server/passenger_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('gcc') do 4 | it { should be_installed } 5 | end 6 | 7 | describe package('gcc-c++') do 8 | it { should be_installed } 9 | end 10 | 11 | describe package('libcurl-devel') do 12 | it { should be_installed } 13 | end 14 | 15 | describe package('openssl-devel') do 16 | it { should be_installed } 17 | end 18 | 19 | describe package('zlib-devel') do 20 | it { should be_installed } 21 | end 22 | 23 | describe package('httpd-devel') do 24 | it { should be_installed } 25 | end 26 | 27 | describe package('passenger') do 28 | it { should be_installed.by('gem') } 29 | end 30 | 31 | describe file('/etc/httpd/conf.d/passenger.conf') do 32 | it { should be_file } 33 | end 34 | 35 | describe command('/usr/sbin/apachectl -M') do 36 | it { should return_stdout /passenger_module/} 37 | end 38 | -------------------------------------------------------------------------------- /webistrano/roles/webistrano/templates/webistrano_config.rb.j2: -------------------------------------------------------------------------------- 1 | # 2 | # Example Webistarno configuration 3 | # 4 | # copy this file to config/webistrano.rb and edit 5 | # 6 | WebistranoConfig = { 7 | # Uncomment to use CAS authentication 8 | # :authentication_method => :cas, 9 | 10 | # SMTP settings for outgoing email 11 | :smtp_delivery_method => :sendmail, 12 | 13 | :smtp_settings => { 14 | :address => "localhost", 15 | :port => 25, 16 | #:domain => "example.com", 17 | #:user_name => "username", 18 | #:password => "passwd", 19 | #:authentication => :login 20 | }, 21 | 22 | # Sender address for Webistrano emails 23 | :webistrano_sender_address => "webistrano@example.com", 24 | 25 | # Sender and recipient for Webistrano exceptions 26 | :exception_recipients => "team@example.com", 27 | :exception_sender_address => "webistrano@example.com" 28 | } 29 | -------------------------------------------------------------------------------- /git1.8/roles/git/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: install packages 2 | action: yum name=$item state=installed 3 | with_items: 4 | - gcc 5 | - make 6 | - openssl-devel 7 | - curl-devel 8 | - zlib-devel 9 | - gettext 10 | - perl-ExtUtils-MakeMaker 11 | - ${paco-rpm} 12 | 13 | - name: download git $git_ver archive 14 | get_url: url=$git_archive dest=$download_path/$git_ver.tar.gz 15 | 16 | - name: extract git archive 17 | command: tar xzf $git_ver.tar.gz chdir=$download_path creates=$download_path/git-$git_ver 18 | 19 | - name: configure git 20 | command: ./configure --prefix=$install_prefix chdir=$download_path/git-$git_ver creates=$install_prefix/bin/git 21 | 22 | - name: make git 23 | command: make chdir=$download_path/git-$git_ver creates=$install_prefix/bin/git 24 | 25 | - name: install git 26 | command: paco -D make install chdir=$download_path/git-$git_ver creates=$install_prefix/bin/git 27 | -------------------------------------------------------------------------------- /webistrano/roles/webistrano/templates/Gemfile.j2: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "rails", "3.2.9" 4 | 5 | gem "exception_notification", '3.0.1' 6 | 7 | gem "capistrano" 8 | gem "open4" 9 | gem "syntax" 10 | gem "version_fu", :github => "jmckible/version_fu" 11 | gem "devise" 12 | gem "devise-encryptable" 13 | 14 | group :development do 15 | gem "sqlite3" 16 | gem "thin" 17 | 18 | gem "debugger" 19 | gem "pry" 20 | gem "pry-rails" 21 | end 22 | 23 | group :test do 24 | gem "sqlite3" 25 | gem "test-unit" 26 | gem "mocha", "0.12.7" 27 | gem "factory_girl_rails" 28 | gem "database_cleaner" 29 | end 30 | 31 | group :production do 32 | gem "mysql2" 33 | gem "unicorn" 34 | end 35 | 36 | group :assets do 37 | gem "jquery-rails" 38 | gem 'sass-rails', '~> 3.2.3' 39 | gem 'coffee-rails', '~> 3.2.1' 40 | gem 'uglifier', '>= 1.0.3' 41 | gem 'therubyracer', :platforms => :ruby 42 | end 43 | -------------------------------------------------------------------------------- /gitlab/roles/git/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: uninstall git 3 | action: yum name=git state=removed 4 | 5 | - name: install packages 6 | action: yum name=$item state=installed 7 | with_items: 8 | - gcc 9 | - make 10 | - openssl-devel 11 | - curl-devel 12 | - zlib-devel 13 | - gettext 14 | - perl-ExtUtils-MakeMaker 15 | 16 | - name: download git $git_ver archive 17 | get_url: url=$git_archive dest=$download_path/$git_ver.tar.gz 18 | 19 | - name: extract git archive 20 | command: tar xzf $git_ver.tar.gz chdir=$download_path creates=$download_path/git-$git_ver 21 | 22 | - name: configure git 23 | command: ./configure --prefix=$install_prefix chdir=$download_path/git-$git_ver creates=$install_prefix/bin/git 24 | 25 | - name: make git 26 | command: make chdir=$download_path/git-$git_ver creates=$install_prefix/bin/git 27 | 28 | - name: install git 29 | command: paco -D make install chdir=$download_path/git-$git_ver creates=$install_prefix/bin/git 30 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/git/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: uninstall git 3 | action: yum name=git state=removed 4 | 5 | - name: install packages 6 | action: yum name=$item state=installed 7 | with_items: 8 | - gcc 9 | - make 10 | - openssl-devel 11 | - curl-devel 12 | - zlib-devel 13 | - gettext 14 | - perl-ExtUtils-MakeMaker 15 | 16 | - name: download git $git_ver archive 17 | get_url: url=$git_archive dest=$download_path/$git_ver.tar.gz 18 | 19 | - name: extract git archive 20 | command: tar xzf $git_ver.tar.gz chdir=$download_path creates=$download_path/git-$git_ver 21 | 22 | - name: configure git 23 | command: ./configure --prefix=$install_prefix chdir=$download_path/git-$git_ver creates=$install_prefix/bin/git 24 | 25 | - name: make git 26 | command: make chdir=$download_path/git-$git_ver creates=$install_prefix/bin/git 27 | 28 | - name: install git 29 | command: paco -D make install chdir=$download_path/git-$git_ver creates=$install_prefix/bin/git 30 | -------------------------------------------------------------------------------- /git1.8/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'serverspec' 2 | require 'pathname' 3 | require 'net/ssh' 4 | 5 | include Serverspec::Helper::Ssh 6 | include Serverspec::Helper::DetectOS 7 | 8 | RSpec.configure do |c| 9 | if ENV['ASK_SUDO_PASSWORD'] 10 | require 'highline/import' 11 | c.sudo_password = ask("Enter sudo password: ") { |q| q.echo = false } 12 | else 13 | c.sudo_password = ENV['SUDO_PASSWORD'] 14 | end 15 | c.before :all do 16 | block = self.class.metadata[:example_group_block] 17 | if RUBY_VERSION.start_with?('1.8') 18 | file = block.to_s.match(/.*@(.*):[0-9]+>/)[1] 19 | else 20 | file = block.source_location.first 21 | end 22 | host = File.basename(Pathname.new(file).dirname) 23 | if c.host != host 24 | c.ssh.close if c.ssh 25 | c.host = host 26 | options = Net::SSH::Config.for(c.host) 27 | user = options[:user] || Etc.getlogin 28 | 29 | c.ssh = Net::SSH.start(c.host, user, options) 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /gitlab/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'serverspec' 2 | require 'pathname' 3 | require 'net/ssh' 4 | 5 | include Serverspec::Helper::Ssh 6 | include Serverspec::Helper::DetectOS 7 | 8 | RSpec.configure do |c| 9 | if ENV['ASK_SUDO_PASSWORD'] 10 | require 'highline/import' 11 | c.sudo_password = ask("Enter sudo password: ") { |q| q.echo = false } 12 | else 13 | c.sudo_password = ENV['SUDO_PASSWORD'] 14 | end 15 | c.before :all do 16 | block = self.class.metadata[:example_group_block] 17 | if RUBY_VERSION.start_with?('1.8') 18 | file = block.to_s.match(/.*@(.*):[0-9]+>/)[1] 19 | else 20 | file = block.source_location.first 21 | end 22 | host = File.basename(Pathname.new(file).dirname) 23 | if c.host != host 24 | c.ssh.close if c.ssh 25 | c.host = host 26 | options = Net::SSH::Config.for(c.host) 27 | user = options[:user] || Etc.getlogin 28 | 29 | c.ssh = Net::SSH.start(c.host, user, options) 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /jenkins/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'serverspec' 2 | require 'pathname' 3 | require 'net/ssh' 4 | 5 | include Serverspec::Helper::Ssh 6 | include Serverspec::Helper::DetectOS 7 | 8 | RSpec.configure do |c| 9 | if ENV['ASK_SUDO_PASSWORD'] 10 | require 'highline/import' 11 | c.sudo_password = ask("Enter sudo password: ") { |q| q.echo = false } 12 | else 13 | c.sudo_password = ENV['SUDO_PASSWORD'] 14 | end 15 | c.before :all do 16 | block = self.class.metadata[:example_group_block] 17 | if RUBY_VERSION.start_with?('1.8') 18 | file = block.to_s.match(/.*@(.*):[0-9]+>/)[1] 19 | else 20 | file = block.source_location.first 21 | end 22 | host = File.basename(Pathname.new(file).dirname) 23 | if c.host != host 24 | c.ssh.close if c.ssh 25 | c.host = host 26 | options = Net::SSH::Config.for(c.host) 27 | user = options[:user] || Etc.getlogin 28 | 29 | c.ssh = Net::SSH.start(c.host, user, options) 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /lokka/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'serverspec' 2 | require 'pathname' 3 | require 'net/ssh' 4 | 5 | include Serverspec::Helper::Ssh 6 | include Serverspec::Helper::DetectOS 7 | 8 | RSpec.configure do |c| 9 | if ENV['ASK_SUDO_PASSWORD'] 10 | require 'highline/import' 11 | c.sudo_password = ask("Enter sudo password: ") { |q| q.echo = false } 12 | else 13 | c.sudo_password = ENV['SUDO_PASSWORD'] 14 | end 15 | c.before :all do 16 | block = self.class.metadata[:example_group_block] 17 | if RUBY_VERSION.start_with?('1.8') 18 | file = block.to_s.match(/.*@(.*):[0-9]+>/)[1] 19 | else 20 | file = block.source_location.first 21 | end 22 | host = File.basename(Pathname.new(file).dirname) 23 | if c.host != host 24 | c.ssh.close if c.ssh 25 | c.host = host 26 | options = Net::SSH::Config.for(c.host) 27 | user = options[:user] || Etc.getlogin 28 | 29 | c.ssh = Net::SSH.start(c.host, user, options) 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /mysql5.6/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'serverspec' 2 | require 'pathname' 3 | require 'net/ssh' 4 | 5 | include Serverspec::Helper::Ssh 6 | include Serverspec::Helper::DetectOS 7 | 8 | RSpec.configure do |c| 9 | if ENV['ASK_SUDO_PASSWORD'] 10 | require 'highline/import' 11 | c.sudo_password = ask("Enter sudo password: ") { |q| q.echo = false } 12 | else 13 | c.sudo_password = ENV['SUDO_PASSWORD'] 14 | end 15 | c.before :all do 16 | block = self.class.metadata[:example_group_block] 17 | if RUBY_VERSION.start_with?('1.8') 18 | file = block.to_s.match(/.*@(.*):[0-9]+>/)[1] 19 | else 20 | file = block.source_location.first 21 | end 22 | host = File.basename(Pathname.new(file).dirname) 23 | if c.host != host 24 | c.ssh.close if c.ssh 25 | c.host = host 26 | options = Net::SSH::Config.for(c.host) 27 | user = options[:user] || Etc.getlogin 28 | 29 | c.ssh = Net::SSH.start(c.host, user, options) 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /redmine/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'serverspec' 2 | require 'pathname' 3 | require 'net/ssh' 4 | 5 | include Serverspec::Helper::Ssh 6 | include Serverspec::Helper::DetectOS 7 | 8 | RSpec.configure do |c| 9 | if ENV['ASK_SUDO_PASSWORD'] 10 | require 'highline/import' 11 | c.sudo_password = ask("Enter sudo password: ") { |q| q.echo = false } 12 | else 13 | c.sudo_password = ENV['SUDO_PASSWORD'] 14 | end 15 | c.before :all do 16 | block = self.class.metadata[:example_group_block] 17 | if RUBY_VERSION.start_with?('1.8') 18 | file = block.to_s.match(/.*@(.*):[0-9]+>/)[1] 19 | else 20 | file = block.source_location.first 21 | end 22 | host = File.basename(Pathname.new(file).dirname) 23 | if c.host != host 24 | c.ssh.close if c.ssh 25 | c.host = host 26 | options = Net::SSH::Config.for(c.host) 27 | user = options[:user] || Etc.getlogin 28 | 29 | c.ssh = Net::SSH.start(c.host, user, options) 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /ruby2.0/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'serverspec' 2 | require 'pathname' 3 | require 'net/ssh' 4 | 5 | include Serverspec::Helper::Ssh 6 | include Serverspec::Helper::DetectOS 7 | 8 | RSpec.configure do |c| 9 | if ENV['ASK_SUDO_PASSWORD'] 10 | require 'highline/import' 11 | c.sudo_password = ask("Enter sudo password: ") { |q| q.echo = false } 12 | else 13 | c.sudo_password = ENV['SUDO_PASSWORD'] 14 | end 15 | c.before :all do 16 | block = self.class.metadata[:example_group_block] 17 | if RUBY_VERSION.start_with?('1.8') 18 | file = block.to_s.match(/.*@(.*):[0-9]+>/)[1] 19 | else 20 | file = block.source_location.first 21 | end 22 | host = File.basename(Pathname.new(file).dirname) 23 | if c.host != host 24 | c.ssh.close if c.ssh 25 | c.host = host 26 | options = Net::SSH::Config.for(c.host) 27 | user = options[:user] || Etc.getlogin 28 | 29 | c.ssh = Net::SSH.start(c.host, user, options) 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /webistrano/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'serverspec' 2 | require 'pathname' 3 | require 'net/ssh' 4 | 5 | include Serverspec::Helper::Ssh 6 | include Serverspec::Helper::DetectOS 7 | 8 | RSpec.configure do |c| 9 | if ENV['ASK_SUDO_PASSWORD'] 10 | require 'highline/import' 11 | c.sudo_password = ask("Enter sudo password: ") { |q| q.echo = false } 12 | else 13 | c.sudo_password = ENV['SUDO_PASSWORD'] 14 | end 15 | c.before :all do 16 | block = self.class.metadata[:example_group_block] 17 | if RUBY_VERSION.start_with?('1.8') 18 | file = block.to_s.match(/.*@(.*):[0-9]+>/)[1] 19 | else 20 | file = block.source_location.first 21 | end 22 | host = File.basename(Pathname.new(file).dirname) 23 | if c.host != host 24 | c.ssh.close if c.ssh 25 | c.host = host 26 | options = Net::SSH::Config.for(c.host) 27 | user = options[:user] || Etc.getlogin 28 | 29 | c.ssh = Net::SSH.start(c.host, user, options) 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /gitlab-unicorn/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'serverspec' 2 | require 'pathname' 3 | require 'net/ssh' 4 | 5 | include Serverspec::Helper::Ssh 6 | include Serverspec::Helper::DetectOS 7 | 8 | RSpec.configure do |c| 9 | if ENV['ASK_SUDO_PASSWORD'] 10 | require 'highline/import' 11 | c.sudo_password = ask("Enter sudo password: ") { |q| q.echo = false } 12 | else 13 | c.sudo_password = ENV['SUDO_PASSWORD'] 14 | end 15 | c.before :all do 16 | block = self.class.metadata[:example_group_block] 17 | if RUBY_VERSION.start_with?('1.8') 18 | file = block.to_s.match(/.*@(.*):[0-9]+>/)[1] 19 | else 20 | file = block.source_location.first 21 | end 22 | host = File.basename(Pathname.new(file).dirname) 23 | if c.host != host 24 | c.ssh.close if c.ssh 25 | c.host = host 26 | options = Net::SSH::Config.for(c.host) 27 | user = options[:user] || Etc.getlogin 28 | 29 | c.ssh = Net::SSH.start(c.host, user, options) 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /redis-replication/spec/redis-master/redis_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('redis') do 4 | it { should be_installed } 5 | end 6 | 7 | describe service('redis') do 8 | it { should be_enabled } 9 | it { should be_running } 10 | end 11 | 12 | describe port(6379) do 13 | it { should be_listening } 14 | end 15 | 16 | describe iptables do 17 | it { should have_rule('-A INPUT -p tcp -m tcp --dport 6379 -j ACCEPT') } 18 | end 19 | 20 | describe file('/etc/redis.conf') do 21 | it { should be_file } 22 | it { should be_owned_by 'root' } 23 | end 24 | 25 | describe file('/etc/sysconfig/redis') do 26 | it { should be_file } 27 | it { should be_owned_by 'root' } 28 | end 29 | 30 | describe file('/etc/security/limits.d/redis.conf') do 31 | it { should be_file } 32 | it { should be_owned_by 'root' } 33 | end 34 | 35 | describe command('/usr/bin/redis-cli info replication') do 36 | it { should return_stdout /role:master/ } 37 | it { should return_stdout /connected_slaves:1/ } 38 | end 39 | -------------------------------------------------------------------------------- /redis-replication/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'serverspec' 2 | require 'pathname' 3 | require 'net/ssh' 4 | 5 | include Serverspec::Helper::Ssh 6 | include Serverspec::Helper::DetectOS 7 | 8 | RSpec.configure do |c| 9 | if ENV['ASK_SUDO_PASSWORD'] 10 | require 'highline/import' 11 | c.sudo_password = ask("Enter sudo password: ") { |q| q.echo = false } 12 | else 13 | c.sudo_password = ENV['SUDO_PASSWORD'] 14 | end 15 | c.before :all do 16 | block = self.class.metadata[:example_group_block] 17 | if RUBY_VERSION.start_with?('1.8') 18 | file = block.to_s.match(/.*@(.*):[0-9]+>/)[1] 19 | else 20 | file = block.source_location.first 21 | end 22 | host = File.basename(Pathname.new(file).dirname) 23 | if c.host != host 24 | c.ssh.close if c.ssh 25 | c.host = host 26 | options = Net::SSH::Config.for(c.host) 27 | user = options[:user] || Etc.getlogin 28 | 29 | c.ssh = Net::SSH.start(c.host, user, options) 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /redis-replication/spec/redis-slave/redis_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('redis') do 4 | it { should be_installed } 5 | end 6 | 7 | describe service('redis') do 8 | it { should be_enabled } 9 | it { should be_running } 10 | end 11 | 12 | describe port(6379) do 13 | it { should be_listening } 14 | end 15 | 16 | describe iptables do 17 | it { should have_rule('-A INPUT -p tcp -m tcp --dport 6379 -j ACCEPT') } 18 | end 19 | 20 | describe file('/etc/redis.conf') do 21 | it { should be_file } 22 | it { should be_owned_by 'root' } 23 | end 24 | 25 | describe file('/etc/sysconfig/redis') do 26 | it { should be_file } 27 | it { should be_owned_by 'root' } 28 | end 29 | 30 | describe file('/etc/security/limits.d/redis.conf') do 31 | it { should be_file } 32 | it { should be_owned_by 'root' } 33 | end 34 | 35 | describe command('/usr/bin/redis-cli info replication') do 36 | it { should return_stdout /role:slave/ } 37 | it { should return_stdout /master_link_status:up/ } 38 | it { should return_stdout /slave_read_only:1/ } 39 | it { should return_stdout /connected_slaves:0/ } 40 | end 41 | -------------------------------------------------------------------------------- /snippets/add_third_party_repositories_for_yum.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: all 3 | user: root 4 | vars: 5 | gpg_keys: 6 | - http://apt.sw.be/RPM-GPG-KEY.dag.txt 7 | - http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6 8 | - http://rpms.famillecollet.com/RPM-GPG-KEY-remi 9 | repo_rpms: 10 | - http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm 11 | - http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm 12 | - http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 13 | repo_files: 14 | - epel.repo 15 | - epel-testing.repo 16 | - rpmforge.repo 17 | - remi.repo 18 | tasks: 19 | - name: import gpg-keys 20 | command: rpm --import $item 21 | with_items: gpg_keys 22 | ignore_errors: True 23 | 24 | - name: install repositories 25 | yum: name=$item state=installed 26 | with_items: repo_rpms 27 | ignore_errors: True 28 | 29 | - name: disable repositories by default 30 | command: sed -i "s/^\(enabled *= *\)1$/\10/g" /etc/yum.repos.d/$item 31 | with_items: repo_files 32 | 33 | -------------------------------------------------------------------------------- /redis-replication/roles/common/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: import gpg-keys 3 | command: rpm --import $item 4 | with_items: gpg_keys 5 | ignore_errors: True 6 | 7 | - name: install repositories 8 | yum: name=$item state=installed 9 | with_items: repo_rpms 10 | ignore_errors: True 11 | 12 | - name: install redis packages 13 | action: yum name=redis enablerepo=remi state=installed 14 | 15 | - name: copy /etc/security/limits.d/redis.conf 16 | template: src=limits-redis.conf.j2 dest=/etc/security/limits.d/redis.conf owner=root 17 | 18 | - name: copy /etc/sysconfig/redis file 19 | template: src=sysconfig-redis.j2 dest=/etc/sysconfig/redis owner=root 20 | 21 | - name: add a vm.overcommit_memory setting at the end of the sysctl.conf 22 | sysctl: name=vm.overcommit_memory value=1 state=present reload=yes 23 | 24 | - name: insert iptables rule 25 | lineinfile: dest=/etc/sysconfig/iptables state=present regexp="{{ redis_port }}" 26 | insertafter="^:OUTPUT " line="-A INPUT -p tcp --dport {{ redis_port }} -j ACCEPT" 27 | notify: restart iptables 28 | 29 | - name: start redis 30 | action: service name=redis state=started enabled=yes 31 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Shin Akiyama . 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /gitlab/roles/ruby/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: remove installed ruby rpms 3 | yum: name=$item state=removed 4 | with_items: 5 | - ruby 6 | - ruby-libs 7 | 8 | - name: install packages 9 | action: yum name=$item state=installed 10 | with_items: 11 | - gcc 12 | - make 13 | - zlib-devel 14 | - openssl-devel 15 | - readline-devel 16 | - ncurses-devel 17 | - gdbm-devel 18 | - db4-devel 19 | - libffi-devel 20 | - tk-devel 21 | - ${libyaml} 22 | - ${libyaml_devel} 23 | 24 | - name: download ruby $ruby_ver archive 25 | get_url: url=$ruby_archive dest=$download_path/ruby-$ruby_ver.tar.gz 26 | 27 | - name: extract ruby archive 28 | command: tar xzf ruby-$ruby_ver.tar.gz chdir=$download_path creates=$download_path/ruby-$ruby_ver 29 | 30 | - name: configure ruby 31 | command: ./configure --prefix=$install_prefix $configure_options chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 32 | 33 | - name: make ruby 34 | command: make chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 35 | 36 | - name: install ruby 37 | command: paco -D make install chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 38 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/ruby/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: remove installed ruby rpms 3 | yum: name=$item state=removed 4 | with_items: 5 | - ruby 6 | - ruby-libs 7 | 8 | - name: install packages 9 | action: yum name=$item state=installed 10 | with_items: 11 | - gcc 12 | - make 13 | - zlib-devel 14 | - openssl-devel 15 | - readline-devel 16 | - ncurses-devel 17 | - gdbm-devel 18 | - db4-devel 19 | - libffi-devel 20 | - tk-devel 21 | - ${libyaml} 22 | - ${libyaml_devel} 23 | 24 | - name: download ruby $ruby_ver archive 25 | get_url: url=$ruby_archive dest=$download_path/ruby-$ruby_ver.tar.gz 26 | 27 | - name: extract ruby archive 28 | command: tar xzf ruby-$ruby_ver.tar.gz chdir=$download_path creates=$download_path/ruby-$ruby_ver 29 | 30 | - name: configure ruby 31 | command: ./configure --prefix=$install_prefix $configure_options chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 32 | 33 | - name: make ruby 34 | command: make chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 35 | 36 | - name: install ruby 37 | command: paco -D make install chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 38 | -------------------------------------------------------------------------------- /ruby2.0/roles/ruby/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: remove installed ruby rpms 2 | yum: name=$item state=removed 3 | with_items: 4 | - ruby 5 | - ruby-libs 6 | 7 | - name: install packages 8 | action: yum name=$item state=installed 9 | with_items: 10 | - gcc 11 | - make 12 | - zlib-devel 13 | - openssl-devel 14 | - readline-devel 15 | - ncurses-devel 16 | - gdbm-devel 17 | - db4-devel 18 | - libffi-devel 19 | - tk-devel 20 | - ${libyaml-rpm} 21 | - ${libyaml-devel-rpm} 22 | - ${paco-rpm} 23 | 24 | - name: download ruby $ruby_ver archive 25 | get_url: url=$ruby_archive dest=$download_path/ruby-$ruby_ver.tar.gz 26 | 27 | - name: extract ruby archive 28 | command: tar xzf ruby-$ruby_ver.tar.gz chdir=$download_path creates=$download_path/ruby-$ruby_ver 29 | 30 | - name: configure ruby 31 | command: ./configure --prefix=$install_prefix $configure_options chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 32 | 33 | - name: make ruby 34 | command: make chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 35 | 36 | - name: install ruby 37 | command: paco -D make install chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 38 | 39 | -------------------------------------------------------------------------------- /lokka/roles/ruby/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: remove installed ruby rpms 3 | yum: name=$item state=removed 4 | with_items: 5 | - ruby 6 | - ruby-libs 7 | 8 | - name: install ruby dependency packages 9 | action: yum name=$item state=installed 10 | with_items: 11 | - gcc 12 | - make 13 | - zlib-devel 14 | - openssl-devel 15 | - readline-devel 16 | - ncurses-devel 17 | - gdbm-devel 18 | - db4-devel 19 | - libffi-devel 20 | - tk-devel 21 | - ${libyaml-rpm} 22 | - ${libyaml-devel-rpm} 23 | - ${paco-rpm} 24 | 25 | - name: download ruby $ruby_ver archive 26 | get_url: url=$ruby_archive dest=$download_path/ruby-$ruby_ver.tar.gz 27 | 28 | - name: extract ruby archive 29 | command: tar xzf ruby-$ruby_ver.tar.gz chdir=$download_path creates=$download_path/ruby-$ruby_ver 30 | 31 | - name: configure ruby 32 | command: ./configure --prefix=$install_prefix $configure_options chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 33 | 34 | - name: make ruby 35 | command: make chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 36 | 37 | - name: install ruby 38 | command: paco -D make install chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 39 | -------------------------------------------------------------------------------- /redmine/roles/ruby/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: remove installed ruby rpms 3 | yum: name=$item state=removed 4 | with_items: 5 | - ruby 6 | - ruby-libs 7 | 8 | - name: install ruby dependency packages 9 | action: yum name=$item state=installed 10 | with_items: 11 | - gcc 12 | - make 13 | - zlib-devel 14 | - openssl-devel 15 | - readline-devel 16 | - ncurses-devel 17 | - gdbm-devel 18 | - db4-devel 19 | - libffi-devel 20 | - tk-devel 21 | - ${libyaml-rpm} 22 | - ${libyaml-devel-rpm} 23 | - ${paco-rpm} 24 | 25 | - name: download ruby $ruby_ver archive 26 | get_url: url=$ruby_archive dest=$download_path/ruby-$ruby_ver.tar.gz 27 | 28 | - name: extract ruby archive 29 | command: tar xzf ruby-$ruby_ver.tar.gz chdir=$download_path creates=$download_path/ruby-$ruby_ver 30 | 31 | - name: configure ruby 32 | command: ./configure --prefix=$install_prefix $configure_options chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 33 | 34 | - name: make ruby 35 | command: make chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 36 | 37 | - name: install ruby 38 | command: paco -D make install chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 39 | -------------------------------------------------------------------------------- /webistrano/roles/ruby/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: remove installed ruby rpms 3 | yum: name=$item state=removed 4 | with_items: 5 | - ruby 6 | - ruby-libs 7 | 8 | - name: install ruby dependency packages 9 | action: yum name=$item state=installed 10 | with_items: 11 | - gcc 12 | - make 13 | - zlib-devel 14 | - openssl-devel 15 | - readline-devel 16 | - ncurses-devel 17 | - gdbm-devel 18 | - db4-devel 19 | - libffi-devel 20 | - tk-devel 21 | - ${libyaml-rpm} 22 | - ${libyaml-devel-rpm} 23 | - ${paco-rpm} 24 | 25 | - name: download ruby $ruby_ver archive 26 | get_url: url=$ruby_archive dest=$download_path/ruby-$ruby_ver.tar.gz 27 | 28 | - name: extract ruby archive 29 | command: tar xzf ruby-$ruby_ver.tar.gz chdir=$download_path creates=$download_path/ruby-$ruby_ver 30 | 31 | - name: configure ruby 32 | command: ./configure --prefix=$install_prefix $configure_options chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 33 | 34 | - name: make ruby 35 | command: make chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 36 | 37 | - name: install ruby 38 | command: paco -D make install chdir=$download_path/ruby-$ruby_ver creates=$install_prefix/bin/ruby 39 | 40 | -------------------------------------------------------------------------------- /snippets/virtualenv-mysql-python.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: all 3 | user: root 4 | tasks: 5 | - name: install requirements 6 | yum: name=$item state=installed 7 | with_items: 8 | - gcc 9 | - python-devel 10 | - python-setuptools 11 | - mysql-devel 12 | 13 | - name: install pip 14 | easy_install: name=pip 15 | 16 | - name: install virtualenv 17 | pip: name=virtualenv 18 | 19 | - name: install mysql-python 20 | pip: name=mysql-python virtualenv=/root/python-venv 21 | 22 | - name: virtualenv activate 23 | shell: source ~/python-venv/bin/activate 24 | 25 | - name: install mysql-server 26 | yum: name=mysql-server state=installed 27 | 28 | - name: start mysql 29 | action: service name=mysqld state=started enabled=yes 30 | 31 | - name: set ansible_python_interpreter 32 | set_fact: ansible_python_interpreter="/root/python-venv/bin/python" 33 | 34 | - name: create mysql_python_test database 35 | mysql_db: name=mysql_python_test state=present encoding=utf8 36 | 37 | - name: create mysqlpythontest accounts 38 | mysql_user: name=mysqlpythontest host=$item password=mysqlpythontest priv=mysql_python_test.*:ALL state=present 39 | with_items: 40 | - 127.0.0.1 41 | - localhost 42 | -------------------------------------------------------------------------------- /lokka/spec/lokka-server/lokka_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe command('/usr/bin/mysql -e "show databases" -h localhost -uroot') do 4 | it { should return_stdout /lokka/ } 5 | end 6 | 7 | describe command('/usr/bin/mysql -e "select user from mysql.user" -h localhost -uroot') do 8 | it { should return_stdout /lokka/ } 9 | end 10 | 11 | describe package('git') do 12 | it { should be_installed } 13 | end 14 | 15 | describe package('libxml2-devel') do 16 | it { should be_installed } 17 | end 18 | 19 | describe package('libxslt-devel') do 20 | it { should be_installed } 21 | end 22 | 23 | describe file('/var/apps/lokka') do 24 | it { should be_directory } 25 | it { should be_owned_by 'apache' } 26 | it { should be_grouped_into 'apache' } 27 | end 28 | 29 | describe file('/var/apps/lokka/database.default.yml') do 30 | it { should be_file } 31 | end 32 | 33 | describe package('bundler') do 34 | it { should be_installed.by('gem') } 35 | end 36 | 37 | describe file('/var/apps/lokka/vendor/bundle') do 38 | it { should be_directory } 39 | end 40 | 41 | describe file('/var/apps/lokka/Gemfile.lock') do 42 | it { should be_file } 43 | end 44 | 45 | describe file('/etc/httpd/conf.d/lokka.conf') do 46 | it { should be_file } 47 | it { should contain "ServerName lokka" } 48 | it { should contain "" } 49 | end 50 | -------------------------------------------------------------------------------- /mysql5.6/spec/mysql-server/mysql_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe command('ls -l /usr/local/src/') do 4 | it { should return_stdout /MySQL-client/ } 5 | it { should return_stdout /MySQL-devel/ } 6 | it { should return_stdout /MySQL-server/ } 7 | it { should return_stdout /MySQL-shared/ } 8 | it { should return_stdout /MySQL-shared-compat/ } 9 | end 10 | 11 | describe package('MySQL-client') do 12 | it { should be_installed } 13 | end 14 | 15 | describe package('MySQL-devel') do 16 | it { should be_installed } 17 | end 18 | 19 | describe package('MySQL-server') do 20 | it { should be_installed } 21 | end 22 | 23 | describe package('MySQL-shared') do 24 | it { should be_installed } 25 | end 26 | 27 | describe package('MySQL-shared-compat') do 28 | it { should be_installed } 29 | end 30 | 31 | describe package('MySQL-python') do 32 | it { should be_installed } 33 | end 34 | 35 | describe service('mysql') do 36 | it { should be_enabled } 37 | it { should be_running } 38 | end 39 | 40 | describe port(3306) do 41 | it { should be_listening } 42 | end 43 | 44 | describe file('/root/.mysql_secret') do 45 | it { should_not be_file } 46 | end 47 | 48 | describe file('/usr/my.cnf') do 49 | it { should be_file } 50 | end 51 | 52 | describe iptables do 53 | it { should have_rule('-A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT') } 54 | end 55 | -------------------------------------------------------------------------------- /gitlab/roles/gitlab/templates/gitlab-shell-config.yml.j2: -------------------------------------------------------------------------------- 1 | # GitLab user. git by default 2 | user: {{ gitlab_user }} 3 | 4 | # Url to gitlab instance. Used for api calls. Should end with a slash. 5 | gitlab_url: "http://{{ gitlab_host }}/" 6 | 7 | http_settings: 8 | # user: someone 9 | # password: somepass 10 | # ca_file: /etc/ssl/cert.pem 11 | # ca_path: /etc/pki/tls/certs 12 | self_signed_cert: false 13 | 14 | # Repositories path 15 | # Give the canonicalized absolute pathname, 16 | # REPOS_PATH MUST NOT CONTAIN ANY SYMLINK!!! 17 | # Check twice that none of the components is a symlink, including "/home". 18 | repos_path: "/home/{{ gitlab_user }}/repositories" 19 | 20 | # File used as authorized_keys for gitlab user 21 | auth_file: "/home/{{ gitlab_user }}/.ssh/authorized_keys" 22 | 23 | # Redis settings used for pushing commit notices to gitlab 24 | redis: 25 | bin: /usr/bin/redis-cli 26 | host: 127.0.0.1 27 | port: 6379 28 | # socket: /tmp/redis.socket # Only define this if you want to use sockets 29 | namespace: resque:gitlab 30 | 31 | # Log file. 32 | # Default is gitlab-shell.log in the root directory. 33 | # log_file: "/home/git/gitlab-shell/gitlab-shell.log" 34 | 35 | # Log level. INFO by default 36 | log_level: INFO 37 | 38 | # Audit usernames. 39 | # Set to true to see real usernames in the logs instead of key ids, which is easier to follow, but 40 | # incurs an extra API call on every gitlab-shell command. 41 | audit_usernames: false 42 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/gitlab/templates/gitlab-shell-config.yml.j2: -------------------------------------------------------------------------------- 1 | # GitLab user. git by default 2 | user: {{ gitlab_user }} 3 | 4 | # Url to gitlab instance. Used for api calls. Should end with a slash. 5 | gitlab_url: "http://{{ gitlab_host }}/" 6 | 7 | http_settings: 8 | # user: someone 9 | # password: somepass 10 | # ca_file: /etc/ssl/cert.pem 11 | # ca_path: /etc/pki/tls/certs 12 | self_signed_cert: false 13 | 14 | # Repositories path 15 | # Give the canonicalized absolute pathname, 16 | # REPOS_PATH MUST NOT CONTAIN ANY SYMLINK!!! 17 | # Check twice that none of the components is a symlink, including "/home". 18 | repos_path: "/home/{{ gitlab_user }}/repositories" 19 | 20 | # File used as authorized_keys for gitlab user 21 | auth_file: "/home/{{ gitlab_user }}/.ssh/authorized_keys" 22 | 23 | # Redis settings used for pushing commit notices to gitlab 24 | redis: 25 | bin: /usr/bin/redis-cli 26 | host: 127.0.0.1 27 | port: 6379 28 | # socket: /tmp/redis.socket # Only define this if you want to use sockets 29 | namespace: resque:gitlab 30 | 31 | # Log file. 32 | # Default is gitlab-shell.log in the root directory. 33 | # log_file: "/home/git/gitlab-shell/gitlab-shell.log" 34 | 35 | # Log level. INFO by default 36 | log_level: INFO 37 | 38 | # Audit usernames. 39 | # Set to true to see real usernames in the logs instead of key ids, which is easier to follow, but 40 | # incurs an extra API call on every gitlab-shell command. 41 | audit_usernames: false 42 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/gitlab/templates/nginx_gitlab.j2: -------------------------------------------------------------------------------- 1 | # GITLAB 2 | # Maintainer: @randx 3 | # App Version: 5.0 4 | 5 | upstream gitlab { 6 | server unix:/home/git/gitlab/tmp/sockets/gitlab.socket; 7 | } 8 | 9 | server { 10 | listen *:80 default_server; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea 11 | server_name {{ gitlab_host }}; # e.g., server_name source.example.com; 12 | server_tokens off; # don't show the version number, a security best practice 13 | root /home/git/gitlab/public; 14 | 15 | # individual nginx logs for this gitlab vhost 16 | access_log /var/log/nginx/gitlab_access.log; 17 | error_log /var/log/nginx/gitlab_error.log; 18 | 19 | location / { 20 | # serve static files from defined root folder;. 21 | # @gitlab is a named location for the upstream fallback, see below 22 | try_files $uri $uri/index.html $uri.html @gitlab; 23 | } 24 | 25 | # if a file, which is not found in the root folder is requested, 26 | # then the proxy pass the request to the upsteam (gitlab unicorn) 27 | location @gitlab { 28 | proxy_read_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694 29 | proxy_connect_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694 30 | proxy_redirect off; 31 | 32 | proxy_set_header X-Forwarded-Proto $scheme; 33 | proxy_set_header Host $http_host; 34 | proxy_set_header X-Real-IP $remote_addr; 35 | 36 | proxy_pass http://gitlab; 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /ruby2.0/spec/app-server/ruby_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('ruby') do 4 | it { should_not be_installed } 5 | end 6 | 7 | describe package('ruby-libs') do 8 | it { should_not be_installed } 9 | end 10 | 11 | describe package('gcc') do 12 | it { should be_installed } 13 | end 14 | 15 | describe package('make') do 16 | it { should be_installed } 17 | end 18 | 19 | describe package('zlib-devel') do 20 | it { should be_installed } 21 | end 22 | 23 | describe package('openssl-devel') do 24 | it { should be_installed } 25 | end 26 | 27 | describe package('readline-devel') do 28 | it { should be_installed } 29 | end 30 | 31 | describe package('ncurses-devel') do 32 | it { should be_installed } 33 | end 34 | 35 | describe package('gdbm-devel') do 36 | it { should be_installed } 37 | end 38 | 39 | describe package('db4-devel') do 40 | it { should be_installed } 41 | end 42 | 43 | describe package('tk-devel') do 44 | it { should be_installed } 45 | end 46 | 47 | describe package('libyaml') do 48 | it { should be_installed } 49 | end 50 | 51 | describe package('libyaml-devel') do 52 | it { should be_installed } 53 | end 54 | 55 | describe command('paco -a') do 56 | it { should return_stdout /ruby-2\.0\.0/ } 57 | end 58 | 59 | describe file('/usr/bin/ruby') do 60 | it { should be_file } 61 | it { should be_mode 755 } 62 | it { should be_owned_by 'root' } 63 | end 64 | 65 | describe file('/usr/bin/gem') do 66 | it { should be_file } 67 | it { should be_mode 755 } 68 | it { should be_owned_by 'root' } 69 | end 70 | -------------------------------------------------------------------------------- /redmine/spec/redmine-server/redmine_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe command('/usr/bin/mysql -e "show databases" -h localhost -uroot') do 4 | it { should return_stdout /redmine/ } 5 | end 6 | 7 | describe command('/usr/bin/mysql -e "select user from mysql.user" -h localhost -uroot') do 8 | it { should return_stdout /redmine/ } 9 | end 10 | 11 | describe package('libxml2-devel') do 12 | it { should be_installed } 13 | end 14 | 15 | describe package('libxslt-devel') do 16 | it { should be_installed } 17 | end 18 | 19 | describe package('ImageMagick') do 20 | it { should be_installed } 21 | end 22 | 23 | describe package('ImageMagick-devel') do 24 | it { should be_installed } 25 | end 26 | 27 | describe command('ls -l /usr/local/src') do 28 | it { should return_stdout /redmine.*\.tar\.gz/} 29 | end 30 | 31 | describe file('/var/apps/redmine') do 32 | it { should be_directory } 33 | it { should be_owned_by 'apache' } 34 | it { should be_grouped_into 'apache' } 35 | end 36 | 37 | describe file('/var/apps/redmine/config/database.yml') do 38 | it { should be_file } 39 | end 40 | 41 | describe package('bundler') do 42 | it { should be_installed.by('gem') } 43 | end 44 | 45 | describe file('/var/apps/redmine/vendor/bundle') do 46 | it { should be_directory } 47 | end 48 | 49 | describe file('/var/apps/redmine/Gemfile.lock') do 50 | it { should be_file } 51 | end 52 | 53 | describe file('/etc/httpd/conf.d/redmine.conf') do 54 | it { should be_file } 55 | it { should contain "ServerName redmine" } 56 | it { should contain "" } 57 | end 58 | -------------------------------------------------------------------------------- /lokka/spec/lokka-server/ruby_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('ruby') do 4 | it { should_not be_installed } 5 | end 6 | 7 | describe package('ruby-libs') do 8 | it { should_not be_installed } 9 | end 10 | 11 | describe package('gcc') do 12 | it { should be_installed } 13 | end 14 | 15 | describe package('make') do 16 | it { should be_installed } 17 | end 18 | 19 | describe package('zlib-devel') do 20 | it { should be_installed } 21 | end 22 | 23 | describe package('openssl-devel') do 24 | it { should be_installed } 25 | end 26 | 27 | describe package('readline-devel') do 28 | it { should be_installed } 29 | end 30 | 31 | describe package('ncurses-devel') do 32 | it { should be_installed } 33 | end 34 | 35 | describe package('gdbm-devel') do 36 | it { should be_installed } 37 | end 38 | 39 | describe package('db4-devel') do 40 | it { should be_installed } 41 | end 42 | 43 | describe package('tk-devel') do 44 | it { should be_installed } 45 | end 46 | 47 | describe package('libyaml') do 48 | it { should be_installed } 49 | end 50 | 51 | describe package('libyaml-devel') do 52 | it { should be_installed } 53 | end 54 | 55 | describe package('paco') do 56 | it { should be_installed } 57 | end 58 | 59 | describe command('paco -a') do 60 | it { should return_stdout /ruby-2\.0\.0/ } 61 | end 62 | 63 | describe file('/usr/bin/ruby') do 64 | it { should be_file } 65 | it { should be_mode 755 } 66 | it { should be_owned_by 'root' } 67 | end 68 | 69 | describe file('/usr/bin/gem') do 70 | it { should be_file } 71 | it { should be_mode 755 } 72 | it { should be_owned_by 'root' } 73 | end 74 | -------------------------------------------------------------------------------- /gitlab/spec/gitlab-server/ruby_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('ruby') do 4 | it { should_not be_installed } 5 | end 6 | 7 | describe package('ruby-libs') do 8 | it { should_not be_installed } 9 | end 10 | 11 | describe package('gcc') do 12 | it { should be_installed } 13 | end 14 | 15 | describe package('make') do 16 | it { should be_installed } 17 | end 18 | 19 | describe package('zlib-devel') do 20 | it { should be_installed } 21 | end 22 | 23 | describe package('openssl-devel') do 24 | it { should be_installed } 25 | end 26 | 27 | describe package('readline-devel') do 28 | it { should be_installed } 29 | end 30 | 31 | describe package('ncurses-devel') do 32 | it { should be_installed } 33 | end 34 | 35 | describe package('gdbm-devel') do 36 | it { should be_installed } 37 | end 38 | 39 | describe package('db4-devel') do 40 | it { should be_installed } 41 | end 42 | 43 | describe package('tk-devel') do 44 | it { should be_installed } 45 | end 46 | 47 | describe package('libyaml') do 48 | it { should be_installed } 49 | end 50 | 51 | describe package('libyaml-devel') do 52 | it { should be_installed } 53 | end 54 | 55 | describe package('paco') do 56 | it { should be_installed } 57 | end 58 | 59 | describe command('paco -a') do 60 | it { should return_stdout /ruby-2\.0\.0/ } 61 | end 62 | 63 | describe file('/usr/bin/ruby') do 64 | it { should be_file } 65 | it { should be_mode 755 } 66 | it { should be_owned_by 'root' } 67 | end 68 | 69 | describe file('/usr/bin/gem') do 70 | it { should be_file } 71 | it { should be_mode 755 } 72 | it { should be_owned_by 'root' } 73 | end 74 | -------------------------------------------------------------------------------- /redmine/spec/redmine-server/ruby_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('ruby') do 4 | it { should_not be_installed } 5 | end 6 | 7 | describe package('ruby-libs') do 8 | it { should_not be_installed } 9 | end 10 | 11 | describe package('gcc') do 12 | it { should be_installed } 13 | end 14 | 15 | describe package('make') do 16 | it { should be_installed } 17 | end 18 | 19 | describe package('zlib-devel') do 20 | it { should be_installed } 21 | end 22 | 23 | describe package('openssl-devel') do 24 | it { should be_installed } 25 | end 26 | 27 | describe package('readline-devel') do 28 | it { should be_installed } 29 | end 30 | 31 | describe package('ncurses-devel') do 32 | it { should be_installed } 33 | end 34 | 35 | describe package('gdbm-devel') do 36 | it { should be_installed } 37 | end 38 | 39 | describe package('db4-devel') do 40 | it { should be_installed } 41 | end 42 | 43 | describe package('tk-devel') do 44 | it { should be_installed } 45 | end 46 | 47 | describe package('libyaml') do 48 | it { should be_installed } 49 | end 50 | 51 | describe package('libyaml-devel') do 52 | it { should be_installed } 53 | end 54 | 55 | describe package('paco') do 56 | it { should be_installed } 57 | end 58 | 59 | describe command('paco -a') do 60 | it { should return_stdout /ruby-2\.0\.0/ } 61 | end 62 | 63 | describe file('/usr/bin/ruby') do 64 | it { should be_file } 65 | it { should be_mode 755 } 66 | it { should be_owned_by 'root' } 67 | end 68 | 69 | describe file('/usr/bin/gem') do 70 | it { should be_file } 71 | it { should be_mode 755 } 72 | it { should be_owned_by 'root' } 73 | end 74 | -------------------------------------------------------------------------------- /gitlab-unicorn/spec/gitlab-server/ruby_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('ruby') do 4 | it { should_not be_installed } 5 | end 6 | 7 | describe package('ruby-libs') do 8 | it { should_not be_installed } 9 | end 10 | 11 | describe package('gcc') do 12 | it { should be_installed } 13 | end 14 | 15 | describe package('make') do 16 | it { should be_installed } 17 | end 18 | 19 | describe package('zlib-devel') do 20 | it { should be_installed } 21 | end 22 | 23 | describe package('openssl-devel') do 24 | it { should be_installed } 25 | end 26 | 27 | describe package('readline-devel') do 28 | it { should be_installed } 29 | end 30 | 31 | describe package('ncurses-devel') do 32 | it { should be_installed } 33 | end 34 | 35 | describe package('gdbm-devel') do 36 | it { should be_installed } 37 | end 38 | 39 | describe package('db4-devel') do 40 | it { should be_installed } 41 | end 42 | 43 | describe package('tk-devel') do 44 | it { should be_installed } 45 | end 46 | 47 | describe package('libyaml') do 48 | it { should be_installed } 49 | end 50 | 51 | describe package('libyaml-devel') do 52 | it { should be_installed } 53 | end 54 | 55 | describe package('paco') do 56 | it { should be_installed } 57 | end 58 | 59 | describe command('paco -a') do 60 | it { should return_stdout /ruby-2\.0\.0/ } 61 | end 62 | 63 | describe file('/usr/bin/ruby') do 64 | it { should be_file } 65 | it { should be_mode 755 } 66 | it { should be_owned_by 'root' } 67 | end 68 | 69 | describe file('/usr/bin/gem') do 70 | it { should be_file } 71 | it { should be_mode 755 } 72 | it { should be_owned_by 'root' } 73 | end 74 | -------------------------------------------------------------------------------- /webistrano/spec/webistrano-server/ruby_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe package('ruby') do 4 | it { should_not be_installed } 5 | end 6 | 7 | describe package('ruby-libs') do 8 | it { should_not be_installed } 9 | end 10 | 11 | describe package('gcc') do 12 | it { should be_installed } 13 | end 14 | 15 | describe package('make') do 16 | it { should be_installed } 17 | end 18 | 19 | describe package('zlib-devel') do 20 | it { should be_installed } 21 | end 22 | 23 | describe package('openssl-devel') do 24 | it { should be_installed } 25 | end 26 | 27 | describe package('readline-devel') do 28 | it { should be_installed } 29 | end 30 | 31 | describe package('ncurses-devel') do 32 | it { should be_installed } 33 | end 34 | 35 | describe package('gdbm-devel') do 36 | it { should be_installed } 37 | end 38 | 39 | describe package('db4-devel') do 40 | it { should be_installed } 41 | end 42 | 43 | describe package('tk-devel') do 44 | it { should be_installed } 45 | end 46 | 47 | describe package('libyaml') do 48 | it { should be_installed } 49 | end 50 | 51 | describe package('libyaml-devel') do 52 | it { should be_installed } 53 | end 54 | 55 | describe package('paco') do 56 | it { should be_installed } 57 | end 58 | 59 | describe command('paco -a') do 60 | it { should return_stdout /ruby-2\.0\.0/ } 61 | end 62 | 63 | describe file('/usr/bin/ruby') do 64 | it { should be_file } 65 | it { should be_mode 755 } 66 | it { should be_owned_by 'root' } 67 | end 68 | 69 | describe file('/usr/bin/gem') do 70 | it { should be_file } 71 | it { should be_mode 755 } 72 | it { should be_owned_by 'root' } 73 | end 74 | -------------------------------------------------------------------------------- /webistrano/spec/webistrano-server/webistrano_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe command('/usr/bin/mysql -e "show databases" -h localhost -uroot') do 4 | it { should return_stdout /webistrano/ } 5 | end 6 | 7 | describe command('/usr/bin/mysql -e "select user from mysql.user" -h localhost -uroot') do 8 | it { should return_stdout /webistrano/ } 9 | end 10 | 11 | describe package('git') do 12 | it { should be_installed } 13 | end 14 | 15 | describe package('sqlite-devel') do 16 | it { should be_installed } 17 | end 18 | 19 | describe file('/var/apps/webistrano') do 20 | it { should be_directory } 21 | it { should be_owned_by 'apache' } 22 | it { should be_grouped_into 'apache' } 23 | end 24 | 25 | describe command('cd /var/apps/webistrano; /usr/bin/git branch') do 26 | it { should return_stdout /rails3/ } 27 | end 28 | 29 | describe file('/var/apps/webistrano/Gemfile') do 30 | it { should be_file } 31 | end 32 | 33 | describe file('/var/apps/webistrano/config/webistrano_config.rb') do 34 | it { should be_file } 35 | end 36 | 37 | describe file('/var/apps/webistrano/config/database.yml') do 38 | it { should be_file } 39 | end 40 | 41 | describe package('bundler') do 42 | it { should be_installed.by('gem') } 43 | end 44 | 45 | describe file('/var/apps/webistrano/vendor/bundle') do 46 | it { should be_directory } 47 | end 48 | 49 | describe file('/var/apps/webistrano/Gemfile.lock') do 50 | it { should be_file } 51 | end 52 | 53 | describe file('/etc/httpd/conf.d/webistrano.conf') do 54 | it { should be_file } 55 | it { should contain "ServerName webistrano" } 56 | it { should contain "" } 57 | end 58 | -------------------------------------------------------------------------------- /lokka/roles/lokka/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: create lokka database 3 | mysql_db: name=lokka state=present encoding=utf8 4 | 5 | - name: create lokka accounts 6 | mysql_user: name=${lokka_mysql_user} host=$item password=${lokka_mysql_password} priv=lokka.*:ALL state=present 7 | with_items: 8 | - 127.0.0.1 9 | - localhost 10 | 11 | - name: install lokka dependency packages 12 | action: yum name=$item state=installed 13 | with_items: 14 | - git 15 | - libxml2-devel 16 | - libxslt-devel 17 | 18 | - name: create $deploy_dir directory 19 | command: mkdir -p $deploy_dir creates=$deploy_dir 20 | 21 | - name: clone lokka repository 22 | git: repo=${lokka_repo} dest=${deploy_dir}/lokka 23 | 24 | - name: copy database.default.yml file 25 | template: src=database.default.yml.j2 dest=$deploy_dir/lokka/database.default.yml 26 | 27 | - name: copy config.ru file 28 | template: src=config.ru dest=$deploy_dir/lokka/config.ru 29 | 30 | - name: install bundler gem 31 | gem: name=bundler state=latest 32 | 33 | - name: install bundle gems 34 | command: bundle install --without=development:test:postgresql:sqlite --path=vendor/bundle --quiet chdir=$deploy_dir/lokka 35 | 36 | - name: setup lokka 37 | shell: RACK_ENV=production bundle exec rake db:setup chdir=$deploy_dir/lokka 38 | ignore_errors: true 39 | register: lokka_setup_result 40 | 41 | - name: retry rake db:seed 42 | shell: RACK_ENV=production bundle exec rake db:seed chdir=$deploy_dir/lokka 43 | when: lokka_setup_result.rc != 0 44 | 45 | - name: change the permissions of $deploy_dir/lokka 46 | command: chown -R apache:apache $deploy_dir/lokka 47 | 48 | - name: copy lokka.conf file 49 | template: src=lokka.conf dest=/etc/httpd/conf.d/lokka.conf 50 | notify: restart httpd 51 | -------------------------------------------------------------------------------- /webistrano/roles/webistrano/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: create webistrano database 3 | mysql_db: name=webistrano state=present encoding=utf8 4 | 5 | - name: create webistrano accounts 6 | mysql_user: name=webistrano host=$item password=${webistrano_mysql_password} priv=webistrano.*:ALL state=present 7 | with_items: 8 | - 127.0.0.1 9 | - localhost 10 | 11 | - name: install webistrano dependency packages 12 | action: yum name=$item state=installed 13 | with_items: 14 | - git 15 | - sqlite-devel 16 | 17 | - name: create $deploy_dir directory 18 | command: mkdir -p $deploy_dir creates=$deploy_dir 19 | 20 | - name: clone waka/webistrano repository 21 | git: repo=${webistrano_repo} dest=${deploy_dir}/webistrano 22 | 23 | - name: checkout branch webistrano ${webistrano_branch} 24 | command: git checkout ${webistrano_branch} chdir=${deploy_dir}/webistrano 25 | 26 | - name: copy Gemfile 27 | template: src=Gemfile.j2 dest=$deploy_dir/webistrano/Gemfile 28 | 29 | - name: copy webistrano_config.rb file 30 | template: src=webistrano_config.rb.j2 dest=$deploy_dir/webistrano/config/webistrano_config.rb 31 | 32 | - name: copy database.yml file 33 | template: src=database.yml.j2 dest=$deploy_dir/webistrano/config/database.yml 34 | 35 | - name: install bundler gem 36 | gem: name=bundler state=latest 37 | 38 | - name: install bundle gems 39 | command: bundle install --path=vendor/bundle --quiet chdir=$deploy_dir/webistrano 40 | 41 | - name: setup webistrano 42 | shell: RAILS_ENV=production bundle exec rake db:setup assets:precompile chdir=$deploy_dir/webistrano 43 | 44 | - name: change the permissions of $deploy_dir/webistrano 45 | command: chown -R apache:apache $deploy_dir/webistrano 46 | 47 | - name: copy webistrano.conf file 48 | template: src=webistrano.conf dest=/etc/httpd/conf.d/webistrano.conf 49 | notify: restart httpd 50 | -------------------------------------------------------------------------------- /redmine/roles/redmine/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: create redmine database 3 | mysql_db: name=redmine state=present encoding=utf8 4 | 5 | - name: create redmine accounts 6 | mysql_user: name=redmine host=$item password=${redmine_mysql_password} priv=redmine.*:ALL state=present 7 | with_items: 8 | - 127.0.0.1 9 | - localhost 10 | 11 | - name: install redmine dependency packages 12 | action: yum name=$item state=installed 13 | with_items: 14 | - libxml2-devel 15 | - libxslt-devel 16 | - ImageMagick 17 | - ImageMagick-devel 18 | 19 | - name: download redmine $redmine_ver archive 20 | get_url: url=$redmine_archive dest=$download_path/redmine-$redmine_ver.tar.gz 21 | 22 | - name: extract redmine archive 23 | command: tar xzf redmine-$redmine_ver.tar.gz chdir=$download_path creates=$download_path/redmine-$redmine_ver 24 | 25 | - name: create $deploy_dir directory 26 | command: mkdir -p $deploy_dir creates=$deploy_dir 27 | 28 | - name: move redmine to $deploy_dir/redmine 29 | command: mv redmine-$redmine_ver $deploy_dir/redmine chdir=$download_path creates=$deploy_dir/redmine 30 | 31 | - name: copy database.yml file 32 | template: src=database.yml.j2 dest=$deploy_dir/redmine/config/database.yml 33 | 34 | - name: install bundler gem 35 | gem: name=bundler state=latest 36 | 37 | - name: install bundle gems 38 | command: bundle install --path=vendor/bundle --quiet chdir=$deploy_dir/redmine 39 | 40 | - name: generate secret token 41 | command: bundle exec rake generate_secret_token chdir=$deploy_dir/redmine 42 | 43 | - name: setup redmine 44 | shell: RAILS_ENV=production REDMINE_LANG=ja bundle exec rake db:create db:migrate assets:precompile redmine:load_default_data chdir=$deploy_dir/redmine 45 | 46 | - name: change the permissions of $deploy_dir/redmine 47 | command: chown -R apache:apache $deploy_dir/redmine 48 | 49 | - name: copy redmine.conf file 50 | template: src=redmine.conf dest=/etc/httpd/conf.d/redmine.conf 51 | notify: restart httpd 52 | -------------------------------------------------------------------------------- /mysql5.6/roles/mysql/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: download mysql rpms 3 | get_url: url={{ mysql_url }}/$item dest={{ rpm_download_dir }}/$item 4 | with_items: mysql_rpms 5 | 6 | - name: install mysql rpms 7 | yum: name=$item state=installed 8 | with_items: 9 | - "{{ rpm_download_dir }}/{{ mysql_rpms[0] }}" 10 | - "{{ rpm_download_dir }}/{{ mysql_rpms[1] }}" 11 | - "{{ rpm_download_dir }}/{{ mysql_rpms[2] }}" 12 | - "{{ rpm_download_dir }}/{{ mysql_rpms[3] }}" 13 | - "{{ rpm_download_dir }}/{{ mysql_rpms[4] }}" 14 | 15 | - name: install MySQL-python module 16 | yum: name=MySQL-python state=installed 17 | 18 | - name: start mysql 19 | service: name=mysql state=started enabled=true 20 | 21 | - name: check if .mysql_secret exists 22 | shell: test -e /root/.mysql_secret 23 | register: mysql_secret_exists 24 | ignore_errors: True 25 | 26 | - debug: msg="mysql_secret_exists [{{ mysql_secret_exists.rc }}]" 27 | 28 | - name: get mysql initial password 29 | shell: cat /root/.mysql_secret | awk '{print $18}' 30 | register: mysql_default_password 31 | when: mysql_secret_exists.rc == 0 32 | 33 | - debug: msg="mysql default root password is [{{ mysql_default_password.stdout }}]" 34 | 35 | - name: change mysql root password 36 | command: /usr/bin/mysqladmin -u root -p{{ mysql_default_password.stdout }} password "{{ mysql_root_password }}" 37 | when: mysql_secret_exists.rc == 0 38 | 39 | - name: delete .mysql_secret 40 | command: rm /root/.mysql_secret 41 | when: mysql_secret_exists.rc == 0 42 | 43 | - name: copy .my.cnf file with root password credentials 44 | template: src=.my.cnf.j2 dest=/root/.my.cnf owner=root mode=0600 45 | 46 | - name: update mysql root password for all root accounts 47 | mysql_user: name=root host=$item 48 | with_items: 49 | - 127.0.0.1 50 | - ::1 51 | - localhost 52 | 53 | - name: delete anonymous MySQL server user 54 | action: mysql_user user="" state="absent" 55 | 56 | - name: remove the MySQL test database 57 | action: mysql_db db=test state=absent 58 | 59 | - name: create mysql configuration file /usr/my.cnf 60 | action: template src=my.cnf.j2 dest=/usr/my.cnf owner=root mode=0600 61 | notify: restart mysql 62 | 63 | - name: insert iptables rule 64 | lineinfile: dest=/etc/sysconfig/iptables state=present regexp="{{ mysql_port }}" 65 | insertafter="^:OUTPUT " line="-A INPUT -p tcp --dport {{ mysql_port }} -j ACCEPT" 66 | notify: restart iptables 67 | -------------------------------------------------------------------------------- /gitlab-unicorn/spec/gitlab-server/gitlab_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe command('/usr/bin/mysql -e "show databases" -h localhost -uroot') do 4 | it { should return_stdout /gitlabhq_production/ } 5 | end 6 | 7 | describe command('/usr/bin/mysql -e "select user from mysql.user" -h localhost -uroot') do 8 | it { should return_stdout /gitlab/ } 9 | end 10 | 11 | describe package('patch') do 12 | it { should be_installed } 13 | end 14 | 15 | describe package('libxml2-devel') do 16 | it { should be_installed } 17 | end 18 | 19 | describe package('libxslt-devel') do 20 | it { should be_installed } 21 | end 22 | 23 | describe package('libicu-devel') do 24 | it { should be_installed } 25 | end 26 | 27 | describe file('/home/git') do 28 | it { should be_directory } 29 | it { should be_owned_by 'git' } 30 | it { should be_grouped_into 'git' } 31 | it { should be_mode 710 } 32 | end 33 | 34 | describe file('/home/git/gitlab-shell') do 35 | it { should be_directory } 36 | it { should be_owned_by 'git' } 37 | it { should be_grouped_into 'git' } 38 | it { should be_mode 755 } 39 | end 40 | 41 | describe file('/home/git/gitlab') do 42 | it { should be_directory } 43 | it { should be_owned_by 'git' } 44 | it { should be_grouped_into 'git' } 45 | it { should be_mode 755 } 46 | end 47 | 48 | describe file('/home/git/repositories') do 49 | it { should be_directory } 50 | it { should be_owned_by 'git' } 51 | it { should be_grouped_into 'git' } 52 | it { should be_mode 2770 } 53 | end 54 | 55 | describe file('/home/git/gitlab/config/gitlab.yml') do 56 | it { should be_file } 57 | it { should be_owned_by 'git' } 58 | end 59 | 60 | describe file('/home/git/gitlab/config/database.yml') do 61 | it { should be_file } 62 | it { should be_owned_by 'git' } 63 | end 64 | 65 | describe file('/home/git/gitlab/tmp/pids') do 66 | it { should be_directory } 67 | it { should be_owned_by 'git' } 68 | it { should be_grouped_into 'git' } 69 | end 70 | 71 | describe package('bundler') do 72 | it { should be_installed.by('gem') } 73 | end 74 | 75 | describe file('/home/git/gitlab/vendor/bundle') do 76 | it { should be_directory } 77 | end 78 | 79 | describe file('/home/git/gitlab/Gemfile.lock') do 80 | it { should be_file } 81 | end 82 | 83 | describe file('/etc/init.d/gitlab') do 84 | it { should be_file } 85 | it { should be_owned_by 'root' } 86 | it { should be_grouped_into 'root' } 87 | it { should be_mode 755 } 88 | end 89 | 90 | describe service('gitlab') do 91 | it { should be_enabled } 92 | it { should be_running } 93 | end 94 | -------------------------------------------------------------------------------- /gitlab/spec/gitlab-server/gitlab_spec.rb: -------------------------------------------------------------------------------- 1 | require 'spec_helper' 2 | 3 | describe command('/usr/bin/mysql -e "show databases" -h localhost -uroot') do 4 | it { should return_stdout /gitlabhq_production/ } 5 | end 6 | 7 | describe command('/usr/bin/mysql -e "select user from mysql.user" -h localhost -uroot') do 8 | it { should return_stdout /gitlab/ } 9 | end 10 | 11 | describe package('patch') do 12 | it { should be_installed } 13 | end 14 | 15 | describe package('libxml2-devel') do 16 | it { should be_installed } 17 | end 18 | 19 | describe package('libxslt-devel') do 20 | it { should be_installed } 21 | end 22 | 23 | describe package('libicu-devel') do 24 | it { should be_installed } 25 | end 26 | 27 | describe file('/home/git') do 28 | it { should be_directory } 29 | it { should be_owned_by 'git' } 30 | it { should be_grouped_into 'git' } 31 | it { should be_mode 750 } 32 | end 33 | 34 | describe file('/home/git/gitlab-shell') do 35 | it { should be_directory } 36 | it { should be_owned_by 'git' } 37 | it { should be_grouped_into 'git' } 38 | it { should be_mode 755 } 39 | end 40 | 41 | describe file('/home/git/gitlab') do 42 | it { should be_directory } 43 | it { should be_owned_by 'git' } 44 | it { should be_grouped_into 'git' } 45 | it { should be_mode 755 } 46 | end 47 | 48 | describe file('/home/git/repositories') do 49 | it { should be_directory } 50 | it { should be_owned_by 'git' } 51 | it { should be_grouped_into 'git' } 52 | it { should be_mode 2770 } 53 | end 54 | 55 | describe file('/home/git/gitlab/config/gitlab.yml') do 56 | it { should be_file } 57 | it { should be_owned_by 'git' } 58 | end 59 | 60 | describe file('/home/git/gitlab/config/database.yml') do 61 | it { should be_file } 62 | it { should be_owned_by 'git' } 63 | end 64 | 65 | describe file('/home/git/gitlab/tmp/pids') do 66 | it { should be_directory } 67 | it { should be_owned_by 'git' } 68 | it { should be_grouped_into 'git' } 69 | end 70 | 71 | describe package('bundler') do 72 | it { should be_installed.by('gem') } 73 | end 74 | 75 | describe file('/home/git/gitlab/vendor/bundle') do 76 | it { should be_directory } 77 | end 78 | 79 | describe file('/home/git/gitlab/Gemfile.lock') do 80 | it { should be_file } 81 | end 82 | 83 | describe file('/etc/init.d/sidekiq') do 84 | it { should be_file } 85 | it { should be_owned_by 'root' } 86 | it { should be_grouped_into 'root' } 87 | it { should be_mode 755 } 88 | end 89 | 90 | describe service('sidekiq') do 91 | it { should be_enabled } 92 | it { should be_running } 93 | end 94 | 95 | describe file('/etc/httpd/conf.d/gitlab.conf') do 96 | it { should be_file } 97 | it { should contain "ServerName gitlab" } 98 | it { should contain "" } 99 | end 100 | -------------------------------------------------------------------------------- /gitlab/roles/gitlab/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install bundler gem 3 | gem: name=bundler state=latest 4 | 5 | - name: install GitLab dependency packages 6 | action: yum name=$item state=installed 7 | with_items: 8 | - gcc-c++ 9 | - patch 10 | - libxml2-devel 11 | - libxslt-devel 12 | - libicu-devel 13 | - python-docutils 14 | - MySQL-python 15 | 16 | - name: create GitLab user 17 | user: name=${gitlab_user} comment="GitLab User" state=present 18 | 19 | - name: copy .gitconfig file for GitLab user 20 | template: src=.gitconfig dest=/home/${gitlab_user}/.gitconfig owner=${gitlab_user} 21 | 22 | - name: clone gitlab-shell repository 23 | git: repo=${gitlab_shell_repo} dest=/home/${gitlab_user}/gitlab-shell 24 | 25 | - name: checkout and create branch gitlab-shell v${gitlab_shell_ver} 26 | command: git checkout -B ${gitlab_shell_ver} v${gitlab_shell_ver} chdir=/home/${gitlab_user}/gitlab-shell 27 | 28 | - name: copy gitlab-shell config.yml file 29 | template: src=gitlab-shell-config.yml.j2 dest=/home/${gitlab_user}/gitlab-shell/config.yml owner=git 30 | 31 | - name: install gitlab-shell 32 | shell: ./bin/install chdir=/home/${gitlab_user}/gitlab-shell creates=/home/${gitlab_user}/repositories 33 | 34 | - name: create gitlabhq_production database 35 | mysql_db: name=gitlabhq_production state=present encoding=utf8 36 | 37 | - name: create database account 38 | mysql_user: name=${gitlab_db_user} host=$item password=${gitlab_db_password} priv=gitlabhq_production.*:ALL state=present 39 | with_items: 40 | - ${gitlab_db_host} 41 | - localhost 42 | 43 | - name: clone gitlab repository 44 | git: repo=${gitlab_repo} dest=/home/${gitlab_user}/gitlab version=${gitlab_ver} 45 | 46 | - name: copy gitlab.yml file 47 | template: src=gitlab.yml.j2 dest=/home/${gitlab_user}/gitlab/config/gitlab.yml owner=git 48 | 49 | - name: copy database.yml file 50 | template: src=database.yml.j2 dest=/home/${gitlab_user}/gitlab/config/database.yml 51 | 52 | - name: change permission /home/${gitlab_user}/gitlab/log dir 53 | file: dest=/home/${gitlab_user}/gitlab/log state=directory owner=git mode=2700 54 | 55 | - name: change permission /home/${gitlab_user}/gitlab/tmp dir 56 | file: dest=/home/${gitlab_user}/gitlab/tmp state=directory owner=git mode=0775 57 | 58 | - name: create /home/${gitlab_user}/gitlab/tmp/pids dir 59 | file: dest=/home/${gitlab_user}/gitlab/tmp/pids state=directory owner=git mode=0700 60 | 61 | - name: create /home/${gitlab_user}/gitlab/tmp/sockets dir 62 | file: dest=/home/${gitlab_user}/gitlab/tmp/pids state=directory owner=git mode=0775 63 | 64 | - name: create /home/${gitlab_user}/gitlab/public/uploads dir 65 | file: dest=/home/${gitlab_user}/gitlab/public/uploads state=directory owner=git mode=0700 66 | 67 | - name: copy rack attack config 68 | template: src=rack_attack.rb.j2 dest=/home/${gitlab_user}/gitlab/config/initializers/rack_attack.rb owner=git 69 | 70 | - name: install bundler gem 71 | gem: name=bundler state=latest 72 | 73 | - name: bundle install GitLab gems 74 | command: bundle install --deployment --without development test postgres aws chdir=/home/${gitlab_user}/gitlab 75 | 76 | - name: gitlab setup 77 | shell: /usr/bin/yes "yes" | bundle exec rake gitlab:setup RAILS_ENV=production chdir=/home/${gitlab_user}/gitlab 78 | 79 | - name: change the permissions of /home/${gitlab_user} 80 | command: chown -R ${gitlab_user}:${gitlab_user} /home/${gitlab_user} 81 | 82 | - name: download sidekiq init script 83 | get_url: url=${sidekiq_init_script} dest=/etc/init.d/sidekiq owner=root mode=0755 84 | notify: restart sidekiq 85 | 86 | - name: copy logrotate config 87 | template: src=logrotate.j2 dest=/etc/logrotate.d/gitlab owner=root 88 | 89 | - name: start sidekiq service 90 | service: name=sidekiq state=started enabled=yes 91 | notify: restart sidekiq 92 | 93 | - name: apache user added to git group 94 | command: usermod -G ${gitlab_user} apache 95 | 96 | - name: add write permission to git group 97 | command: chmod g+rX /home/${gitlab_user} 98 | notify: restart httpd 99 | 100 | - name: copy gitlab.conf file 101 | template: src=gitlab.conf dest=/etc/httpd/conf.d/gitlab.conf 102 | notify: restart httpd 103 | 104 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/gitlab/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: install bundler gem 3 | gem: name=bundler state=latest 4 | 5 | - name: install GitLab dependency packages 6 | action: yum name=$item state=installed 7 | with_items: 8 | - gcc-c++ 9 | - patch 10 | - libxml2-devel 11 | - libxslt-devel 12 | - libicu-devel 13 | - python-docutils 14 | - MySQL-python 15 | 16 | - name: create GitLab user 17 | user: name=${gitlab_user} comment="GitLab User" state=present 18 | 19 | - name: copy .gitconfig file for GitLab user 20 | template: src=.gitconfig dest=/home/${gitlab_user}/.gitconfig owner=${gitlab_user} 21 | 22 | - name: clone gitlab-shell repository 23 | git: repo=${gitlab_shell_repo} dest=/home/${gitlab_user}/gitlab-shell 24 | 25 | - name: checkout and create branch gitlab-shell v${gitlab_shell_ver} 26 | command: git checkout -B ${gitlab_shell_ver} v${gitlab_shell_ver} chdir=/home/${gitlab_user}/gitlab-shell 27 | 28 | - name: copy gitlab-shell config.yml file 29 | template: src=gitlab-shell-config.yml.j2 dest=/home/${gitlab_user}/gitlab-shell/config.yml owner=git 30 | 31 | - name: install gitlab-shell 32 | shell: ./bin/install chdir=/home/${gitlab_user}/gitlab-shell creates=/home/${gitlab_user}/repositories 33 | 34 | - name: create gitlabhq_production database 35 | mysql_db: name=gitlabhq_production state=present encoding=utf8 36 | 37 | - name: create database account 38 | mysql_user: name=${gitlab_db_user} host=$item password=${gitlab_db_password} priv=gitlabhq_production.*:ALL state=present 39 | with_items: 40 | - ${gitlab_db_host} 41 | - localhost 42 | 43 | - name: clone gitlab repository 44 | git: repo=${gitlab_repo} dest=/home/${gitlab_user}/gitlab version=${gitlab_ver} 45 | 46 | - name: copy gitlab.yml file 47 | template: src=gitlab.yml.j2 dest=/home/${gitlab_user}/gitlab/config/gitlab.yml owner=git 48 | 49 | - name: copy database.yml file 50 | template: src=database.yml.j2 dest=/home/${gitlab_user}/gitlab/config/database.yml owner=git mode=0660 51 | 52 | - name: change permission /home/${gitlab_user}/gitlab/log dir 53 | file: dest=/home/${gitlab_user}/gitlab/log state=directory owner=git mode=2700 54 | 55 | - name: change permission /home/${gitlab_user}/gitlab/tmp dir 56 | file: dest=/home/${gitlab_user}/gitlab/tmp state=directory owner=git mode=0775 57 | 58 | - name: create /home/${gitlab_user}/gitlab/tmp/pids dir 59 | file: dest=/home/${gitlab_user}/gitlab/tmp/pids state=directory owner=git mode=0700 60 | 61 | - name: create /home/${gitlab_user}/gitlab/tmp/sockets dir 62 | file: dest=/home/${gitlab_user}/gitlab/tmp/pids state=directory owner=git mode=0775 63 | 64 | - name: create /home/${gitlab_user}/gitlab/public/uploads dir 65 | file: dest=/home/${gitlab_user}/gitlab/public/uploads state=directory owner=git mode=0700 66 | 67 | - name: copy unicorn config 68 | template: src=unicorn.rb.j2 dest=/home/${gitlab_user}/gitlab/config/unicorn.rb owner=git 69 | 70 | - name: copy rack attack config 71 | template: src=rack_attack.rb.j2 dest=/home/${gitlab_user}/gitlab/config/initializers/rack_attack.rb owner=git 72 | 73 | - name: install bundler gem 74 | gem: name=bundler state=latest 75 | 76 | - name: bundle install GitLab gems 77 | command: bundle install --deployment --without development test postgres aws chdir=/home/${gitlab_user}/gitlab 78 | 79 | - name: gitlab setup 80 | shell: /usr/bin/yes "yes" | bundle exec rake gitlab:setup RAILS_ENV=production chdir=/home/${gitlab_user}/gitlab 81 | 82 | - name: change the permissions of /home/${gitlab_user} 83 | command: chown -R ${gitlab_user}:${gitlab_user} /home/${gitlab_user} 84 | 85 | - name: download gitlab init script 86 | get_url: url=${gitlab_init_script} dest=/etc/init.d/gitlab owner=root mode=0755 87 | 88 | - name: copy logrotate config 89 | template: src=logrotate.j2 dest=/etc/logrotate.d/gitlab owner=root 90 | 91 | - name: start gitlab service 92 | service: name=gitlab state=started enabled=yes 93 | 94 | - name: nginx user added to git group 95 | command: usermod -G ${gitlab_user} nginx 96 | 97 | - name: add write permission to git group 98 | command: chmod g+x /home/${gitlab_user} 99 | notify: restart nginx 100 | 101 | - name: copy nginx config 102 | template: src=nginx_gitlab.j2 dest=/etc/nginx/conf.d/default.conf owner=root 103 | notify: restart nginx 104 | 105 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/gitlab/templates/unicorn.rb.j2: -------------------------------------------------------------------------------- 1 | # Sample verbose configuration file for Unicorn (not Rack) 2 | # 3 | # This configuration file documents many features of Unicorn 4 | # that may not be needed for some applications. See 5 | # http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb 6 | # for a much simpler configuration file. 7 | # 8 | # See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete 9 | # documentation. 10 | 11 | # Uncomment and customize the last line to run in a non-root path 12 | # WARNING: This feature is known to work, but unsupported 13 | # Note that three settings need to be changed for this to work. 14 | # 1) In your application.rb file: config.relative_url_root = "/gitlab" 15 | # 2) In your gitlab.yml file: relative_url_root: /gitlab 16 | # 3) In your unicorn.rb: ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab" 17 | # 18 | # ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab" 19 | 20 | # Use at least one worker per core if you're on a dedicated server, 21 | # more will usually help for _short_ waits on databases/caches. 22 | worker_processes 2 23 | 24 | # Since Unicorn is never exposed to outside clients, it does not need to 25 | # run on the standard HTTP port (80), there is no reason to start Unicorn 26 | # as root unless it's from system init scripts. 27 | # If running the master process as root and the workers as an unprivileged 28 | # user, do this to switch euid/egid in the workers (also chowns logs): 29 | # user "unprivileged_user", "unprivileged_group" 30 | 31 | # Help ensure your application will always spawn in the symlinked 32 | # "current" directory that Capistrano sets up. 33 | working_directory "/home/git/gitlab" # available in 0.94.0+ 34 | 35 | # listen on both a Unix domain socket and a TCP port, 36 | # we use a shorter backlog for quicker failover when busy 37 | listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 64 38 | listen "127.0.0.1:8080", :tcp_nopush => true 39 | 40 | # nuke workers after 30 seconds instead of 60 seconds (the default) 41 | timeout 30 42 | 43 | # feel free to point this anywhere accessible on the filesystem 44 | pid "/home/git/gitlab/tmp/pids/unicorn.pid" 45 | 46 | # By default, the Unicorn logger will write to stderr. 47 | # Additionally, some applications/frameworks log to stderr or stdout, 48 | # so prevent them from going to /dev/null when daemonized here: 49 | stderr_path "/home/git/gitlab/log/unicorn.stderr.log" 50 | stdout_path "/home/git/gitlab/log/unicorn.stdout.log" 51 | 52 | # combine Ruby 2.0.0dev or REE with "preload_app true" for memory savings 53 | # http://rubyenterpriseedition.com/faq.html#adapt_apps_for_cow 54 | preload_app true 55 | GC.respond_to?(:copy_on_write_friendly=) and 56 | GC.copy_on_write_friendly = true 57 | 58 | # Enable this flag to have unicorn test client connections by writing the 59 | # beginning of the HTTP headers before calling the application. This 60 | # prevents calling the application for connections that have disconnected 61 | # while queued. This is only guaranteed to detect clients on the same 62 | # host unicorn runs on, and unlikely to detect disconnects even on a 63 | # fast LAN. 64 | check_client_connection false 65 | 66 | before_fork do |server, worker| 67 | # the following is highly recomended for Rails + "preload_app true" 68 | # as there's no need for the master process to hold a connection 69 | defined?(ActiveRecord::Base) and 70 | ActiveRecord::Base.connection.disconnect! 71 | 72 | # The following is only recommended for memory/DB-constrained 73 | # installations. It is not needed if your system can house 74 | # twice as many worker_processes as you have configured. 75 | # 76 | # This allows a new master process to incrementally 77 | # phase out the old master process with SIGTTOU to avoid a 78 | # thundering herd (especially in the "preload_app false" case) 79 | # when doing a transparent upgrade. The last worker spawned 80 | # will then kill off the old master process with a SIGQUIT. 81 | old_pid = "#{server.config[:pid]}.oldbin" 82 | if old_pid != server.pid 83 | begin 84 | sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU 85 | Process.kill(sig, File.read(old_pid).to_i) 86 | rescue Errno::ENOENT, Errno::ESRCH 87 | end 88 | end 89 | # 90 | # Throttle the master from forking too quickly by sleeping. Due 91 | # to the implementation of standard Unix signal handlers, this 92 | # helps (but does not completely) prevent identical, repeated signals 93 | # from being lost when the receiving process is busy. 94 | # sleep 1 95 | end 96 | 97 | after_fork do |server, worker| 98 | # per-process listener ports for debugging/admin/migrations 99 | # addr = "127.0.0.1:#{9293 + worker.nr}" 100 | # server.listen(addr, :tries => -1, :delay => 5, :tcp_nopush => true) 101 | 102 | # the following is *required* for Rails + "preload_app true", 103 | defined?(ActiveRecord::Base) and 104 | ActiveRecord::Base.establish_connection 105 | 106 | # if preload_app is true, then you may also want to check and 107 | # restart any other shared sockets/descriptors such as Memcached, 108 | # and Redis. TokyoCabinet file handles are safe to reuse 109 | # between any number of forked children (assuming your kernel 110 | # correctly implements pread()/pwrite() system calls) 111 | end 112 | -------------------------------------------------------------------------------- /gitlab/roles/gitlab/templates/gitlab.yml.j2: -------------------------------------------------------------------------------- 1 | # # # # # # # # # # # # # # # # # # 2 | # GitLab application config file # 3 | # # # # # # # # # # # # # # # # # # 4 | # 5 | # How to use: 6 | # 1. copy file as gitlab.yml 7 | # 2. Replace gitlab -> host with your domain 8 | # 3. Replace gitlab -> email_from 9 | 10 | production: &base 11 | # 12 | # 1. GitLab app settings 13 | # ========================== 14 | 15 | ## GitLab settings 16 | gitlab: 17 | ## Web server settings 18 | host: {{ gitlab_host }} 19 | port: 80 20 | https: false 21 | 22 | # Uncomment and customize the last line to run in a non-root path 23 | # WARNING: This feature is known to work, but unsupported 24 | # Note that three settings need to be changed for this to work. 25 | # 1) In your application.rb file: config.relative_url_root = "/gitlab" 26 | # 2) In your gitlab.yml file: relative_url_root: /gitlab 27 | # 3) In your unicorn.rb: ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab" 28 | # 29 | # relative_url_root: /gitlab 30 | 31 | # Uncomment and customize if you can't use the default user to run GitLab (default: 'git') 32 | user: {{ gitlab_user }} 33 | 34 | ## Email settings 35 | # Email address used in the "From" field in mails sent by GitLab 36 | email_from: gitlab@localhost 37 | 38 | # Email address of your support contact (default: same as email_from) 39 | support_email: support@localhost 40 | 41 | ## User settings 42 | default_projects_limit: 10 43 | # default_can_create_group: false # default: true 44 | # username_changing_enabled: false # default: true - User can change her username/namespace 45 | ## Default theme 46 | ## BASIC = 1 47 | ## MARS = 2 48 | ## MODERN = 3 49 | ## GRAY = 4 50 | ## COLOR = 5 51 | # default_theme: 2 # default: 2 52 | 53 | 54 | ## Users management 55 | # default: false - Account passwords are not sent via the email if signup is enabled. 56 | # signup_enabled: true 57 | 58 | ## Automatic issue closing 59 | # If a commit message matches this regular expression, all issues referenced from the matched text will be closed. 60 | # This happens when the commit is pushed or merged into the default branch of a project. 61 | # When not specified the default issue_closing_pattern as specified below will be used. 62 | # issue_closing_pattern: ([Cc]lose[sd]|[Ff]ixe[sd]) +#\d+ 63 | 64 | ## Default project features settings 65 | default_projects_features: 66 | issues: true 67 | merge_requests: true 68 | wiki: true 69 | wall: false 70 | snippets: false 71 | public: false 72 | 73 | ## External issues trackers 74 | issues_tracker: 75 | # redmine: 76 | # title: "Redmine" 77 | # ## If not nil, link 'Issues' on project page will be replaced with this 78 | # ## Use placeholders: 79 | # ## :project_id - GitLab project identifier 80 | # ## :issues_tracker_id - Project Name or Id in external issue tracker 81 | # project_url: "http://redmine.sample/projects/:issues_tracker_id" 82 | # 83 | # ## If not nil, links from /#\d/ entities from commit messages will replaced with this 84 | # ## Use placeholders: 85 | # ## :project_id - GitLab project identifier 86 | # ## :issues_tracker_id - Project Name or Id in external issue tracker 87 | # ## :id - Issue id (from commit messages) 88 | # issues_url: "http://redmine.sample/issues/:id" 89 | # 90 | # ## If not nil, linkis to creating new issues will be replaced with this 91 | # ## Use placeholders: 92 | # ## :project_id - GitLab project identifier 93 | # ## :issues_tracker_id - Project Name or Id in external issue tracker 94 | # new_issue_url: "http://redmine.sample/projects/:issues_tracker_id/issues/new" 95 | # 96 | # jira: 97 | # title: "Atlassian Jira" 98 | # project_url: "http://jira.sample/issues/?jql=project=:issues_tracker_id" 99 | # issues_url: "http://jira.sample/browse/:id" 100 | # new_issue_url: "http://jira.sample/secure/CreateIssue.jspa" 101 | 102 | ## Gravatar 103 | gravatar: 104 | enabled: true # Use user avatar image from Gravatar.com (default: true) 105 | # plain_url: "http://..." # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm 106 | # ssl_url: "https://..." # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm 107 | 108 | # 109 | # 2. Auth settings 110 | # ========================== 111 | 112 | ## LDAP settings 113 | ldap: 114 | enabled: false 115 | host: '_your_ldap_server' 116 | base: '_the_base_where_you_search_for_users' 117 | port: 636 118 | uid: 'sAMAccountName' 119 | method: 'ssl' # "ssl" or "plain" 120 | bind_dn: '_the_full_dn_of_the_user_you_will_bind_with' 121 | password: '_the_password_of_the_bind_user' 122 | allow_username_or_email_login: true 123 | 124 | ## OmniAuth settings 125 | omniauth: 126 | # Allow login via Twitter, Google, etc. using OmniAuth providers 127 | enabled: false 128 | 129 | # CAUTION! 130 | # This allows users to login without having a user account first (default: false). 131 | # User accounts will be created automatically when authentication was successful. 132 | allow_single_sign_on: false 133 | # Locks down those users until they have been cleared by the admin (default: true). 134 | block_auto_created_users: true 135 | 136 | ## Auth providers 137 | # Uncomment the following lines and fill in the data of the auth provider you want to use 138 | # If your favorite auth provider is not listed you can use others: 139 | # see https://github.com/gitlabhq/gitlab-public-wiki/wiki/Working-custom-omniauth-provider-configurations 140 | # The 'app_id' and 'app_secret' parameters are always passed as the first two 141 | # arguments, followed by optional 'args' which can be either a hash or an array. 142 | providers: 143 | # - { name: 'google_oauth2', app_id: 'YOUR APP ID', 144 | # app_secret: 'YOUR APP SECRET', 145 | # args: { access_type: 'offline', approval_prompt: '' } } 146 | # - { name: 'twitter', app_id: 'YOUR APP ID', 147 | # app_secret: 'YOUR APP SECRET'} 148 | # - { name: 'github', app_id: 'YOUR APP ID', 149 | # app_secret: 'YOUR APP SECRET' } 150 | 151 | 152 | 153 | # 154 | # 3. Advanced settings 155 | # ========================== 156 | 157 | # GitLab Satellites 158 | satellites: 159 | # Relative paths are relative to Rails.root (default: tmp/repo_satellites/) 160 | path: /home/{{ gitlab_user }}/gitlab-satellites/ 161 | 162 | ## Backup settings 163 | backup: 164 | path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/) 165 | # keep_time: 604800 # default: 0 (forever) (in seconds) 166 | 167 | ## GitLab Shell settings 168 | gitlab_shell: 169 | # REPOS_PATH MUST NOT BE A SYMLINK!!! 170 | repos_path: /home/{{ gitlab_user }}/repositories/ 171 | hooks_path: /home/{{ gitlab_user }}/gitlab-shell/hooks/ 172 | 173 | # Git over HTTP 174 | upload_pack: true 175 | receive_pack: true 176 | 177 | # If you use non-standard ssh port you need to specify it 178 | # ssh_port: 22 179 | 180 | ## Git settings 181 | # CAUTION! 182 | # Use the default values unless you really know what you are doing 183 | git: 184 | bin_path: /usr/bin/git 185 | # Max size of a git object (e.g. a commit), in bytes 186 | # This value can be increased if you have very large commits 187 | max_size: 5242880 # 5.megabytes 188 | # Git timeout to read a commit, in seconds 189 | timeout: 10 190 | 191 | # 192 | # 4. Extra customization 193 | # ========================== 194 | 195 | extra: 196 | ## Google analytics. Uncomment if you want it 197 | # google_analytics_id: '_your_tracking_id' 198 | 199 | ## Text under sign-in page (Markdown enabled) 200 | # sign_in_text: | 201 | # ![Company Logo](http://www.companydomain.com/logo.png) 202 | # [Learn more about CompanyName](http://www.companydomain.com/) 203 | 204 | development: 205 | <<: *base 206 | 207 | test: 208 | <<: *base 209 | issues_tracker: 210 | redmine: 211 | title: "Redmine" 212 | project_url: "http://redmine/projects/:issues_tracker_id" 213 | issues_url: "http://redmine/:project_id/:issues_tracker_id/:id" 214 | new_issue_url: "http://redmine/projects/:issues_tracker_id/issues/new" 215 | 216 | staging: 217 | <<: *base 218 | -------------------------------------------------------------------------------- /gitlab-unicorn/roles/gitlab/templates/gitlab.yml.j2: -------------------------------------------------------------------------------- 1 | # # # # # # # # # # # # # # # # # # 2 | # GitLab application config file # 3 | # # # # # # # # # # # # # # # # # # 4 | # 5 | # How to use: 6 | # 1. copy file as gitlab.yml 7 | # 2. Replace gitlab -> host with your domain 8 | # 3. Replace gitlab -> email_from 9 | 10 | production: &base 11 | # 12 | # 1. GitLab app settings 13 | # ========================== 14 | 15 | ## GitLab settings 16 | gitlab: 17 | ## Web server settings 18 | host: {{ gitlab_host }} 19 | port: 80 20 | https: false 21 | 22 | # Uncomment and customize the last line to run in a non-root path 23 | # WARNING: This feature is known to work, but unsupported 24 | # Note that three settings need to be changed for this to work. 25 | # 1) In your application.rb file: config.relative_url_root = "/gitlab" 26 | # 2) In your gitlab.yml file: relative_url_root: /gitlab 27 | # 3) In your unicorn.rb: ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab" 28 | # 29 | # relative_url_root: /gitlab 30 | 31 | # Uncomment and customize if you can't use the default user to run GitLab (default: 'git') 32 | user: {{ gitlab_user }} 33 | 34 | ## Email settings 35 | # Email address used in the "From" field in mails sent by GitLab 36 | email_from: gitlab@localhost 37 | 38 | # Email address of your support contact (default: same as email_from) 39 | support_email: support@localhost 40 | 41 | ## User settings 42 | default_projects_limit: 10 43 | # default_can_create_group: false # default: true 44 | # username_changing_enabled: false # default: true - User can change her username/namespace 45 | ## Default theme 46 | ## BASIC = 1 47 | ## MARS = 2 48 | ## MODERN = 3 49 | ## GRAY = 4 50 | ## COLOR = 5 51 | # default_theme: 2 # default: 2 52 | 53 | 54 | ## Users management 55 | # default: false - Account passwords are not sent via the email if signup is enabled. 56 | # signup_enabled: true 57 | 58 | ## Automatic issue closing 59 | # If a commit message matches this regular expression, all issues referenced from the matched text will be closed. 60 | # This happens when the commit is pushed or merged into the default branch of a project. 61 | # When not specified the default issue_closing_pattern as specified below will be used. 62 | # issue_closing_pattern: ([Cc]lose[sd]|[Ff]ixe[sd]) +#\d+ 63 | 64 | ## Default project features settings 65 | default_projects_features: 66 | issues: true 67 | merge_requests: true 68 | wiki: true 69 | wall: false 70 | snippets: false 71 | public: false 72 | 73 | ## External issues trackers 74 | issues_tracker: 75 | # redmine: 76 | # title: "Redmine" 77 | # ## If not nil, link 'Issues' on project page will be replaced with this 78 | # ## Use placeholders: 79 | # ## :project_id - GitLab project identifier 80 | # ## :issues_tracker_id - Project Name or Id in external issue tracker 81 | # project_url: "http://redmine.sample/projects/:issues_tracker_id" 82 | # 83 | # ## If not nil, links from /#\d/ entities from commit messages will replaced with this 84 | # ## Use placeholders: 85 | # ## :project_id - GitLab project identifier 86 | # ## :issues_tracker_id - Project Name or Id in external issue tracker 87 | # ## :id - Issue id (from commit messages) 88 | # issues_url: "http://redmine.sample/issues/:id" 89 | # 90 | # ## If not nil, linkis to creating new issues will be replaced with this 91 | # ## Use placeholders: 92 | # ## :project_id - GitLab project identifier 93 | # ## :issues_tracker_id - Project Name or Id in external issue tracker 94 | # new_issue_url: "http://redmine.sample/projects/:issues_tracker_id/issues/new" 95 | # 96 | # jira: 97 | # title: "Atlassian Jira" 98 | # project_url: "http://jira.sample/issues/?jql=project=:issues_tracker_id" 99 | # issues_url: "http://jira.sample/browse/:id" 100 | # new_issue_url: "http://jira.sample/secure/CreateIssue.jspa" 101 | 102 | ## Gravatar 103 | gravatar: 104 | enabled: true # Use user avatar image from Gravatar.com (default: true) 105 | # plain_url: "http://..." # default: http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm 106 | # ssl_url: "https://..." # default: https://secure.gravatar.com/avatar/%{hash}?s=%{size}&d=mm 107 | 108 | # 109 | # 2. Auth settings 110 | # ========================== 111 | 112 | ## LDAP settings 113 | ldap: 114 | enabled: false 115 | host: '_your_ldap_server' 116 | base: '_the_base_where_you_search_for_users' 117 | port: 636 118 | uid: 'sAMAccountName' 119 | method: 'ssl' # "ssl" or "plain" 120 | bind_dn: '_the_full_dn_of_the_user_you_will_bind_with' 121 | password: '_the_password_of_the_bind_user' 122 | allow_username_or_email_login: true 123 | 124 | ## OmniAuth settings 125 | omniauth: 126 | # Allow login via Twitter, Google, etc. using OmniAuth providers 127 | enabled: false 128 | 129 | # CAUTION! 130 | # This allows users to login without having a user account first (default: false). 131 | # User accounts will be created automatically when authentication was successful. 132 | allow_single_sign_on: false 133 | # Locks down those users until they have been cleared by the admin (default: true). 134 | block_auto_created_users: true 135 | 136 | ## Auth providers 137 | # Uncomment the following lines and fill in the data of the auth provider you want to use 138 | # If your favorite auth provider is not listed you can use others: 139 | # see https://github.com/gitlabhq/gitlab-public-wiki/wiki/Working-custom-omniauth-provider-configurations 140 | # The 'app_id' and 'app_secret' parameters are always passed as the first two 141 | # arguments, followed by optional 'args' which can be either a hash or an array. 142 | providers: 143 | # - { name: 'google_oauth2', app_id: 'YOUR APP ID', 144 | # app_secret: 'YOUR APP SECRET', 145 | # args: { access_type: 'offline', approval_prompt: '' } } 146 | # - { name: 'twitter', app_id: 'YOUR APP ID', 147 | # app_secret: 'YOUR APP SECRET'} 148 | # - { name: 'github', app_id: 'YOUR APP ID', 149 | # app_secret: 'YOUR APP SECRET' } 150 | 151 | 152 | 153 | # 154 | # 3. Advanced settings 155 | # ========================== 156 | 157 | # GitLab Satellites 158 | satellites: 159 | # Relative paths are relative to Rails.root (default: tmp/repo_satellites/) 160 | path: /home/{{ gitlab_user }}/gitlab-satellites/ 161 | 162 | ## Backup settings 163 | backup: 164 | path: "tmp/backups" # Relative paths are relative to Rails.root (default: tmp/backups/) 165 | # keep_time: 604800 # default: 0 (forever) (in seconds) 166 | 167 | ## GitLab Shell settings 168 | gitlab_shell: 169 | # REPOS_PATH MUST NOT BE A SYMLINK!!! 170 | repos_path: /home/{{ gitlab_user }}/repositories/ 171 | hooks_path: /home/{{ gitlab_user }}/gitlab-shell/hooks/ 172 | 173 | # Git over HTTP 174 | upload_pack: true 175 | receive_pack: true 176 | 177 | # If you use non-standard ssh port you need to specify it 178 | # ssh_port: 22 179 | 180 | ## Git settings 181 | # CAUTION! 182 | # Use the default values unless you really know what you are doing 183 | git: 184 | bin_path: /usr/bin/git 185 | # Max size of a git object (e.g. a commit), in bytes 186 | # This value can be increased if you have very large commits 187 | max_size: 5242880 # 5.megabytes 188 | # Git timeout to read a commit, in seconds 189 | timeout: 10 190 | 191 | # 192 | # 4. Extra customization 193 | # ========================== 194 | 195 | extra: 196 | ## Google analytics. Uncomment if you want it 197 | # google_analytics_id: '_your_tracking_id' 198 | 199 | ## Text under sign-in page (Markdown enabled) 200 | # sign_in_text: | 201 | # ![Company Logo](http://www.companydomain.com/logo.png) 202 | # [Learn more about CompanyName](http://www.companydomain.com/) 203 | 204 | development: 205 | <<: *base 206 | 207 | test: 208 | <<: *base 209 | issues_tracker: 210 | redmine: 211 | title: "Redmine" 212 | project_url: "http://redmine/projects/:issues_tracker_id" 213 | issues_url: "http://redmine/:project_id/:issues_tracker_id/:id" 214 | new_issue_url: "http://redmine/projects/:issues_tracker_id/issues/new" 215 | 216 | staging: 217 | <<: *base 218 | -------------------------------------------------------------------------------- /redis-replication/roles/redis-master/templates/redis.conf.j2: -------------------------------------------------------------------------------- 1 | # Redis configuration file example 2 | 3 | # Note on units: when memory size is needed, it is possible to specify 4 | # it in the usual form of 1k 5GB 4M and so forth: 5 | # 6 | # 1k => 1000 bytes 7 | # 1kb => 1024 bytes 8 | # 1m => 1000000 bytes 9 | # 1mb => 1024*1024 bytes 10 | # 1g => 1000000000 bytes 11 | # 1gb => 1024*1024*1024 bytes 12 | # 13 | # units are case insensitive so 1GB 1Gb 1gB are all the same. 14 | 15 | # By default Redis does not run as a daemon. Use 'yes' if you need it. 16 | # Note that Redis will write a pid file in /var/run/redis.pid when daemonized. 17 | daemonize yes 18 | 19 | # When running daemonized, Redis writes a pid file in /var/run/redis.pid by 20 | # default. You can specify a custom pid file location here. 21 | pidfile /var/run/redis/redis.pid 22 | 23 | # Accept connections on the specified port, default is 6379. 24 | # If port 0 is specified Redis will not listen on a TCP socket. 25 | port {{ redis_port }} 26 | 27 | # If you want you can bind a single interface, if the bind option is not 28 | # specified all the interfaces will listen for incoming connections. 29 | # 30 | bind 0.0.0.0 31 | 32 | # Specify the path for the unix socket that will be used to listen for 33 | # incoming connections. There is no default, so Redis will not listen 34 | # on a unix socket when not specified. 35 | # 36 | # unixsocket /tmp/redis.sock 37 | # unixsocketperm 755 38 | 39 | # Close the connection after a client is idle for N seconds (0 to disable) 40 | timeout 0 41 | 42 | # TCP keepalive. 43 | # 44 | # If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence 45 | # of communication. This is useful for two reasons: 46 | # 47 | # 1) Detect dead peers. 48 | # 2) Take the connection alive from the point of view of network 49 | # equipment in the middle. 50 | # 51 | # On Linux, the specified value (in seconds) is the period used to send ACKs. 52 | # Note that to close the connection the double of the time is needed. 53 | # On other kernels the period depends on the kernel configuration. 54 | # 55 | # A reasonable value for this option is 60 seconds. 56 | tcp-keepalive 0 57 | 58 | # Specify the server verbosity level. 59 | # This can be one of: 60 | # debug (a lot of information, useful for development/testing) 61 | # verbose (many rarely useful info, but not a mess like the debug level) 62 | # notice (moderately verbose, what you want in production probably) 63 | # warning (only very important / critical messages are logged) 64 | loglevel notice 65 | 66 | # Specify the log file name. Also 'stdout' can be used to force 67 | # Redis to log on the standard output. Note that if you use standard 68 | # output for logging but daemonize, logs will be sent to /dev/null 69 | logfile /var/log/redis/redis.log 70 | 71 | # To enable logging to the system logger, just set 'syslog-enabled' to yes, 72 | # and optionally update the other syslog parameters to suit your needs. 73 | # syslog-enabled no 74 | 75 | # Specify the syslog identity. 76 | # syslog-ident redis 77 | 78 | # Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7. 79 | # syslog-facility local0 80 | 81 | # Set the number of databases. The default database is DB 0, you can select 82 | # a different one on a per-connection basis using SELECT where 83 | # dbid is a number between 0 and 'databases'-1 84 | databases 16 85 | 86 | ################################ SNAPSHOTTING ################################# 87 | # 88 | # Save the DB on disk: 89 | # 90 | # save 91 | # 92 | # Will save the DB if both the given number of seconds and the given 93 | # number of write operations against the DB occurred. 94 | # 95 | # In the example below the behaviour will be to save: 96 | # after 900 sec (15 min) if at least 1 key changed 97 | # after 300 sec (5 min) if at least 10 keys changed 98 | # after 60 sec if at least 10000 keys changed 99 | # 100 | # Note: you can disable saving at all commenting all the "save" lines. 101 | # 102 | # It is also possible to remove all the previously configured save 103 | # points by adding a save directive with a single empty string argument 104 | # like in the following example: 105 | # 106 | # save "" 107 | save "" 108 | 109 | # By default Redis will stop accepting writes if RDB snapshots are enabled 110 | # (at least one save point) and the latest background save failed. 111 | # This will make the user aware (in an hard way) that data is not persisting 112 | # on disk properly, otherwise chances are that no one will notice and some 113 | # distater will happen. 114 | # 115 | # If the background saving process will start working again Redis will 116 | # automatically allow writes again. 117 | # 118 | # However if you have setup your proper monitoring of the Redis server 119 | # and persistence, you may want to disable this feature so that Redis will 120 | # continue to work as usually even if there are problems with disk, 121 | # permissions, and so forth. 122 | stop-writes-on-bgsave-error yes 123 | 124 | # Compress string objects using LZF when dump .rdb databases? 125 | # For default that's set to 'yes' as it's almost always a win. 126 | # If you want to save some CPU in the saving child set it to 'no' but 127 | # the dataset will likely be bigger if you have compressible values or keys. 128 | rdbcompression yes 129 | 130 | # Since version 5 of RDB a CRC64 checksum is placed at the end of the file. 131 | # This makes the format more resistant to corruption but there is a performance 132 | # hit to pay (around 10%) when saving and loading RDB files, so you can disable it 133 | # for maximum performances. 134 | # 135 | # RDB files created with checksum disabled have a checksum of zero that will 136 | # tell the loading code to skip the check. 137 | rdbchecksum yes 138 | 139 | # The filename where to dump the DB 140 | dbfilename dump.rdb 141 | 142 | # The working directory. 143 | # 144 | # The DB will be written inside this directory, with the filename specified 145 | # above using the 'dbfilename' configuration directive. 146 | # 147 | # The Append Only File will also be created inside this directory. 148 | # 149 | # Note that you must specify a directory here, not a file name. 150 | dir /var/lib/redis/ 151 | 152 | ################################# REPLICATION ################################# 153 | 154 | # Master-Slave replication. Use slaveof to make a Redis instance a copy of 155 | # another Redis server. Note that the configuration is local to the slave 156 | # so for example it is possible to configure the slave to save the DB with a 157 | # different interval, or to listen to another port, and so on. 158 | # 159 | # slaveof 160 | 161 | # If the master is password protected (using the "requirepass" configuration 162 | # directive below) it is possible to tell the slave to authenticate before 163 | # starting the replication synchronization process, otherwise the master will 164 | # refuse the slave request. 165 | # 166 | # masterauth 167 | 168 | # When a slave loses its connection with the master, or when the replication 169 | # is still in progress, the slave can act in two different ways: 170 | # 171 | # 1) if slave-serve-stale-data is set to 'yes' (the default) the slave will 172 | # still reply to client requests, possibly with out of date data, or the 173 | # data set may just be empty if this is the first synchronization. 174 | # 175 | # 2) if slave-serve-stale-data is set to 'no' the slave will reply with 176 | # an error "SYNC with master in progress" to all the kind of commands 177 | # but to INFO and SLAVEOF. 178 | # 179 | slave-serve-stale-data yes 180 | 181 | # You can configure a slave instance to accept writes or not. Writing against 182 | # a slave instance may be useful to store some ephemeral data (because data 183 | # written on a slave will be easily deleted after resync with the master) but 184 | # may also cause problems if clients are writing to it because of a 185 | # misconfiguration. 186 | # 187 | # Since Redis 2.6 by default slaves are read-only. 188 | # 189 | # Note: read only slaves are not designed to be exposed to untrusted clients 190 | # on the internet. It's just a protection layer against misuse of the instance. 191 | # Still a read only slave exports by default all the administrative commands 192 | # such as CONFIG, DEBUG, and so forth. To a limited extend you can improve 193 | # security of read only slaves using 'rename-command' to shadow all the 194 | # administrative / dangerous commands. 195 | slave-read-only yes 196 | 197 | # Slaves send PINGs to server in a predefined interval. It's possible to change 198 | # this interval with the repl_ping_slave_period option. The default value is 10 199 | # seconds. 200 | # 201 | # repl-ping-slave-period 10 202 | 203 | # The following option sets a timeout for both Bulk transfer I/O timeout and 204 | # master data or ping response timeout. The default value is 60 seconds. 205 | # 206 | # It is important to make sure that this value is greater than the value 207 | # specified for repl-ping-slave-period otherwise a timeout will be detected 208 | # every time there is low traffic between the master and the slave. 209 | # 210 | # repl-timeout 60 211 | 212 | # Disable TCP_NODELAY on the slave socket after SYNC? 213 | # 214 | # If you select "yes" Redis will use a smaller number of TCP packets and 215 | # less bandwidth to send data to slaves. But this can add a delay for 216 | # the data to appear on the slave side, up to 40 milliseconds with 217 | # Linux kernels using a default configuration. 218 | # 219 | # If you select "no" the delay for data to appear on the slave side will 220 | # be reduced but more bandwidth will be used for replication. 221 | # 222 | # By default we optimize for low latency, but in very high traffic conditions 223 | # or when the master and slaves are many hops away, turning this to "yes" may 224 | # be a good idea. 225 | repl-disable-tcp-nodelay no 226 | 227 | # The slave priority is an integer number published by Redis in the INFO output. 228 | # It is used by Redis Sentinel in order to select a slave to promote into a 229 | # master if the master is no longer working correctly. 230 | # 231 | # A slave with a low priority number is considered better for promotion, so 232 | # for instance if there are three slaves with priority 10, 100, 25 Sentinel will 233 | # pick the one wtih priority 10, that is the lowest. 234 | # 235 | # However a special priority of 0 marks the slave as not able to perform the 236 | # role of master, so a slave with priority of 0 will never be selected by 237 | # Redis Sentinel for promotion. 238 | # 239 | # By default the priority is 100. 240 | slave-priority 100 241 | 242 | ################################## SECURITY ################################### 243 | 244 | # Require clients to issue AUTH before processing any other 245 | # commands. This might be useful in environments in which you do not trust 246 | # others with access to the host running redis-server. 247 | # 248 | # This should stay commented out for backward compatibility and because most 249 | # people do not need auth (e.g. they run their own servers). 250 | # 251 | # Warning: since Redis is pretty fast an outside user can try up to 252 | # 150k passwords per second against a good box. This means that you should 253 | # use a very strong password otherwise it will be very easy to break. 254 | # 255 | # requirepass foobared 256 | 257 | # Command renaming. 258 | # 259 | # It is possible to change the name of dangerous commands in a shared 260 | # environment. For instance the CONFIG command may be renamed into something 261 | # hard to guess so that it will still be available for internal-use tools 262 | # but not available for general clients. 263 | # 264 | # Example: 265 | # 266 | # rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52 267 | # 268 | # It is also possible to completely kill a command by renaming it into 269 | # an empty string: 270 | # 271 | # rename-command CONFIG "" 272 | # 273 | # Please note that changing the name of commands that are logged into the 274 | # AOF file or transmitted to slaves may cause problems. 275 | 276 | ################################### LIMITS #################################### 277 | 278 | # Set the max number of connected clients at the same time. By default 279 | # this limit is set to 10000 clients, however if the Redis server is not 280 | # able to configure the process file limit to allow for the specified limit 281 | # the max number of allowed clients is set to the current file limit 282 | # minus 32 (as Redis reserves a few file descriptors for internal uses). 283 | # 284 | # Once the limit is reached Redis will close all the new connections sending 285 | # an error 'max number of clients reached'. 286 | # 287 | maxclients 10000 288 | 289 | # Don't use more memory than the specified amount of bytes. 290 | # When the memory limit is reached Redis will try to remove keys 291 | # accordingly to the eviction policy selected (see maxmemmory-policy). 292 | # 293 | # If Redis can't remove keys according to the policy, or if the policy is 294 | # set to 'noeviction', Redis will start to reply with errors to commands 295 | # that would use more memory, like SET, LPUSH, and so on, and will continue 296 | # to reply to read-only commands like GET. 297 | # 298 | # This option is usually useful when using Redis as an LRU cache, or to set 299 | # an hard memory limit for an instance (using the 'noeviction' policy). 300 | # 301 | # WARNING: If you have slaves attached to an instance with maxmemory on, 302 | # the size of the output buffers needed to feed the slaves are subtracted 303 | # from the used memory count, so that network problems / resyncs will 304 | # not trigger a loop where keys are evicted, and in turn the output 305 | # buffer of slaves is full with DELs of keys evicted triggering the deletion 306 | # of more keys, and so forth until the database is completely emptied. 307 | # 308 | # In short... if you have slaves attached it is suggested that you set a lower 309 | # limit for maxmemory so that there is some free RAM on the system for slave 310 | # output buffers (but this is not needed if the policy is 'noeviction'). 311 | # 312 | maxmemory {{ redis_max_memory }} 313 | 314 | # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory 315 | # is reached. You can select among five behaviors: 316 | # 317 | # volatile-lru -> remove the key with an expire set using an LRU algorithm 318 | # allkeys-lru -> remove any key accordingly to the LRU algorithm 319 | # volatile-random -> remove a random key with an expire set 320 | # allkeys-random -> remove a random key, any key 321 | # volatile-ttl -> remove the key with the nearest expire time (minor TTL) 322 | # noeviction -> don't expire at all, just return an error on write operations 323 | # 324 | # Note: with any of the above policies, Redis will return an error on write 325 | # operations, when there are not suitable keys for eviction. 326 | # 327 | # At the date of writing this commands are: set setnx setex append 328 | # incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd 329 | # sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby 330 | # zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby 331 | # getset mset msetnx exec sort 332 | # 333 | # The default is: 334 | # 335 | # maxmemory-policy volatile-lru 336 | maxmemory-policy noeviction 337 | 338 | # LRU and minimal TTL algorithms are not precise algorithms but approximated 339 | # algorithms (in order to save memory), so you can select as well the sample 340 | # size to check. For instance for default Redis will check three keys and 341 | # pick the one that was used less recently, you can change the sample size 342 | # using the following configuration directive. 343 | # 344 | # maxmemory-samples 3 345 | 346 | ############################## APPEND ONLY MODE ############################### 347 | 348 | # By default Redis asynchronously dumps the dataset on disk. This mode is 349 | # good enough in many applications, but an issue with the Redis process or 350 | # a power outage may result into a few minutes of writes lost (depending on 351 | # the configured save points). 352 | # 353 | # The Append Only File is an alternative persistence mode that provides 354 | # much better durability. For instance using the default data fsync policy 355 | # (see later in the config file) Redis can lose just one second of writes in a 356 | # dramatic event like a server power outage, or a single write if something 357 | # wrong with the Redis process itself happens, but the operating system is 358 | # still running correctly. 359 | # 360 | # AOF and RDB persistence can be enabled at the same time without problems. 361 | # If the AOF is enabled on startup Redis will load the AOF, that is the file 362 | # with the better durability guarantees. 363 | # 364 | # Please check http://redis.io/topics/persistence for more information. 365 | 366 | appendonly no 367 | 368 | # The name of the append only file (default: "appendonly.aof") 369 | # appendfilename appendonly.aof 370 | 371 | # The fsync() call tells the Operating System to actually write data on disk 372 | # instead to wait for more data in the output buffer. Some OS will really flush 373 | # data on disk, some other OS will just try to do it ASAP. 374 | # 375 | # Redis supports three different modes: 376 | # 377 | # no: don't fsync, just let the OS flush the data when it wants. Faster. 378 | # always: fsync after every write to the append only log . Slow, Safest. 379 | # everysec: fsync only one time every second. Compromise. 380 | # 381 | # The default is "everysec", as that's usually the right compromise between 382 | # speed and data safety. It's up to you to understand if you can relax this to 383 | # "no" that will let the operating system flush the output buffer when 384 | # it wants, for better performances (but if you can live with the idea of 385 | # some data loss consider the default persistence mode that's snapshotting), 386 | # or on the contrary, use "always" that's very slow but a bit safer than 387 | # everysec. 388 | # 389 | # More details please check the following article: 390 | # http://antirez.com/post/redis-persistence-demystified.html 391 | # 392 | # If unsure, use "everysec". 393 | 394 | # appendfsync always 395 | appendfsync everysec 396 | # appendfsync no 397 | 398 | # When the AOF fsync policy is set to always or everysec, and a background 399 | # saving process (a background save or AOF log background rewriting) is 400 | # performing a lot of I/O against the disk, in some Linux configurations 401 | # Redis may block too long on the fsync() call. Note that there is no fix for 402 | # this currently, as even performing fsync in a different thread will block 403 | # our synchronous write(2) call. 404 | # 405 | # In order to mitigate this problem it's possible to use the following option 406 | # that will prevent fsync() from being called in the main process while a 407 | # BGSAVE or BGREWRITEAOF is in progress. 408 | # 409 | # This means that while another child is saving, the durability of Redis is 410 | # the same as "appendfsync none". In practical terms, this means that it is 411 | # possible to lose up to 30 seconds of log in the worst scenario (with the 412 | # default Linux settings). 413 | # 414 | # If you have latency problems turn this to "yes". Otherwise leave it as 415 | # "no" that is the safest pick from the point of view of durability. 416 | no-appendfsync-on-rewrite no 417 | 418 | # Automatic rewrite of the append only file. 419 | # Redis is able to automatically rewrite the log file implicitly calling 420 | # BGREWRITEAOF when the AOF log size grows by the specified percentage. 421 | # 422 | # This is how it works: Redis remembers the size of the AOF file after the 423 | # latest rewrite (if no rewrite has happened since the restart, the size of 424 | # the AOF at startup is used). 425 | # 426 | # This base size is compared to the current size. If the current size is 427 | # bigger than the specified percentage, the rewrite is triggered. Also 428 | # you need to specify a minimal size for the AOF file to be rewritten, this 429 | # is useful to avoid rewriting the AOF file even if the percentage increase 430 | # is reached but it is still pretty small. 431 | # 432 | # Specify a percentage of zero in order to disable the automatic AOF 433 | # rewrite feature. 434 | 435 | auto-aof-rewrite-percentage 100 436 | auto-aof-rewrite-min-size 64mb 437 | 438 | ################################ LUA SCRIPTING ############################### 439 | 440 | # Max execution time of a Lua script in milliseconds. 441 | # 442 | # If the maximum execution time is reached Redis will log that a script is 443 | # still in execution after the maximum allowed time and will start to 444 | # reply to queries with an error. 445 | # 446 | # When a long running script exceed the maximum execution time only the 447 | # SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be 448 | # used to stop a script that did not yet called write commands. The second 449 | # is the only way to shut down the server in the case a write commands was 450 | # already issue by the script but the user don't want to wait for the natural 451 | # termination of the script. 452 | # 453 | # Set it to 0 or a negative value for unlimited execution without warnings. 454 | lua-time-limit 5000 455 | 456 | ################################## SLOW LOG ################################### 457 | 458 | # The Redis Slow Log is a system to log queries that exceeded a specified 459 | # execution time. The execution time does not include the I/O operations 460 | # like talking with the client, sending the reply and so forth, 461 | # but just the time needed to actually execute the command (this is the only 462 | # stage of command execution where the thread is blocked and can not serve 463 | # other requests in the meantime). 464 | # 465 | # You can configure the slow log with two parameters: one tells Redis 466 | # what is the execution time, in microseconds, to exceed in order for the 467 | # command to get logged, and the other parameter is the length of the 468 | # slow log. When a new command is logged the oldest one is removed from the 469 | # queue of logged commands. 470 | 471 | # The following time is expressed in microseconds, so 1000000 is equivalent 472 | # to one second. Note that a negative number disables the slow log, while 473 | # a value of zero forces the logging of every command. 474 | slowlog-log-slower-than 10000 475 | 476 | # There is no limit to this length. Just be aware that it will consume memory. 477 | # You can reclaim memory used by the slow log with SLOWLOG RESET. 478 | slowlog-max-len 128 479 | 480 | ############################### ADVANCED CONFIG ############################### 481 | 482 | # Hashes are encoded using a memory efficient data structure when they have a 483 | # small number of entries, and the biggest entry does not exceed a given 484 | # threshold. These thresholds can be configured using the following directives. 485 | hash-max-ziplist-entries 512 486 | hash-max-ziplist-value 64 487 | 488 | # Similarly to hashes, small lists are also encoded in a special way in order 489 | # to save a lot of space. The special representation is only used when 490 | # you are under the following limits: 491 | list-max-ziplist-entries 512 492 | list-max-ziplist-value 64 493 | 494 | # Sets have a special encoding in just one case: when a set is composed 495 | # of just strings that happens to be integers in radix 10 in the range 496 | # of 64 bit signed integers. 497 | # The following configuration setting sets the limit in the size of the 498 | # set in order to use this special memory saving encoding. 499 | set-max-intset-entries 512 500 | 501 | # Similarly to hashes and lists, sorted sets are also specially encoded in 502 | # order to save a lot of space. This encoding is only used when the length and 503 | # elements of a sorted set are below the following limits: 504 | zset-max-ziplist-entries 128 505 | zset-max-ziplist-value 64 506 | 507 | # Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in 508 | # order to help rehashing the main Redis hash table (the one mapping top-level 509 | # keys to values). The hash table implementation Redis uses (see dict.c) 510 | # performs a lazy rehashing: the more operation you run into an hash table 511 | # that is rehashing, the more rehashing "steps" are performed, so if the 512 | # server is idle the rehashing is never complete and some more memory is used 513 | # by the hash table. 514 | # 515 | # The default is to use this millisecond 10 times every second in order to 516 | # active rehashing the main dictionaries, freeing memory when possible. 517 | # 518 | # If unsure: 519 | # use "activerehashing no" if you have hard latency requirements and it is 520 | # not a good thing in your environment that Redis can reply form time to time 521 | # to queries with 2 milliseconds delay. 522 | # 523 | # use "activerehashing yes" if you don't have such hard requirements but 524 | # want to free memory asap when possible. 525 | activerehashing yes 526 | 527 | # The client output buffer limits can be used to force disconnection of clients 528 | # that are not reading data from the server fast enough for some reason (a 529 | # common reason is that a Pub/Sub client can't consume messages as fast as the 530 | # publisher can produce them). 531 | # 532 | # The limit can be set differently for the three different classes of clients: 533 | # 534 | # normal -> normal clients 535 | # slave -> slave clients and MONITOR clients 536 | # pubsub -> clients subcribed to at least one pubsub channel or pattern 537 | # 538 | # The syntax of every client-output-buffer-limit directive is the following: 539 | # 540 | # client-output-buffer-limit 541 | # 542 | # A client is immediately disconnected once the hard limit is reached, or if 543 | # the soft limit is reached and remains reached for the specified number of 544 | # seconds (continuously). 545 | # So for instance if the hard limit is 32 megabytes and the soft limit is 546 | # 16 megabytes / 10 seconds, the client will get disconnected immediately 547 | # if the size of the output buffers reach 32 megabytes, but will also get 548 | # disconnected if the client reaches 16 megabytes and continuously overcomes 549 | # the limit for 10 seconds. 550 | # 551 | # By default normal clients are not limited because they don't receive data 552 | # without asking (in a push way), but just after a request, so only 553 | # asynchronous clients may create a scenario where data is requested faster 554 | # than it can read. 555 | # 556 | # Instead there is a default limit for pubsub and slave clients, since 557 | # subscribers and slaves receive data in a push fashion. 558 | # 559 | # Both the hard or the soft limit can be disabled by setting them to zero. 560 | client-output-buffer-limit normal 0 0 0 561 | client-output-buffer-limit slave 256mb 64mb 60 562 | client-output-buffer-limit pubsub 32mb 8mb 60 563 | 564 | # Redis calls an internal function to perform many background tasks, like 565 | # closing connections of clients in timeot, purging expired keys that are 566 | # never requested, and so forth. 567 | # 568 | # Not all tasks are perforemd with the same frequency, but Redis checks for 569 | # tasks to perform accordingly to the specified "hz" value. 570 | # 571 | # By default "hz" is set to 10. Raising the value will use more CPU when 572 | # Redis is idle, but at the same time will make Redis more responsive when 573 | # there are many keys expiring at the same time, and timeouts may be 574 | # handled with more precision. 575 | # 576 | # The range is between 1 and 500, however a value over 100 is usually not 577 | # a good idea. Most users should use the default of 10 and raise this up to 578 | # 100 only in environments where very low latency is required. 579 | hz 10 580 | 581 | # When a child rewrites the AOF file, if the following option is enabled 582 | # the file will be fsync-ed every 32 MB of data generated. This is useful 583 | # in order to commit the file to the disk more incrementally and avoid 584 | # big latency spikes. 585 | aof-rewrite-incremental-fsync yes 586 | 587 | ################################## INCLUDES ################################### 588 | 589 | # Include one or more other config files here. This is useful if you 590 | # have a standard template that goes to all Redis server but also need 591 | # to customize a few per-server settings. Include files can include 592 | # other files, so use this wisely. 593 | # 594 | # include /path/to/local.conf 595 | # include /path/to/other.conf 596 | --------------------------------------------------------------------------------