GithubHelp home page GithubHelp logo

xebialabs-community / xld-ansible-step-plugin Goto Github PK

View Code? Open in Web Editor NEW
2.0 24.0 0.0 19.75 MB

Use an Ansible Module and Deploy Ansible Roles via Playbook as anXLDeploy step,

License: MIT License

FreeMarker 24.86% Python 39.81% Shell 7.14% Batchfile 2.23% HTML 25.97%
xldeploy ansible ansible-playbook xl-deploy

xld-ansible-step-plugin's Introduction

XL Deploy Ansible Step plugin

Build Status License: MIT Github All Releases

Preface

This document describes the functionality provided by the XL Deploy Ansible Step plugin..

See the XL Deploy reference manual for background information on XL Deploy and deployment automation concepts.

Overview

The xld-ansible-step-plugin plugin is a XL Deploy plugin that adds capability to use call Ansible module and roles.

Requirements

  • XL Deploy requirements
    • XL Deploy: version 9.5+

Installation

  • Copy the latest JAR file from the releases page into the XL_DEPLOY|RELEASE_SERVER/plugins directory.
  • Restart the XL Deploy server.

Usage

This plugin provides a new & step that can be used by any rules.

This plugin provides a new deployed to deploy ansible roles.

Step Parameters

Parameter Type Description Required
description String Step description Yes
order integer Step order Yes
modulename String Ansible Module Name Yes
moduleargs String Ansible Module Arguments Yes

Example

This XLDeploy type allow to define Ubuntu package to be deployed on a remote host.

 <type type="ansible.AptPackage" extends="udm.BaseDeployed" deployable-type="ansible.AptPackageSpec" container-type="overthere.Host" description="Deploy a system package using ansible">
    <generate-deployable type="ansible.AptPackageSpec" extends="udm.BaseDeployable"/>
    <property name="kind" default="apt"/>
    <property name="repository" required="false"/>
  </type>

The associated rule is using the step using the apt Ansible Module

 <rule name="ansible.AptPackage.CREATE_MODIFY" scope="deployed">
    <conditions>
      <type>ansible.AptPackage</type>
      <operation>CREATE</operation>
      <operation>MODIFY</operation>
    </conditions>
    <steps>
      <ansible>
        <description expression="true">"Install Package %s on %s" % (deployed.name, deployed.container.name)</description>
        <order>55</order>
        <modulename expression="true">deployed.kind</modulename>
        <moduleargs expression="true">{'name':deployed.name, 'state':'present'}</moduleargs>
      </ansible>
    </steps>
  </rule>

The rule to add a new apt ppa repository still using the apt_repository Ansible Module

 <rule name="ansible.AptPackage.CREATE_MODIFY_if_repository" scope="deployed">
    <conditions>
      <type>ansible.AptPackage</type>
      <operation>CREATE</operation>
      <operation>MODIFY</operation>
      <expression>deployed.repository is not None</expression>
    </conditions>
    <steps>
      <ansible>
        <description expression="true">"Add Repository Manager %s on %s" % (deployed.name, deployed.container.name)</description>
        <order>52</order>
        <modulename>apt_repository</modulename>
        <moduleargs expression="true">{'repo':deployed.repository, 'state':'present'}</moduleargs>
      </ansible>
    </steps>
  </rule>

overview

preview

ansible-controler

Step Parameters

Parameter Type Description Required
description String Step description Yes
order integer Step order Yes
roles String Ansible roles Yes
variable String Ansible Variable to pass to the roles Yes

Deploy ansible.Roles

This plugin includes a new CI ansible.Roles allowing to apply a set of Ansible roles to overthere.Hosts. if the Ansible roles includes a generation of YAML devops as code content, the plugin can apply the content to add the provisioned item to the current environment. To trigger this feature, the includeDevOpsAsCodeTask should be the set to True and the roles should includes a template generation, you have an exemple here: template and its usage in the role

xld-ansible-step-plugin's People

Contributors

ndebuhr avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xld-ansible-step-plugin's Issues

Missing python module "overtherepy"

Hi, I just installed xld-ansible-step-plugin-1.1.0-rc.7.xldp - Using XLD Server version: 9.5.1 (docker edition) and got an error when connecting to controller. Missing a module.

Is this something I need to add to the default XLD docker container? Or a bug in this code?

