Skip to content

nginx role #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 67 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
4b09a53
inventory
Mar 14, 2020
4c1cd93
yml file
Mar 26, 2020
ef3e021
inventory
Mar 26, 2020
d5703e7
Update hosts
upasna-kanojia Mar 26, 2020
14e9970
Update hosts
upasna-kanojia Mar 26, 2020
4fc89b4
Update hosts
upasna-kanojia Mar 26, 2020
4e9141a
service file
Mar 26, 2020
7c52a37
Merge branch 'master' of https://github.com/upasna-kanojia/spring3hib…
Mar 26, 2020
3e33a92
Update install.yml
upasna-kanojia Mar 26, 2020
1ee3134
Update install.yml
upasna-kanojia Mar 26, 2020
f4e8ad2
Update install.yml
upasna-kanojia Mar 26, 2020
268bf26
Update install.yml
upasna-kanojia Mar 26, 2020
5a76399
Update install.yml
upasna-kanojia Mar 26, 2020
1571f4a
Update install.yml
upasna-kanojia Mar 26, 2020
0f441c6
Update install.yml
upasna-kanojia Mar 26, 2020
2705db2
Update install.yml
upasna-kanojia Mar 26, 2020
42d144c
md format
Mar 27, 2020
1e549c5
Merge branch 'master' of https://github.com/upasna-kanojia/spring3hib…
Mar 27, 2020
e98c44b
screenshots/
Mar 27, 2020
e6184d7
Update Untitled-1.md
upasna-kanojia Mar 27, 2020
8c113db
Update Untitled-1.md
upasna-kanojia Mar 27, 2020
1fff687
slack notification
Mar 27, 2020
2b62526
Merge branch 'master' of https://github.com/upasna-kanojia/spring3hib…
Mar 27, 2020
3ea4228
roles
Apr 7, 2020
af875bc
Update play.yml
upasna-kanojia Apr 7, 2020
d7c3448
Update play.yml
upasna-kanojia Apr 7, 2020
0019679
Update main.yml
upasna-kanojia Apr 7, 2020
a148918
Update main.yml
upasna-kanojia Apr 7, 2020
8176174
Update main.yml
upasna-kanojia Apr 7, 2020
f942773
Update inventory
upasna-kanojia Apr 7, 2020
80225ec
Update main.yml
upasna-kanojia Apr 7, 2020
0966ad6
Update main.yml
upasna-kanojia Apr 7, 2020
2687865
Update main.yml
upasna-kanojia Apr 7, 2020
f19d181
nginx role
Apr 10, 2020
d8177ce
nginx roles
Apr 10, 2020
75417f9
Update inventory
upasna-kanojia Apr 10, 2020
8cdac4b
Update play.yml
upasna-kanojia Apr 10, 2020
d98c203
Update play.yml
upasna-kanojia Apr 10, 2020
0d3738b
Update play.yml
upasna-kanojia Apr 10, 2020
0a0c6e8
playbook
Apr 10, 2020
58cc012
Merge branch 'master' of https://github.com/upasna-kanojia/spring3hib…
Apr 10, 2020
4850e84
Update main.yml
upasna-kanojia Apr 10, 2020
c2fabbd
Update main.yml
upasna-kanojia Apr 10, 2020
fa606d8
tomcat
Apr 11, 2020
306cb05
Merge branch 'master' of https://github.com/upasna-kanojia/spring3hib…
Apr 11, 2020
bd27eff
inv
upasnakanojia Apr 11, 2020
200969e
Merge branch 'master' of https://github.com/upasna-kanojia/spring3hib…
upasnakanojia Apr 11, 2020
a9e6c25
Update inventory1
upasna-kanojia Apr 11, 2020
ff1fbea
Update inventory1
upasna-kanojia Apr 11, 2020
7802cca
Update inventory1
upasna-kanojia Apr 11, 2020
b668e38
Update inventory1
upasna-kanojia Apr 11, 2020
9dd4a97
target/
upasnakanojia Apr 11, 2020
09690dd
Merge branch 'master' of https://github.com/upasna-kanojia/spring3hib…
upasnakanojia Apr 11, 2020
a4d11a4
target
upasnakanojia Apr 11, 2020
455ef60
Update play.yml
upasna-kanojia Apr 13, 2020
78b9692
wordpress docker file
Apr 26, 2020
362a045
wordpress docker
Apr 26, 2020
5da5920
Docker file
Apr 26, 2020
3964fe7
java role
upasnakanojia Apr 29, 2020
7eca6e7
Merge branch 'master' of https://github.com/upasna-kanojia/spring3hib…
upasnakanojia Apr 29, 2020
e69cf0e
sonar-scanner properties
May 3, 2020
dd0f5e7
sonar plugin
upasnakanojia May 26, 2020
de9ed2d
remove
upasnakanojia Jun 2, 2020
0f698eb
Create test
upasna-kanojia Jul 12, 2020
b15f4d9
Create test1
upasna-kanojia Jul 12, 2020
eeed9c0
Set up CI with Azure Pipelines
upasna-kanojia Jul 29, 2020
60ee9f1
Add or update the App Service deployment workflow configuration from …
upasna-kanojia Aug 22, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/master_upasna.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy WAR app to Azure Web App - upasna

on:
push:
branches:
- master

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- name: Set up Java version
uses: actions/setup-java@v1
with:
java-version: '11'

- name: Build with Maven
run: mvn clean install

- name: Deploy to Azure Web App
uses: azure/webapps-deploy@v2
with:
app-name: 'upasna'
slot-name: 'production'
publish-profile: ${{ secrets.AzureAppService_PublishProfile_9edfb83f780b4e65bb1ce6c38404b4c1 }}
package: '${{ github.workspace }}/target/*.war'
25 changes: 14 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
FROM maven:3.3-jdk-8 as builder
COPY . /usr/src/mymaven/
WORKDIR /usr/src/mymaven/
RUN mvn clean package

