Skip to content

Instantly share code, notes, and snippets.

View mattpwest's full-sized avatar

Matt Van Der Westhuizen mattpwest

  • Ubisoft
  • Germany
View GitHub Profile
@mattpwest
mattpwest / sonarqube.part3.yml
Created May 17, 2018 10:22
Sonarqube Ansible Play: Part 3 - Sonarqube
- name: Create the sonar user for running the SonarQube services
user:
name: sonar
comment: System user for running SonarQube
- name: Download SonarQube
get_url:
url: "https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-{{ sonar_version }}.zip"
dest: "/srv/sonarqube-{{ sonar_version }}.zip"
@mattpwest
mattpwest / sonarqube.part2.yml
Created May 17, 2018 10:22
Sonarqube Ansible Play: Part 2 - PostgreSQL
# - name: Create postgres user for SonarQube
# become: yes
# become_user: postgres
# postgresql_user:
# name: "{{ sonar_db_user }}"
# password: 'str[\"md5\"] + md5[ {{ sonar_db_pass }} + {{ sonar_db_user }} ]'
# encrypted: yes
#
# - name: Create the sonar database
# postgresql_db:
@mattpwest
mattpwest / sonarqube.part1.yml
Last active November 5, 2020 02:59
Sonarqube Ansible Play: Part 1 - Java
---
- hosts: sonar
become: true
roles:
- jdauphant.ssl-certs
- role: jdauphant.nginx
nginx_configs:
ssl:
- ssl_certificate_key {{ssl_certs_privkey_path}}
- ssl_certificate {{ssl_certs_cert_path}}
@mattpwest
mattpwest / inventories.dev.local
Last active May 18, 2018 09:32
Sonarqube Ansible Inventory for local dev environment
# Local DEV with Vagrant test target boxes
[sonar]
sonar01
[control]
control
[all:vars]
ansible_python_interpreter=/usr/bin/python3
@mattpwest
mattpwest / dbSetup.sh
Created May 17, 2018 10:17
Bash alternative to Ansible PostgreSQL commands
#!/bin/bash
createuser sonar;
echo "ALTER USER sonar WITH ENCRYPTED password '$1'; CREATE DATABASE sonar OWNER sonar; \q" | psql;
@mattpwest
mattpwest / generic.ubuntu.sh
Created May 16, 2018 13:33
Vagrant - Ubuntu 18.04: Ansible target host
cat /vagrant/control.pub >> /home/vagrant/.ssh/authorized_keys
chown -R vagrant:vagrant /home/vagrant/.ssh/
@mattpwest
mattpwest / control.ubuntu.sh
Last active September 2, 2021 07:59
Vagrant - Ubuntu 18.04: Provision Ansible with Python 3
if [ ! -f "/home/vagrant/.ssh/id_rsa" ]; then
ssh-keygen -t rsa -N "" -f /home/vagrant/.ssh/id_rsa
fi
cp /home/vagrant/.ssh/id_rsa.pub /vagrant/control.pub
cat << 'SSHEOF' > /home/vagrant/.ssh/config
Host *
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
@mattpwest
mattpwest / Vagrantfile
Last active August 14, 2022 23:16
Vagrant Infrastructure Test Environment
# -*- mode: ruby -*-
# vi: set ft=ruby :
# README
#
# Getting Started:
# 1. vagrant plugin install vagrant-hostmanager
# 2. vagrant up
# 3. vagrant ssh
#