Commit 03f9cee5 authored by Walter Heck's avatar Walter Heck

Merge branch 'develop' into 'production'

Develop

merge back into production to prepare for release 2.0

See merge request !12
parents d17a6ab6 f68f6814
Pipeline #372 passed with stages
in 2 minutes and 57 seconds
modules
# Created by https://www.gitignore.io/api/osx,packer,terraform,windows,ruby,vagrant
### OSX ###
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Packer ###
# Cache objects
packer_cache/
# For built boxes
*.box
### Terraform ###
# Compiled files
*.tfstate
*.tfstate.backup
# Module directory
.terraform/
### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
### Ruby ###
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
/tmp/
# Used by dotenv library to load environment variables.
# .env
## Specific to RubyMotion:
.dat*
.repl_history
build/
*.bridgesupport
build-iPhoneOS/
build-iPhoneSimulator/
## Specific to RubyMotion (use of CocoaPods):
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# vendor/Pods/
## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/
## Environment normalization:
/.bundle/
/vendor/bundle
/lib/bundler/man/
# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
Gemfile.lock
# .ruby-version
# .ruby-gemset
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
### Vagrant ###
.vagrant/
### OpsTheater ###
modules/
deploy/vagrant-oscar/.pe_build
deploy/vagrant-oscar/.vagrant
vendor/bundle
terraform.tfstate
Gemfile.lock
deploy/packer/output*
!deploy/packer/manifests/modules
---
image: ruby:2.2
before_script:
- bundle install
stages:
- build
- test
- deploy
test:
job:build:artifacts:
stage: build
script:
- rake lint
- rake syntax
- bundle install --deployment
- bundle config
environment: test
artifacts:
expire_in: 1 hours
paths:
- vendor/
job:test:syntax:
stage: test
script:
- bundle install --deployment
- bundle config
- bundle exec rake syntax
dependencies:
- job:build:artifacts
job:test:lint:
stage: test
script:
- bundle install --deployment
- bundle config
- bundle exec rake lint
dependencies:
- job:build:artifacts
job:test:r10k:
stage: test
script:
- bundle install --deployment
- bundle config
- bundle exec r10k puppetfile check
- bundle exec r10k puppetfile install
dependencies:
- job:build:artifacts
job:deploy:r10k:
stage: deploy
script:
- echo "deploy"
environment: production
## How to contribute code to OpsTheater:
If you want to have a look at puppetised code for OpsTheater, you can check that on this git repository : *https://gitlab.olindata.com/opstheater/opstheater*
If you want to have a look at puppetised code for OpsTheater, you can check that on this git repository: <https://gitlab.olindata.com/opstheater/opstheater>
Please follow the below steps for contributing :
On your development machine (local machine) clone the opstheater control repository using command :
On your development machine clone the `opstheater` repository using command :
```sh
git clone git@gitlab.olindata.com:opstheater/opstheater.git
```
This will create a directory called opstheater on your current location.
This will create a directory called `opstheater` in your current directory.
You can contribute your code in this local directory and push it to a new branch
```sh
checkout -b <author>/[fixes|features]/<name>
```
Now you will be on a new branch that you have just create now, to check the same run command
Now you will be on a new branch that you have just created now, to check the same run command
```sh
git branch
```
Now once you have done with your code you will need to push it to the repository with following steps:
Now once you are done with your code you will need to push it to the repository with following steps:
```sh
git add <file name>
......@@ -29,28 +29,3 @@ git push origin <branch name>
This step will push your changes to the repository `opstheater` on the branch you created.
Now you can request someone else on the team to check your code and merge it with the original repository.
## Deploying your environment with R10K :
R10K is a hybrid solution for deploying Puppet code. It implements the original git workflow for deploying Puppet environments based on Git branches.
You can install r10k directly with command
```sh
gem install r10k
```
Now go to path **/etc/puppetlabs/r10k** and create file **r10k.yaml** with content as :
```sh
:cachedir: '/var/cache/r10k'
:sources:
:local:
remote: 'git@gitlab.olindata.com:opstheater/opstheater.git'
basedir: '/etc/puppetlabs/code/environments'
```
**Note: the value of basedir should be same as environmentpath in puppet.conf**
Now you can deploy your whole environment using r10k using following command :
```sh
r10k deploy environment <environment name>
```
Here environment of your branch in the repository will act as environment name.
So when when you will run r10k deploy with your branch name as environment name it will create an environment with your branch name in your local system on path **/etc/puppetlabs/code/environments**.
......@@ -3,7 +3,7 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org"
if ENV.key?('PUPPET_VERSION')
puppetversion = "= #{ENV['PUPPET_VERSION']}"
else
puppetversion = ['>= 3.5']
puppetversion = ['>= 4.0']
end
gem 'rake'
......@@ -12,4 +12,5 @@ gem 'metadata-json-lint'
gem 'puppet-lint'
gem 'rspec-puppet'
gem 'puppetlabs_spec_helper'
gem 'r10k'
\ No newline at end of file
gem 'r10k'
gem 'ra10ke'
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.2.8)
colored (1.2)
cri (2.6.1)
colored (~> 1.2)
diff-lcs (1.2.5)
facter (2.4.6)
CFPropertyList (~> 2.2.6)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.10.1)
faraday (>= 0.7.4, < 1.0)
fast_gettext (1.1.0)
gettext (3.2.2)
locale (>= 2.0.5)
text (>= 1.3.0)
gettext-setup (0.8)
fast_gettext (~> 1.1.0)
gettext (>= 3.0.2)
hiera (3.2.2)
json (2.0.2)
json_pure (1.8.3)
locale (2.1.2)
log4r (1.1.10)
metaclass (0.0.4)
metadata-json-lint (1.0.0)
json
semantic_puppet (>= 0.1.2, < 2.0.0)
spdx-licenses (~> 1.0)
minitar (0.5.4)
mocha (1.2.1)
metaclass (~> 0.0.1)
multi_json (1.12.1)
multipart-post (2.0.0)
puppet (4.8.1)
CFPropertyList (~> 2.2.6)
facter (> 2.0, < 4)
hiera (>= 2.0, < 4)
json_pure (~> 1.8)
puppet-lint (2.0.2)
puppet-syntax (2.2.0)
rake
puppet_forge (2.2.2)
faraday (~> 0.9.0)
faraday_middleware (>= 0.9.0, < 0.11.0)
gettext-setup (>= 0.3)
minitar
semantic_puppet (~> 0.1.0)
puppetlabs_spec_helper (1.2.2)
mocha (~> 1.0)
puppet-lint (~> 2.0)
puppet-syntax (~> 2.0)
rspec-puppet (~> 2.0)
r10k (2.5.1)
colored (= 1.2)
cri (~> 2.6.1)
gettext-setup (~> 0.5)
log4r (= 1.1.10)
minitar
multi_json (~> 1.10)
puppet_forge (~> 2.2)
semantic_puppet (~> 0.1.0)
ra10ke (0.1.1)
puppet_forge
r10k
rake
rake (12.0.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-puppet (2.5.0)
rspec
rspec-support (3.5.0)
semantic_puppet (0.1.4)
gettext-setup (>= 0.3)
spdx-licenses (1.1.0)
text (1.3.1)
PLATFORMS
ruby
DEPENDENCIES
metadata-json-lint
puppet (>= 4.0)
puppet-lint
puppetlabs_spec_helper
r10k
ra10ke
rake
rspec-puppet
BUNDLED WITH
1.14.3
mod 'icingaweb2',
:git => 'https://github.com/olindata/puppet-icingaweb2.git'
mod 'icinga2',
:git => 'https://github.com/olindata/puppet-icinga2.git',
:branch => 'develop'
mod 'kibana4',
:git => 'https://github.com/walterheck/puppet-kibana4.git'
mod 'kibana5',
:git => 'https://github.com/walterheck/puppet-kibana5.git',
:commit => '4774be4ab96818beb293802b0abe03e220a291d1'
mod 'grafana',
:git => 'https://github.com/olindata/puppet-grafana.git'
:git => 'https://github.com/olindata/puppet-grafana.git',
:commit => 'c4d6b5c276c1db865bd8502542702bcf97551806'
mod 'gitlab',
:git => 'https://github.com/walterheck/puppet-gitlab.git'
:git => 'https://github.com/walterheck/puppet-gitlab.git',
:commit => '18f38eff33a5ac800b3f448abd3b02f5ee10a23c'
mod 'logstash',
:git => 'https://github.com/olindata/puppet-logstash.git',
:commit => '86b3db14ba5316e4bf5ce01c528029674b9afcb0'
mod 'icingaweb2',
:git => 'https://github.com/Icinga/puppet-icingaweb2.git',
:commit => '44a0408787ae1726adebc0c8308a425ede5909d6'
# forge modules should be listed with a specific version and stay in
# NOTE: alphabetical order
mod 'abrader/gms', '1.0.1'
mod 'ajcrowe/supervisord', '0.6.0'
mod 'aptituz/ssh', '2.3.2'
mod 'elasticsearch/elasticsearch', '0.9.9'
mod 'camptocamp/archive', '0.8.1'
mod 'golja/influxdb', '3.0.1'
mod 'jfryman/nginx', '0.3.0'
mod 'pcfens/filebeat', '0.5.7'
mod 'puppetlabs/apache', '1.6.0'
mod 'puppetlabs/apt', '2.2.0'
mod 'puppetlabs/concat', '1.2.4'
mod 'puppetlabs/firewall', '1.7.1'
mod 'puppetlabs/inifile', '1.4.2'
mod 'puppetlabs/java', '1.4.2'
mod 'puppetlabs/mysql', '3.6.2'
mod 'puppetlabs/ntp', '4.1.2'
mod 'puppetlabs/postgresql', '4.6.0'
mod 'puppetlabs/ruby', '0.4.0'
mod 'puppetlabs/stdlib', '4.9.0'
mod 'puppetlabs/vcsrepo', '1.3.1'
mod 'abrader/gms', '1.0.3'
mod 'aptituz/ssh', '2.4.0'
mod 'camptocamp/archive', '0.9.0'
mod 'ceritsc/yum', '0.9.8'
mod 'elastic/logstash', '5.0.3'
mod 'elasticsearch/elasticsearch', '0.15.1'
mod 'golja/influxdb', '4.0.0'
mod 'icinga/icinga2', '1.0.1'
mod 'pcfens/filebeat', '0.9.2'
mod 'puppet/r10k', '4.1.0'
mod 'puppetlabs/apache', '1.11.0'
mod 'puppetlabs/apt', '2.3.0'
mod 'puppetlabs/concat', '2.2.0'
mod 'puppetlabs/firewall', '1.8.1'
mod 'puppetlabs/inifile', '1.6.0'
mod 'puppetlabs/java', '1.6.0'
mod 'puppetlabs/mysql', '3.10.0'
mod 'puppetlabs/ntp', '6.0.0'
mod 'puppetlabs/postgresql', '4.8.0'
mod 'puppetlabs/ruby', '0.6.0'
mod 'puppetlabs/stdlib', '4.14.0'
mod 'puppetlabs/vcsrepo', '1.5.0'
mod 'richardc/datacat', '0.6.2'
mod 'stahnma/epel', '1.1.1'
mod 'zack/r10k', '3.2.0'
mod 'stahnma/epel', '1.2.2'
mod 'thias/sysctl', '1.0.6'
mod 'yo61/logrotate', '1.4.0'
mod 'zack/exports', '0.0.6'
......@@ -3,14 +3,40 @@
[![Build
Status](https://gitlab.olindata.com/opstheater/opstheater/badges/production/build.svg)](https://gitlab.olindata.com/opstheater/opstheater/builds/)
## Getting started
## Content
1. Opstheater
2. Branches
3. Installation
4. Need help?
If you wish to try out OpsTheater in a development setup, please look at the instructions here: https://gitlab.olindata.com/opstheater/opstheater-docs/blob/master/1.6/deployment/development.md
## OpsTheater
Opstheater is a fully Open Source stack of tools for managing infrastructure as code, in an automated way. Opstheater intension to make our server life easier, more controllable, repeatable.
## Branches
Opstheater has a few different branches, which you can use for different purposes.
* 1.6 stable
* The latest stable version of Opstheater.
* Production
* This is the latest production environment of Opstheater.
* Develop
* Development environment for developer, stable.
* Refactoring
* Development environment mostly for trying out things (it can be unstable).
## Installation
We have three different style of deployment.
* For development purposes please follow the instructions here. (link: <https://gitlab.olindata.com/opstheater/opstheater-docs/blob/master/1.6/deployment/development.md>)
* For trying out Opstheater for later production deployment, please use thi instructions (this moment we suggest you to use the “develop” branch).
## Need Help?
Need help? Try one of these:
* Google Group: email at opstheater@googlegroups.com or https://groups.google.com/forum/#!forum/opstheater
* chat with us on freenode IRC #opstheater
* coming soon: a public mattermost team
\ No newline at end of file
* Google Group: email at opstheater <AT> googlegroups <DOT> com or <https://groups.google.com/forum/#!forum/opstheater>
* chat with us on freenode IRC #opstheater
......@@ -7,13 +7,13 @@ This is a Major Milestone Release of Opstheater. We go OpenSource with 1.6
In this release the number of changes is limited as most of the capacity in this sprint was used to make open sourcing the code possible.
The following has been added along the way:
* Logstash filters for filtering access logs of following components:
* Puppetmaster
* PupptDB
* Gitlab
* Mattermost
* Used Puppet Lint to make sure that all our puppet code is following Puppetlabs style guide and we pass an initial CI build on each push to gitlab
* removed sensitive code, updated lots of references to things and generally cleaned up a bunch of things.
* Logstash filters for filtering access logs of following components:
* Puppetmaster
* PupptDB
* Gitlab
* Mattermost
* Used Puppet Lint to make sure that all our puppet code is following Puppetlabs style guide and we pass an initial CI build on each push to gitlab
* removed sensitive code, updated lots of references to things and generally cleaned up a bunch of things.
In addition to this, we have updated the components in use by OpsTheater to the following versions, each of which comes with it's own release notes:
......
......@@ -3,21 +3,55 @@ require 'puppetlabs_spec_helper/rake_tasks'
#require 'puppetlabs_spec_helper/puppet_spec_helper'
require 'puppet-lint/tasks/puppet-lint'
require 'metadata-json-lint/rake_task'
require 'ra10ke'
if not ENV['SPEC_OPTS']
ENV['SPEC_OPTS'] = '--format documentation'
end
PuppetLint.configuration.send('disable_documentation')
PuppetLint.configuration.send('disable_80chars')
PuppetSyntax.exclude_paths = [ "vendor/**/*.*" ]
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp", "vendor/**/*.pp"]
PuppetSyntax.exclude_paths = [
"vendor/**/*.*",
"modules/**/*.pp",
"deploy/packer/manifests/modules/**/**/*.pp"
]
PuppetLint.configuration.ignore_paths = [
"spec/**/*.pp",
"pkg/**/*.pp",
"vendor/**/*.pp",
"modules/**/*.pp",
"deploy/packer/manifests/modules/**/**/*.pp"
]
# Alternative configuration until https://github.com/rodjek/puppet-lint/pull/397 gets merged
Rake::Task[:lint].clear
PuppetLint::RakeTask.new :lint do |config|
config.ignore_paths = PuppetLint.configuration.ignore_paths
# List of checks to disable
config.disable_checks = ['documentation', '140chars']
# Should puppet-lint prefix it's output with the file being checked,
# defaults to true
config.with_filename = true
# Should the task fail if there were any warnings, defaults to false
config.fail_on_warnings = true
# Format string for puppet-lint's output (see the puppet-lint help output
# for details
# config.log_format = '%{filename} - %{message}'
# Print out the context for the problem, defaults to false
config.with_context = true
# Enable automatic fixing of problems, defaults to false
config.fix = false
# Show ignored problems in the output, defaults to false
config.show_ignored = true
# Compare module layout relative to the module root
config.relative = true
end
task :all => [ :validate, :metadata, :lint, :spec ]
{
"variables":
{
"template_name": "centos-7.2-x86_64-base",
"template_os": "RedHat_64",
"iso_url": "http://mirror.nl.leaseweb.net/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-1511.iso",
"iso_checksum": "907e5755f824c5848b9c8efbb484f3cd945e93faa024bad6ba875226f9683b16",
"iso_checksum_type": "sha256",
"memory_size": "512",
"cpu_count": "1",
"provisioner": "virtualbox",
"required_modules": "puppetlabs-stdlib saz-ssh",
"puppet_repo": "http://yum.puppetlabs.com/el/7/PC1/x86_64/puppetlabs-release-pc1-1.0.0-2.el7.noarch.rpm"
},
"builders": [
{
"name": "{{user `template_name`}}-{{user `provisioner`}}",
"type": "virtualbox-iso",
"boot_command": [
"<tab> <wait>",
"text <wait>",
"ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/x86_64.ks <wait>",
"<enter>"
],
"boot_wait": "10s",
"disk_size": 10240,
"guest_os_type": "{{user `template_os`}}",
"http_directory": "files",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"iso_url": "{{user `iso_url`}}",
"ssh_username": "root",
"ssh_password": "puppet",
"ssh_port": 22,
"ssh_wait_timeout": "10000s",
"shutdown_command": "/sbin/halt -h -p",
"virtualbox_version_file": ".vbox_version",
"vboxmanage": [
[
"modifyvm",
"{{.Name}}",
"--memory",
"{{user `memory_size`}}"
],
[
"modifyvm",
"{{.Name}}",
"--cpus",
"{{user `cpu_count`}}"
],
[
"modifyvm",
"{{.Name}}",
"--ioapic",
"off"
]
]
}
],
"provisioners": [
{
"type": "shell",
"execute_command": "{{.Vars}} bash '{{.Path}}' {{user `required_modules`}}",
"environment_vars": [
"TEMPLATE={{user `template_name`}}",
"PC_REPO={{user `puppet_repo`}}"
],
"scripts": [
"scripts/bootstrap-aio.sh"
]
},
{
"type": "puppet-masterless",
"execute_command": "{{.FacterVars}} PATH=$PATH:/opt/puppetlabs/puppet/bin /opt/puppetlabs/puppet/bin/puppet apply --verbose --detailed-exitcodes --modulepath='/tmp/packer-puppet-masterless/manifests/modules' {{.ManifestFile}}",
"facter": {
"provisioner": "{{user `provisioner`}}"
},
"manifest_dir": "manifests",
"manifest_file": "manifests/base.pp"
},
{
"type": "shell",
"environment_vars": [
"TEMPLATE={{user `template_name`}}",
"PC_REPO={{user `puppet_repo`}}"
],
"scripts": [
"scripts/cleanup-scrub.sh"
]
}
]
}
install
cdrom
lang en_US.UTF-8
keyboard us
network --bootproto=dhcp
rootpw --iscrypted $1$v4K9E8Wj$gZIHJ5JtQL5ZGZXeqSSsd0
firewall --enabled --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone UTC
bootloader --location=mbr
text
skipx
zerombr
clearpart --all --initlabel
autopart
auth --useshadow --enablemd5
firstboot --disabled
reboot --eject
%packages --ignoremissing
@core
bzip2
kernel-devel
kernel-headers