Skip to content

Instantly share code, notes, and snippets.

version: '3'
services:
distro:
image: alpine
container_name: Alpine_Distro
restart: always
entrypoint: tail -f /dev/null
database:
image: postgres:latest
---
- hosts: webservers
tasks:
- name: Make sure that we can connect to the machine
ping:
- name: Stop Tomcat
shell: /opt/apache-tomcat-8.5.88/bin/shutdown.sh
- name: Remove Tomcat
---
- hosts: webservers
vars:
- appName: java-example.war
tasks:
- name: copy war
get_url: url=https://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/sample.war dest=/opt/tomcat/webapps/{{ appName }} owner=tomcat group=tomcat mode=0744
---
- hosts: webservers
vars:
- http_port: 8080
- tomcat_version: 8.5.83
tasks:
- name: JDK Installation
apt:
name: default-jdk
@anujdevopslearn
anujdevopslearn / mysql.yml
Last active May 17, 2024 23:16
MySQL Ansible Installation Script
- hosts: webservers
tasks:
- name: Install MySQL
action: apt pkg={{ item }} state=latest
with_items:
- libmysqlclient-dev
- python-mysqldb
- mysql-server
- mysql-client
@anujdevopslearn
anujdevopslearn / apache.yml
Last active May 17, 2024 23:16
Apache Ansible Installation Script
---
- hosts: development
tasks:
- name: Install apache2 package
apt: name=apache2 update_cache=yes state=latest
- name: Enable Mod Rewrite
apache2_module: name=rewrite state=present
- name: Restart Service