Ansible in ubuntu

#HelloWorld.yaml

– name: This is a hello-world example
hosts: 127.0.0.1
connection: local
user: root
sudo: yes
tasks:
– name: Create a file called ‘/tmp/testfile.txt’ with the content ‘hello world’.
copy: content=”hello world\n” dest=/tmp/testfile.txt
– name: Hello server
shell: date >> now.txt

#install and ansible –version
#ansible-playbook HelloWorld.yml

Leave a Reply

Your email address will not be published. Required fields are marked *