Skip to content

Commit

Permalink
rampup stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
keltik85 committed Feb 7, 2017
1 parent a0cb225 commit abac287
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
falcon.yml
1 change: 1 addition & 0 deletions localhost/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.retry
3 changes: 3 additions & 0 deletions localhost/files/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
echo "Hello World!";
?>
42 changes: 42 additions & 0 deletions localhost/install_stuff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
- hosts: localhost
connection: local
tasks:
- ping:
- apt: name=apache2 state=latest
register: installed_apache2
- apt: name=apache2-doc state=latest
register: installed_apache2Doc
- apt: name=libapache2-mod-php state=present
register: installed_php
- copy: src=files/index.php dest=/var/www/html/index.php mode=0777
- service: name=apache2 state=restarted enabled=yes
when: installed_apache2.changed == True or installed_apache2Doc.changed == True or installed_php.changed == True
- shell: curl localhost/index.php
- apt: deb=https://atom.io/download/deb
- apt: name="{{item}}" state=latest
with_items:
- virtualbox
- virtualbox-qt
- virtualbox-dkms
- apt: deb=http://releases.hashicorp.com/vagrant/1.9.1/vagrant_1.9.1_x86_64.deb
- apt: name=mtpaint state=latest
- tomcat:
tags: testcustommodule
- apt: deb=https://download.teamviewer.com/download/teamviewer_i386.deb
tags: teamviewer
- apt: name=php-mysqli state=latest
tags: mysql

# Create a ext2 filesystem on /dev/sdb1.
# - filesystem:
# fstype: ext2
# dev: /dev/sdb1

#download jdk
#unzip it
#set JAVA_HOME

#download eclipse neon
#unzip it
#make shortcut to menu
17 changes: 17 additions & 0 deletions localhost/library/tomcat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/python
from ansible.module_utils.basic import *
from subprocess import check_output


def main():
module = AnsibleModule(argument_spec={})

cmd = "ps -ef | grep tomcat"
ps = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
x = ps.communicate()[0]

module.exit_json(changed=False, msg=x)


if __name__ == '__main__':
main()
120 changes: 120 additions & 0 deletions localhost/sonar_qube_stuff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
- hosts: localhost
connection: local
tasks:
### based on http://dev.mamikon.net/installing-sonarqube-on-ubuntu/
- apt: pkg=python-pip state=present
- apt: name=python-setuptools state=latest
- apt: name=python-dev state=present
- apt: name=libmysqlclient-dev state=latest
- pip: name=MySQL-python
- mysql_db:
name: sonar
state: present
login_host: localhost
login_port: 3306
login_user: root
login_password: root
encoding: utf8
collation: utf8_general_ci

# check if user exists
- shell: mysql -u root -e 'select user from mysql.user where User = "sonar";'
environment:
MYSQL_PWD: root
register: result

# create the user, the stupid "mysql_user" module does not suport "when" and "register"
- mysql_user:
name: sonar
password: sonar
state: present
login_host: localhost
login_port: 3306
login_user: root
login_password: root

# only do it if user did not exists before
- shell: mysql -u root -proot -e 'GRANT ALL ON sonar.* TO "sonar"@"%" IDENTIFIED BY "sonar";'
environment:
MYSQL_PWD: root
when: "'\nsonar' not in '{{result.stdout}}'"

# only do it if user did not exists before
- shell: mysql -u root -e 'GRANT ALL ON sonar.* TO "sonar"@"localhost" IDENTIFIED BY "sonar";'
environment:
MYSQL_PWD: root
when: "'\nsonar' not in '{{result.stdout}}'"

# only do it if user did not exists before
- shell: mysql -u root -e 'FLUSH PRIVILEGES;'
environment:
MYSQL_PWD: root
when: "'\nsonar' not in '{{result.stdout}}'"

- get_url:
url: "https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-5.6.4.zip"
dest: /mnt/hdd2/sonarqube-5.6.4.zip
mode: 0777

- unarchive:
src: /mnt/hdd2/sonarqube-5.6.4.zip
dest: /mnt/hdd2

- lineinfile:
dest: /mnt/hdd2/sonarqube-5.6.4/conf/sonar.properties
line: 'sonar.jdbc.username=sonar'

- lineinfile:
dest: /mnt/hdd2/sonarqube-5.6.4/conf/sonar.properties
line: 'sonar.jdbc.password=sonar'

- lineinfile:
dest: /mnt/hdd2/sonarqube-5.6.4/conf/sonar.properties
line: 'sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance'

- lineinfile:
dest: /mnt/hdd2/sonarqube-5.6.4/conf/sonar.properties
line: 'sonar.web.host=127.0.0.1'

- lineinfile:
dest: /mnt/hdd2/sonarqube-5.6.4/conf/sonar.properties
line: 'sonar.web.context=/sonar'

- lineinfile:
dest: /mnt/hdd2/sonarqube-5.6.4/conf/sonar.properties
line: 'sonar.web.port=9000'

- get_url:
url: "https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-2.8.zip"
dest: /mnt/hdd2/sonar-scanner-2.8.zip
mode: 0777

- unarchive:
src: /mnt/hdd2/sonar-scanner-2.8.zip
dest: /mnt/hdd2

- lineinfile:
dest: /mnt/hdd2/sonar-scanner-2.8/conf/sonar-scanner.properties
line: 'sonar.host.url=http://localhost:9000/sonar'

- lineinfile:
dest: /mnt/hdd2/sonar-scanner-2.8/conf/sonar-scanner.properties
line: 'sonar.sourceEncoding=UTF-8'

- lineinfile:
dest: /mnt/hdd2/sonar-scanner-2.8/conf/sonar-scanner.properties
line: 'sonar.jdbc.username=sonar'

- lineinfile:
dest: /mnt/hdd2/sonar-scanner-2.8/conf/sonar-scanner.properties
line: 'sonar.jdbc.password=sonar'

- lineinfile:
dest: /mnt/hdd2/sonar-scanner-2.8/conf/sonar-scanner.properties
line: 'sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&amp;characterEncoding=utf8'

####start the sonar server by: "sudo /mnt/hdd2/sonarqube-5.6.4/bin/linux-x86-64/sonar.sh start"
####stop : "sudo /mnt/hdd2/sonarqube-5.6.4/bin/linux-x86-64/sonar.sh stop"
####check sonar-scanenr install: "/mnt/hdd2/sonar-scanner-2.8/bin/sonar-scanner -v"
#mysql -u root -proot -e 'show databases;'
1 change: 1 addition & 0 deletions localhost/sysinfo_stuff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# examine disk space

0 comments on commit abac287

Please sign in to comment.