1)Ping
2)File
3)Copy
4)yum
5)setup
6)user
7)lineinfile
8)template
9)service
10)debug
11)git
12)cli_config
13)archive
14)command
Playbook 1) Install httpd and start the service
---
- name: install httpd
hosts: all
become: true
tasks:
- name: Install httpd package
yum:
name: httpd
state: installed
notify: start httpd service
handlers:
- name: start httpd service
service:
name: httpd
state: started
2)
Ansible Bastion - SSH to remote hosts using Bastion | Devops Junction (middlewareinventory.com)
Ansible Playbook Examples - Sample Ansible Playbooks | Devops Junction (middlewareinventory.com)
---
- name: Ansible archive Examples
user: vagrant
hosts: testserver
tasks:
- name: Compress Directory contents
become: yes
archive:
path: /apps/tomcat
dest: /apps/tomcat.tar
format: tar
---
- name: Ansible archive Examples
user: vagrant
hosts: testserver
tasks:
- name: Compress Directory contents
become: yes
archive:
path: /apps/tomcat
dest: /apps/tomcat.tar.gz
format: gz
---
- name: Ansible archive Examples
user: vagrant
hosts: testserver
tasks:
- name: Compress Directory contents
become: yes
archive:
path: /apps/tomcat
dest: /apps/tomcat.tar.gz
format: gz
---
- name: Ansible archive Examples
user: vagrant
hosts: testserver
tasks:
- name: Compress the file and remove
become: yes
archive:
path: /apps/tomcat/logs/localhost-access.log
dest: /apps/tomcat/localhost-access.log.gz
remove: yes
Thanks for providing this information
ReplyDeletePower BI Course
Power BI Online Training