Git Product home page Git Product logo

ansible-playbook-fuse's Introduction

Fuse Standalone Playbook

About

This Ansible Playbook includes a set of different roles:

  • fuse-standalone: Deploys a set of Red Hat JBoss Fuse Standalone instances on several hosts.
  • fuse-deploy-bundle: Deploys a set of Application Bundles on several hosts.
  • fuse-undeploy-bundle: Undeploys a set of Application Bundles on several hosts.

These roles with the right configuration will allow you to deploy a full complex Red Hat JBoss Fuse environment and automate the most common tasks.

Ansible Requirements

This playbook has tested with the next Ansible versions:

	ansible 2.2.1.0

The playbook has to be executed with root permission, using the root user or via sudo because it will install packages and configure the hosts.

RHEL Subscription Required

This role is prepared to be executed in a RHEL7 Server. Subscription is required to execute the Grant RHEL and Fuse repos enabled task, which enables the required repositories to install Fuse dependencies

Ansible Roles

Host Variables

Each role will use a set of Host Variables defined in the playbook for each host defined in the inventory.

These variables are:

  • esb_name: Logical name to identify each Fuse Instance. Mandatory.
  • port_offset: Port offset to be added to default Fuse ports. Mandatory.
  • nob: Sets that this instance should be a member of a Network of Brokers. Values: (true|false). Optional.
  • esb_type: Identify each Fuse type. This variable will define the final features needed in this instance. The current values permited:
    • full: Full Fuse instance. Default value.
    • noamq: Disable A-MQ features.

These variables should be defined in the playbook as:

	roles:
		# Two Fuse Standalone with a Network of Brokers
		- { role: fuse-standalone, esb_name: 'esb01',  port_offset: '0', nob: 'true' }
		- { role: fuse-standalone, esb_name: 'esb02',  port_offset: '100', nob: 'true' }

fuse-standalone role

This role deploys several Fuse Standalone instances in a set of hosts.

The main tasks done are:

  • Install Fuse prerequisites and set up host
  • Install Fuse binaries
  • Create OS users and OS services
  • Set up different Fuse features: Karaf, Security, A-MQ, Jetty, ...

Red Hat JBoss Fuse binaries should be downloaded from Red Hat Customer Portal (subscription needed). The binaries should be copied into /tmp folder from the host where the playbook will be executed.

Configuration parameters

Role's execution could be configured with the following variables.

  • fuse: Define the Red Hat JBoss Fuse version and patch to install. This values will form the path the the binaries: /tmp/jboss-fuse-karaf-{{ fuse['version'] }}.redhat-{{ fuse['patch'] }}.zip

      # Fuse Version and Patch
      fuse:
      	version: '6.3.0'
      	patch: '254'
    
  • user: OS user to execute the Fuse process.

      # OS User to install/execute Fuse
      user:
      	name: 'fuse'
      	shell: '/bin/bash'
      	homedir: 'True'
    
  • JAVA_HOME: Path to Java Virtual Machine to execute the process.

      # Java Home
      JAVA_HOME: /usr/lib/jvm/jre-1.8.0-openjdk
    
  • FUSE_HOME: Fuse Home path where it will installed each instance. This variable will be defined for each host with a name. This allow installs more instances in the same hosts.

      # Fuse Home
      FUSE_HOME: '/opt/fuse/latest-{{ esb_name }}'
    
  • fuse_users: Users map to be created in each Fuse instance. These users will be stored in {{ FUSE_HOME }}/etc/users.properties file.

      # Fuse Administrative Users
      fuse_users:
      	admin:
      		username: admin
      		password: karaf
      		roles:
      			- admin
      			- SuperUser
    
  • nob_multicast_name: Multicast cluster name to create the Network of Brokers.

      # Network of Brokers Multicast
      nob_multicast_name: default
    

Variables are defined in group_vars/all.yaml file.

Example playbook

To execute this playbook:

ansible-playbook -i hosts fuse-install.yaml

Inventory (host file):

	[fuse-lab-environment]
	rhel7jboss01
	rhel7jboss02
	rhel7jboss03

Playbook (fuse-install.yaml file):

	---
	- name: Fuse Standalone Playbook
		hosts: fuse-lab-environment
		serial: 1
		remote_user: root
		gather_facts: true
		become: yes
		become_user: root
		become_method: sudo
		roles:
			# Two Fuse Standalone with a Network of Brokers
			- { role: fuse-standalone, esb_name: 'esb01',  port_offset: '0', nob: 'true' }
			- { role: fuse-standalone, esb_name: 'esb02',  port_offset: '100', nob: 'true' }

Other alternatives:

  • Two Fuse Standalone without a Network of Brokers:

      roles:
      	- { role: fuse-standalone, esb_name: 'esb01',  port_offset: '0', nob: 'false' }
      	- { role: fuse-standalone, esb_name: 'esb02',  port_offset: '100', nob: 'false' }
    
  • One Fuse Standalone with Full profiles and One Fuse Standalone without A-MQ profile

      roles:
      	- { role: fuse-standalone, esb_name: 'esb01',  port_offset: '0', nob: 'true' }
      	- { role: fuse-standalone, esb_name: 'esb02',  port_offset: '100', esb_type: 'noamq' }
    

