This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_version = ">= 0.11.11" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Install Oracle Java version 8 | |
hosts: java | |
become: true | |
tasks: | |
- name: Install dependencies | |
become: yes | |
apt: | |
name: "{{ packages }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Install Jenkins | |
hosts: jenkins-ci | |
gather_facts: false | |
become: true | |
tasks: | |
- name: Ensure the jenkins apt repository key is installed | |
apt_key: | |
url: https://pkg.jenkins.io/debian-stable/jenkins.io.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Install GitLab | |
hosts: gitLab | |
become: true | |
tasks: | |
- name: Checking to make sure postfix is installed | |
apt: | |
name: | |
- postfix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ansible requires Python to be installed on the remote machine as well as the local machine. | |
provisioner "remote-exec" { | |
inline = ["sudo apt-get -qq install python -y"] | |
} | |
connection { | |
private_key = "${file(var.private_key)}" | |
user = "ubuntu" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is where we configure the instance with ansible-playbook | |
# Jenkins requires Java to be installed | |
provisioner "local-exec" { | |
command = <<EOT | |
sleep 30; | |
>java.ini; | |
echo "[java]" | tee -a java.ini; | |
echo "${aws_instance.jenkins-ci.public_ip} ansible_user=${var.ansible_user} ansible_ssh_private_key_file=${var.private_key}" | tee -a java.ini; | |
export ANSIBLE_HOST_KEY_CHECKING=False; | |
ansible-playbook -u ${var.ansible_user} --private-key ${var.private_key} -i java.ini ../playbooks/install_java.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
swagger: '2.0' #version of Swagger | |
info: # High Level information of API | |
description: Sample Swagger Demo #Give the description of API | |
version: 1.0.0 #API version | |
title: Swagger Employee Demo # API title | |
license: #Swagger license info | |
name: Apache 2.0 | |
url: 'http://www.apache.org/licenses/LICENSE-2.0.html' | |
host: localhost # Host Name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl get clusterrolebinding ibm-privileged-psp-users -o yaml > privileged-psp-user.yaml | |
echo "- apiGroup: rbac.authorization.k8s.io" | sudo tee -a privileged-psp-user.yaml | |
echo " kind: Group" | sudo tee -a privileged-psp-user.yaml | |
echo " name: system:serviceaccounts:employee" | sudo tee -a privileged-psp-user.yaml | |
kubectl apply -f privileged-psp-user.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo nano /etc/docker/daemon.json | |
echo "{" | sudo tee -a /etc/docker/daemon.json | |
echo " \"insecure-registries\" : [ \"mycluster.icp:8500\" ]" | sudo tee -a /etc/docker/daemon.json | |
echo "}" | sudo tee -a /etc/docker/daemon.json | |
sudo service docker restart | |
$ docker login mycluster.icp:8500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker tag employee mycluster.icp:8500/employee/employee:v1.0.0 | |
docker push mycluster.icp:8500/employee/employee:v1.0.0 |
OlderNewer