Error while executing script [upload_ssk_key.py]: ImportError: No module named overtherepy in <script> at line number 11
com.xebialabs.platform.script.jython.JythonException: Error while executing script [upload_ssk_key.py]: ImportError: No module named overtherepy in <script> at line number 11
at com.xebialabs.platform.script.jython.JythonException$.apply(JythonException.scala:17)
at com.xebialabs.platform.script.jython.JythonSupport.$anonfun$executeScript$3(JythonSupport.scala:60)
at com.xebialabs.platform.script.jython.JythonSupport.withThreadLocalWriter(JythonSupport.scala:67)
at com.xebialabs.platform.script.jython.JythonSupport.executeScript(JythonSupport.scala:56)
at com.xebialabs.platform.script.jython.JythonSupport.executeScript$(JythonSupport.scala:53)
at com.xebialabs.deployit.plugin.steps.JythonStep$$anon$1.executeScript(JythonStep.scala:29)
at com.xebialabs.platform.script.jython.JythonSupport.executeScript(JythonSupport.scala:50)
at com.xebialabs.platform.script.jython.JythonSupport.executeScript$(JythonSupport.scala:44)
at com.xebialabs.deployit.plugin.steps.JythonStep$$anon$1.executeScript(JythonStep.scala:29)
at com.xebialabs.deployit.plugin.steps.JythonStep.executeScript(JythonStep.scala:67)
at com.xebialabs.deployit.plugin.steps.JythonStep.execute(JythonStep.scala:58)
at com.xebialabs.deployit.engine.tasker.StepExecutingActor.$anonfun$executeStep$3(StepExecutingActor.scala:144)
at com.xebialabs.deployit.engine.tasker.MdcUtils$.withMdc(MdcUtils.scala:16)
at com.xebialabs.deployit.engine.tasker.StepExecutingActor.$anonfun$executeStep$2(StepExecutingActor.scala:134)
at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:658)
at scala.util.Success.$anonfun$map$1(Try.scala:255)
at scala.util.Success.map(Try.scala:213)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:292)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:33)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:92)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:92)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.script.ScriptException: ImportError: No module named overtherepy in <script> at line number 11
at org.python.jsr223.PyScriptEngine.scriptException(PyScriptEngine.java:222)
at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:59)
at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:31)
at com.xebialabs.platform.script.jython.JythonSupport.$anonfun$executeScript$3(JythonSupport.scala:57)
... 28 more
Caused by: Traceback (most recent call last):
File "<script>", line 11, in
ImportError: No module named overtherepy
at org.python.core.Py.ImportError(Py.java:334)
at org.python.core.imp.import_first(imp.java:879)
at org.python.core.imp.import_module_level(imp.java:964)
at org.python.core.imp.importName(imp.java:1057)
at org.python.core.ImportFunction.call(builtin.java:1280)
at org.python.core.PyObject.call(PyObject.java:450)
at org.python.core.builtin.import(builtin.java:1232)
at org.python.core.imp.importFromAs(imp.java:1149)
at org.python.core.imp.importFrom(imp.java:1124)
at org.python.pycode._pyx1634.f$0(<script>:29)
at org.python.pycode._pyx1634.call_function(<script>)
at org.python.core.PyTableCode.call(PyTableCode.java:171)
at org.python.core.PyCode.call(PyCode.java:18)
at org.python.core.Py.runCode(Py.java:1614)
at org.python.core.builtin.eval(builtin.java:497)
at org.python.core.builtin.eval(builtin.java:501)
at org.python.util.PythonInterpreter.eval(PythonInterpreter.java:259)
at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:57)
... 30 more

NPE when the ansibleController is assigned in the planning rule.

2020-04-29 15:47:01.751 [task-sys-xl.task.dispatchers.state-management-dispatcher-50] {taskId=6a5867c8-9b89-4fa8-8b89-7093c0dd65af, username=admin} ERROR c.x.d.plugin.steps.OsScriptStep - Step failed java.lang.NullPointerException: null at com.xebialabs.overthere.CmdLineArgument.encodeString(CmdLineArgument.java:111) at com.xebialabs.overthere.CmdLineArgument$Basic.buildString(CmdLineArgument.java:180) at com.xebialabs.overthere.CmdLine.toCommandLine(CmdLine.java:178) at com.xebialabs.deployit.plugin.steps.TargetHostSupport.executeCommand(TargetHostSupport.scala:73) at com.xebialabs.deployit.plugin.steps.TargetHostSupport.executeCommand$(TargetHostSupport.scala:69) at com.xebialabs.deployit.plugin.steps.OsScriptStep.executeCommand(OsScriptStep.scala:19) at com.xebialabs.deployit.plugin.steps.OsScriptStep.executeScript(OsScriptStep.scala:107) at com.xebialabs.deployit.plugin.steps.OsScriptStep.executeOnTargetHost(OsScriptStep.scala:66) at com.xebialabs.deployit.plugin.steps.OsScriptStep.executeOnTargetHost(OsScriptStep.scala:58) at com.xebialabs.deployit.plugin.steps.TargetHostSupport.execute(TargetHostSupport.scala:47) at com.xebialabs.deployit.plugin.steps.TargetHostSupport.execute$(TargetHostSupport.scala:44) at com.xebialabs.deployit.plugin.steps.OsScriptStep.execute(OsScriptStep.scala:19) at com.xebialabs.deployit.engine.tasker.StepExecutingActor.$anonfun$executeStep$3(StepExecutingActor.scala:144) at com.xebialabs.deployit.engine.tasker.MdcUtils$.withMdc(MdcUtils.scala:16) at com.xebialabs.deployit.engine.tasker.StepExecutingActor.$anonfun$executeStep$2(StepExecutingActor.scala:134) at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:658)

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.