fuse-deploy-bundle role

This role deploys several Application Bundles into a set of Fuse Standalone instances.

The main tasks done are:

  • Download artifacts from a Maven Repository Manager
  • Copy artifacts into {{ FUSE_HOME }}/deploy folder
  • Install Features repositories (URL)
  • Install Features from URL list of repositories

Configuration parameters

Role's execution could be configured with the following variables.

  • app_home: Location to store the applications to be deployed before to do it.

      # Applications Home
      app_home: '/opt/fuse/applications'
    
  • maven_repository_manager: Maven Repository location to resolve the artifacts to be deployed.

      # Maven Repository
      maven_repository_manager: http://rhel7jboss01:8081/nexus/content/groups/public
    
  • applications: List of Maven dependencies to be deployed. The artifacts should be located using their GAV coordinates.

      # Application List to deploy
      applications:
      	-
      		groupId: com.redhat.camel
      		artifactId: camel-amq-consumer
      		version: 1.1.0-SNAPSHOT
      	-
      		groupId: com.redhat.camel
      		artifactId: camel-amq-producer
      		version: 1.1.0-SNAPSHOT
      	-
      		groupId: com.redhat.camel
      		artifactId: camel-amq-forwarder
      		version: 1.1.0-SNAPSHOT
    
  • features: List of Features to be deployed. The artifacts should be located using their GAV coordinates. The name attribute defines the name of the feature to install from the list url defined by the GAV coordinates

      features:
      	-
      		groupId: com.redhat.fuse.demo
      		artifactId: fuse-demo-features
      		version: 1.1.0-SNAPSHOT
      		name: fuse-demo-features
    
Example playbook

To execute this playbook:

ansible-playbook -i hosts fuse-deploy-bundle.yaml

Inventory (host file):

	[fuse-lab-environment]
	rhel7jboss01
	rhel7jboss02
	rhel7jboss03

Playbook (fuse-deploy-bundle.yaml file):

	---
	- name: Fuse Deploy Bundles Playbook
		hosts: fuse-lab-environment
		serial: 1
		remote_user: root
		gather_facts: true
		become: yes
		become_user: root
		become_method: sudo
		roles:
			# Deploying Bundles in Two Fuse Standalone
			- { role: fuse-deploy-bundle, esb_name: 'esb01' }
			- { role: fuse-deploy-bundle, esb_name: 'esb02' }

fuse-undeploy-bundle role

This role undeploys several Application Bundles from a set of Fuse Standalone instances.

The main tasks done are:

  • Remove artifacts from {{ FUSE_HOME }}/deploy folder
  • Uninstall Features from URL list of repositories
  • Uninstall Features repositories (URL)

Configuration parameters

Role's execution could be configured with the following variables.

  • maven_repository_manager: Maven Repository location to resolve the artifacts to be deployed.

      # Maven Repository
      maven_repository_manager: http://rhel7jboss01:8081/nexus/content/groups/public
    
  • applications_undeploy: List of Maven dependencies to be undeployed. The artifacts should be located using their GAV coordinates.

      # Application List to undeploy
      applications_undeploy:
      	-
      		groupId: com.redhat.camel
      		artifactId: camel-amq-consumer
      		version: 1.1.0-SNAPSHOT
      	-
      		groupId: com.redhat.camel
      		artifactId: camel-amq-producer
      		version: 1.1.0-SNAPSHOT
      	-
      		groupId: com.redhat.camel
      		artifactId: camel-amq-forwarder
      		version: 1.1.0-SNAPSHOT
    
  • features_undeploy: List of Maven dependencies to be undeployed.

      features_undeploy:
      	-
      		groupId: com.redhat.fuse.demo
      		artifactId: fuse-demo-features
      		version: 1.1.0-SNAPSHOT
      		name: fuse-demo-features
    
Example playbook

To execute this playbook:

ansible-playbook -i hosts fuse-undeploy-bundle.yaml

Inventory (host file):

	[fuse-lab-environment]
	rhel7jboss01
	rhel7jboss02
	rhel7jboss03

Playbook (fuse-undeploy-bundle.yaml file):

	---
	- name: Fuse Undeploy Bundles Playbook
		hosts: fuse-lab-environment
		serial: 1
		remote_user: root
		gather_facts: true
		become: yes
		become_user: root
		become_method: sudo
		roles:
			# Undeploying Bundles in Two Fuse Standalone
			- { role: fuse-undeploy-bundle, esb_name: 'esb01' }
			- { role: fuse-undeploy-bundle, esb_name: 'esb02' }

Main References

ansible-playbook-fuse's People

Contributors

rmarting avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.