Ansible Notes – Aug Batch Online – Notes – Day -5

DevOps

MOTOSHARE 🚗🏍️
Turning Idle Vehicles into Shared Rides & Earnings

From Idle to Income. From Parked to Purpose.
Earn by Sharing, Ride by Renting.
Where Owners Earn, Riders Move.
Owners Earn. Riders Move. Motoshare Connects.

With Motoshare, every parked vehicle finds a purpose. Owners earn. Renters ride.
🚀 Everyone wins.

Start Your Journey with Motoshare
Vars
Faq
Cond
Looping
----------------
Templates
	
Handlers
Roles


---
- name: Update web servers
  hosts: localhost
  vars:
    myname: "Rajeshkumar"
    age: "18"
    packagename: "apache2"
    servicename: "apache2"

  tasks:
  - name: Install Apache in ubuntu
    ansible.builtin.apt:
      name: "{{ packagename }}"
      state: latest
  - name: Copy index.html
    ansible.builtin.copy:
      src: index.html
      dest: /var/www/html/index.html
  - name: Starting a Apache Server
    ansible.builtin.service:
      name: "{{ servicename }}"
      state: started
  - name: Print return information from the previous task
    ansible.builtin.debug:
      var: myname
  - name: Template index.html
    template:
      src: index.html.j2
      dest: /var/www/html/index-template.html











---
- name: Update web servers
  hosts: localhost
  vars:
    myname: "Rajesh Kumar"
    port: 81

  tasks:
  - name: Install Apache in Ubuntu
    ansible.builtin.apt:
      name: apache2
      state: latest
  - name: Copy index.html
    ansible.builtin.copy:
      src: index.html
      dest: /var/www/html/index.html
  - name: Template for httpd.conf
    template:
      src: ports.conf.j2
      dest: /etc/apache2/ports.conf
    notify:
      - ReStarting a Apache Server
  - name: Starting a Apache Server
    ansible.builtin.service:
      name: apache2
      state: started

  handlers:
  - name: ReStarting a Apache Server
    ansible.builtin.service:
      name: apache2
      state: restarted
=============================================================


Roles
=================================
diretory layout
	vars
	tasks
	template
	files
	handlers



site.yaml

---
- name: Update web servers
  hosts: localhost

  roles:
    - web
    - geerlingguy.java

==================================
Tower
---------------------------





Code language: JavaScript (javascript)
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x