Skip to main content

How to install apache and Tomcat on both master and worker same time by running ansible play book on master machine

Follow the steps

Step-1

1.Take two ubuntu 16.04 machines and enable ssh between them
2.Update host file information on master machine
3.Then do ping test between master and worker machine
4. create apache2.yml playbook

---
- hosts: servers  #server host or group name
  sudo: yes
  tasks:
    - name: install apache2
      apt: name=apache2 update_cache=yes state=latest

    - name: enabled mod_rewrite
      apache2_module: name=rewrite state=present
      notify:
        - restart apache2

  handlers:
    - name: restart apache2
      service: name=apache2 state=restarted


Then run ansible play book on master machine then check on both master and worker machine public ip on browser to confirm apache was installed or not .












Installing Tomcat


After this run play book


Then you can check on browser of both master and worker either tomcat was installed or not

Check on worker side also




Comments

Popular posts from this blog

How to copy files from one server to another server by using ansible copy module

 We have two servers 1.master 2.worker1 create playbook example: play.yml ---   - hosts: all     tasks:     - name: Ansible copy file to remote server       copy:        src: ~/kube-cluster        dest: /root Run ansible playbook  ansible-playbook play.yml

Kubernetes interview questions and answers

1.H ow to setup kubernetes dashboard on ubuntu16.04 cluster? To create kubernetes dashboard follow below link https://docs.aws.amazon.com/eks/latest/userguide/dashboard-tutorial.html To deploy the Metrics Server kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.6/components.yaml kubectl get deployment metrics-server -n kube-system Deploy the dashboard kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml root@ip-172-31-43-76:~# kubectl get svc -n kubernetes-dashboard NAME                        TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)         AGE dashboard-metrics-scraper   ClusterIP   10.102.6.123   <none>        8000/TCP        120m kubernetes-dashboard  ...

Docker with jenkins troubleshooting

1.When a docker machine is integrated with jenkins after running a build it shows unstable for that how you can make trouble shoot? To avoid these permission issues run the following command sudo chmod 666 /var/run/docker.sock 2.What is docker? Docker it is a tool designed to make it easier to create, deploy, and run applications by using containers. 3.What is docker file? A Dockerfile is a text document it contains all the commands a user could call on the command line to assemble an image.  4.what is docker image? Docker images are executable packages that include everything needed to run an application — the code, a runtime, libraries, environment variables, and configuration files. 5.what is container? container it is nothing but a running state of image 6.Docker commands