Skip to main content

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






Comments

Post a Comment

Popular posts from this blog

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  ...

Jenkins interview questions and answers

1. In Jenkins I have a 3 jobs like env , uat , prod Case 1 If trigger a job 'env', based on condition it go-to 'uat 'job and trigger job Case2 trigger a job 'env', based on condition it go-to 'prod' job and trigger job How to write job freestyle or pipeline? A. Install build pipe line plugin Then click on plus symbol in that view name give Buildpipelinetest select .Build Pipeline View then click on ok. under select Upstream / downstream config   Select Initial Job as env Then next select similarly uat and next prod then these three will be chain linked and each one build one by one if one becomes success.