Ansible Role for installing Maven on Ubuntu
cd ~/rolessudo vi aws-infra-role/tasks/installMaven.yml
- name: Install Maven using Ansible
become: yes
apt:
name: "{{ packages }}"
state: present
vars:
packages:
- maven
Modify Ansible main playbook
sudo vi aws-infra-role/setup-jenkins.yml
---
# This Playbook creates infra in aws cloud
- hosts: My_Group
gather_facts: False
tags: jenkins creation
tasks:
- include: tasks/installJava11.yml
- include: tasks/installMaven.yml
Execute Ansible Role
ansible-playbook aws-infra-role/setup-jenkins.yml
No comments:
Post a Comment