FROM tomcat:7-jre7-alpine
MAINTAINER "opstree <opstree@gmail.com>"
RUN rm -rf /usr/local/tomcat/webapps/*
COPY --from=builder /usr/src/mymaven/target/Spring3HibernateApp.war /usr/local/tomcat/webapps/ROOT.war
WORKDIR /usr/local/tomcat/webapps/
EXPOSE 8080
FROM wordpress:latest

MAINTAINER upasna

ENV WORDPRESS_DB_HOST: db:3306

ENV WORDPRESS_DB_USER: wordpress

ENV WORDPRESS_DB_PASSWORD: wordpress

ENV WORDPRESS_DB_NAME: wordpress



6 changes: 6 additions & 0 deletions Dockerfile.mysql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM mysql:5.7
MAINTAINER upasna
ENV MYSQL_ROOT_PASSWORD=wordpress
ENV MYSQL_DATABASE=wordpress
ENV MYSQL_USER=wordpress
ENV MYSQL_PASSWORD=wordpress
3 changes: 3 additions & 0 deletions Untitled-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Provisioning:-
**Provision application servers, for example - java, tomcat are required for a java project.**
![](./screenshots/image1.png)
22 changes: 22 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java

trigger:
- master

pool:
vmImage: 'ubuntu-latest'

steps:
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'package'
2 changes: 2 additions & 0 deletions hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[vagrant]
root ansible_host=192.168.0.23 ansible_ssh_pass=root ansible_ssh_user=root
66 changes: 66 additions & 0 deletions install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
- name: java and tomcat installation
hosts: vagrant
become: true
tasks:

- name: Install java
apt:
name: default-jdk

- name: adding tomcat group
group:
name: tomcat
- name: adding tomcat user
user:
name: tomcat
group: tomcat
home: /opt/tomcat
shell: /bin/false
- name: downloading from web & unarchive the file
unarchive:
src: "{{url}}"
dest: /opt/tomcat
remote_src: yes
extra_opts: [--strip-components=1]
vars:
url: http://apachemirror.wuchna.com/tomcat/tomcat-8/v8.5.53/bin/apache-tomcat-8.5.53.tar.gz
- name: listing
command: pwd
register: result
- debug:
msg: "{{result.stdout_lines}}"

- name: Change file permissions
file:
path: /opt/tomcat
mode: '0755'
- name: Changing ownership
file:
path: /opt/tomcat
state: directory
recurse: yes
owner: tomcat
group: tomcat
- name: Set JAVA_HOME
shell: sudo echo "export JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64" >> ~/.bashrc
- name: Source Bashrc
action: shell . ~/.bashrc

- name: listing
command: pwd
register: result
- debug:
msg: "{{result.stdout_lines}}"

- name: service file of tomcat is copied to the target
copy:
src: /root/tomcat.service
dest: /etc/systemd/system/
remote_src: yes
- name: starting the service of tomcat8
systemd:
name: tomcat
state: started
enabled: true
daemon_reload: true
3 changes: 3 additions & 0 deletions inventory1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
192.168.16.15 ansible_ssh_private_key_file=/tmp/ubuntu.pem ansible_ssh_user=ec2-user
192.168.8.119 ansible_ssh_private_key_file=/tmp/ubuntu1.pem ansible_ssh_user=ec2-user

29 changes: 29 additions & 0 deletions java/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
language: python
python: "2.7"

# Use the new container infrastructure
sudo: false

# Install ansible
addons:
apt:
packages:
- python-pip

install:
# Install ansible
- pip install ansible

# Check ansible version
- ansible --version

# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg

script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
38 changes: 38 additions & 0 deletions java/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Role Name
=========

A brief description of the role goes here.

Requirements
------------

Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.

Role Variables
--------------

A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.

Dependencies
------------

A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.

Example Playbook
----------------

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: servers
roles:
- { role: username.rolename, x: 42 }

License
-------

BSD

Author Information
------------------

An optional section for the role authors to include contact information, or a website (HTML is not allowed).
2 changes: 2 additions & 0 deletions java/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# defaults file for java
2 changes: 2 additions & 0 deletions java/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# handlers file for java
53 changes: 53 additions & 0 deletions java/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
galaxy_info:
author: your name
description: your role description
company: your company (optional)

# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker

# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)

min_ansible_version: 2.9

# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:

#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99

galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.

dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

29 changes: 29 additions & 0 deletions java/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
# tasks file for java
- name: Install java
yum:
name: java-1.8.0-openjdk-devel
state: present
become: yes
when: ansible_facts['distribution'] == "CentOS"


- name: Install java
apt:
name: default-jdk
state: present
become: yes
when: ansible_facts['distribution'] == "Ubuntu"



- name: Set JAVA_HOME
shell: sudo echo "export JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64" >> ~/.bashrc



- name: Source Bashrc
action: shell . ~/.bashrc
# shell: source ~/.bashrc


2 changes: 2 additions & 0 deletions java/tests/inventory
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
localhost

5 changes: 5 additions & 0 deletions java/tests/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- java
2 changes: 2 additions & 0 deletions java/vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# vars file for java
2 changes: 2 additions & 0 deletions jen_roles/inventory
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[nginx1]
root ansible_host=172.16.119.132 ansible_user=root
29 changes: 29 additions & 0 deletions jen_roles/java/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
language: python
python: "2.7"

# Use the new container infrastructure
sudo: false

# Install ansible
addons:
apt:
packages:
- python-pip

install:
# Install ansible
- pip install ansible

# Check ansible version
- ansible --version

# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg

script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
Loading