Giter VIP home page Giter VIP logo

ansible-plugin's Introduction

Gitter Read more about Rundeck + Ansible

Please report any errors or suggestions!

MIGRATION NOTICE!!

In March of 2022 PagerDuty transferred this repo to the Rundeck Plugins organization. frozenice has done a wonderful job bringing this functionality to the Rundeck Community and has asked Rundeck to take over maintenance going forward. The move will allow us to better manage Issues and approve/merge Pull Requests, etc. The plugin will continue to be available to the Open Source community. Over the next few months our team will review all open PRs and merge or provide feedback/review comments as necessary.

Rundeck Ansible Plugin

This plugin brings basic Ansible support to Rundeck. It imports hosts from Ansible's inventory, including a bunch of facts, and can run modules and playbooks. There is also a node executor and file copier for your project.

No SSH-Keys need to be shared between Ansible and Rundeck (but can be), everything is run through either ansible or ansible-playbook (even the node import).

If you just want to give Rundeck and Ansible a quick try, check the Docker container instructions.

Components

The following bits are included:

Resource Model Source

Uses the default configured inventory to scan for nodes. Facts are discovered by default, but you can turn that off (although I highly recommend leaving it on).

Host groups are imported as tags, you can limit the import to just some selected patterns, if you want.

A bunch of facts are imported as attributes, e.g.:

Example of node attributes being automatically set by Ansible facts

Node Executor

This makes it possible to run commands via the "Commands" menu or the default "Command" node step in a job.

The command is passed to Ansible's shell module. You can specify which shell to use in the project settings.

File Copier

Enables usage of the default "Copy File" and (in combination with the above) "Script" node steps.

Files are transferred using Ansible's copy module.

Run Ansible Modules

Run any Ansible module! You can specify the module name and arguments.

Run Ansible Playbooks

Run a playbook as a node or workflow step (see note above). You can specify either a path to a playbook file (which must be accessible to Rundeck), or write an inline playbook.

Configuration

The Job Configuration, node, project and framework attributes can be used to customize how jobs are executed. On every run, the plugin will try to resolve the value associated with each ansible configuration by checking the configuration attributes in the following order:

  • If the attribute is defined for the job
  • else if the attribute is defined for the node (Only for node executor)
  • else if the attribute is defined at the project level
  • else if the attribute is defined at the framework level

Note that Node attributes are only evaluated for Node Executor jobs, Workflow Jobs (Playbook and Module) use only job configurations, and project/framework configurations.

The following configuration attributes can be set on the Node, or in the project.properties or framework.properties. To add them to project.properties, prefix them with "project." and for framework.properties prefix them with "framework.":

  • ansible-inventory - Specifies the ansible inventory to use, can define a global inventory file at the project level without requiring setting the same variable for each job. It is also possible to provide an inventory inline to a job. The default is /etc/ansible/hosts.
  • ansible-executable - The executable to use for node Node Executor. (default /bin/sh)
  • ansible-limit - Global groups limits can be set at the project level to filter hosts/groups from the Ansible inventory. See http://docs.ansible.com/ansible/intro_patterns.html for syntax help.
  • ansible-vault-path - Default vault file path to use for Playbook Jobs.
  • ansible-vault-storage-path - Specifies a Key Storage Path to look up the ansible vault password from. If specified, it will be used instead of the ansible-vault-path.
  • ansible-ssh-auth-type - Type of authentication to use, "password" or "privatekey", default: "privatekey".
  • ansible-ssh-user - Ansible ssh User to user. (default rundeck)
  • ansible-ssh-password-option - Specifies a Secure Authentication Option from a Job to use as the authentication password. (format: "NAME" ). This option take precedence over ansible-ssh-password-storage-path
    • default-value: "ansible-ssh-password", so simply define a Secure Authentication Option on your Job with the name "ansible-ssh-password".
  • ansible-ssh-password-storage-path - Specifies a Key Storage Path to look up the authentication password from.
  • ansible-ssh-timeout - Ansible ssh timeout, default: 10.
  • ansible-ssh-keypath - Specifies the path the ssh private key to use as the authentication privatekey.
  • ansible-ssh-key-storage-path - Specifies a Secure Authentication Option from a Job to use as the authentication privatekey, This option take precedence over ansible-ssh-keypath.
  • ansible-become - Specifies whether to use becaume or not for Ansible jobs and Node Executor, default: "false".
  • ansible-become-user - Ansible default become user.
  • ansible-become-method - Specifies the become method to use, "sudo" or "su", default: "sudo".
  • ansible-become-password-option - Specifies a Secure Authentication Option from a Job to use for become. (format: "NAME" ). If specified, it will be used instead of the ansible-become-password-storage-path.
    • default-value: "ansible-become-password", so simply define a Secure Authentication Option on your Job with the name "ansible-become-password".
  • ansible-become-password-storage-path - Specifies a Key Storage Path to look up the become password from.

Password authentication can be performed in one of two ways:

  1. Create a Rundeck Job with a Secure Authentication Option, to pass in the password to use. The default name of this option should be "ansible-ssh-password", but you can change the name that is expected, if necessary.
  2. Use the Rundeck Key Storage Facility to store a password, and use the path to it as the ansible-ssh-password-storage-path Note that the first takes precedence in evaluation over the second.

Private Key authentication can be performed by using a full path to the ssh private key (make sure the file is owned by rundeck and access permissions are set to 0600) or using Key Storage Facility to store a private key.

Become password configuration is very similar to ssh password, you can use either Secure Authentication Option, the default option name should be "ansible-become-password" or use Key Storage Facility to store a password, and use the path to it as the ansible-become-password-storage-path. Also for become password just like ssh password the first takes precedence in evaluation over the second.

Requirements

  • Ansible >= 1.7
  • Ansible executables in $PATH of Rundeck user
  • Rundeck user needs to be able to successfully run Ansible commands, that includes access to Ansible's config files and keys - it depends on your setup (whether you installed via .deb or launcher etc.)
    • You can check if everything works with something like this: su rundeck -s /bin/bash -c "ansible all -m ping"
    • If it complains, chances are that your rundeck $HOME directory isn't writable by Rundeck, fix it with e.g. chown rundeck /var/lib/rundeck (see this issue)
    • Another thing, if you have a special setup: Rundeck's environment might be missing some things, if you are using su or similar to start rundeck - maybe you need to tell it to use a login shell via -l (see this issue)
    • If you are running CentOS 6.7 or similar (RHEL) or another system using SELinux, you may need to install libselinux-python (yum install libselinux-python) or disable SELinux on boot (see this issue)

Installation

  • Download the .jar file from GitHub or compile it yourself (using Gradle, either your own the included wrapper)
  • Copy the .jar file to your Rundeck plugins directory (/var/lib/rundeck/libext if you installed the .deb, for example)
  • Create a new project (this assumes you want every node in your project to be controlled via Ansible)
  • Choose "Ansible Resource Model Source" as the resource model source
  • Choose "Ansible Ad-Hoc Node Executor" as the default node executor
  • Choose "Ansible File Copier" as the default node file copier
  • Save, it can take a short time to import all the nodes, depending on your fleet
  • You're all set! Try running a command

Debugging

If anything goes wrong you can enable debugging for all components. Just enable the DEBUG log level for your jobs and add a Java system property named ansible.debug with the value true. You can do that for example in /etc/rundeck/profile, make sure to restart your rundeck service.

This will print extra info either in some logs (e.g. /var/log/rundeck/service.log) or the web console. If you file an issue, make sure to include as much information in your report as you can.

Contributing

Discussions and pull requests are welcome.

ansible-plugin's People

Contributors

aboehm avatar ahormazabal avatar amartin3225 avatar cityofships avatar darwisnarvaezdev avatar derektbrown avatar dxc-martin-aksel-jensen avatar erikasm avatar fdevans avatar flothinkspi avatar frozenice avatar gardar avatar ggwena avatar gschueler avatar jacobamey avatar johnnys66 avatar josemaia avatar l2je avatar ltamaster avatar mcassaniti avatar pierrecarre avatar qualman avatar rklomp avatar simon-c-msc avatar simon-cto avatar sjrd218 avatar tanji avatar targuan avatar unsignedlong avatar yassineazzouz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ansible-plugin's Issues

Working directory configuration option

I recently got my hands on rundeck and ansible. I could successfully setup the basic job to run ansible playbook using this plugin. I found these two things can be improved

  • Project configuration option for specifying inventory file (I guess this issue already reported). Though I manage to get it worked using -i flag in extra args input so plugin could generate the node lists. But same inventory file always has be filled while defining job steps. It would be great if plugin automatically takes default args from project configuration or any other better solution.
  • Working directory: I couldn't found any way in plugin configuration or rundeck configuration to specify working directory for the job run. So if my playbook is in some random location like /abc/xyz/opq/site.yml it could not run successfully. I end up writing angular wrapper which tries to find project root and switch the working directory. (https://gist.github.com/inabhi9/9da3ac8d752f57f162cf7c3b80d450c8)

Thanks for the great work!

Using /etc/ansible/ansible.cfg as config fileERROR! Specified --limit does not match any hosts

on my first installations of the plugin

i get the follogwing errro if i try to run a job, either with the module or playbook "module"
can someone point me to something? i am clueless.

thanks alot!

13:56:50                  [workflow] Begin step: 1,NodeDispatch
13:56:50            1: Workflow step executing: StepExecutionItem{type='NodeDispatch', keepgoingOnSuccess=false, hasFailureHandler=false}
13:56:50            preparing for sequential execution on 1 nodes
13:56:50            Executing command on node: doit, NodeEntryImpl{tags=[], attributes={nodename=doit, hostname=doit.rocketbase.de, osVersion=3.13.0-32-generic, osFamily=unix, osArch=amd64, description=Rundeck server node, osName=Linux, username=ste}, project='null'}
13:56:50            [workflow] beginExecuteNodeStep(doit): NodeDispatch: StepExecutionItem{type='NodeDispatch', keepgoingOnSuccess=false, hasFailureHandler=false}
13:56:50            Using /etc/ansible/ansible.cfg as config fileERROR! Specified --limit does not match any hosts
13:56:50            [workflow] finishExecuteNodeStep(doit): NodeDispatch: AnsibleNonZero: Ansible exited with non-zero code.
13:56:50            1: Workflow step finished, result: Dispatch failed on 1 nodes: [doit: AnsibleNonZero: Ansible exited with non-zero code.]
13:56:50            [workflow] Finish step: 1,NodeDispatch
13:56:50            [workflow] Finish execution:  rundeck-workflow-node-first: [Workflow result: , step failures: {1=Dispatch failed on 1 nodes: [doit: AnsibleNonZero: Ansible exited with non-zero code.]}, Node failures: {doit=[AnsibleNonZero: Ansible exited with non-zero code.]}, status: failed]
13:56:50            [Workflow result: , step failures: {1=Dispatch failed on 1 nodes: [doit: AnsibleNonZero: Ansible exited with non-zero code.]}, Node failures: {doit=[AnsibleNonZero: Ansible exited with non-zero code.]}, status: failed]
13:56:50            Execution failed: 134: [Workflow result: , step failures: {1=Dispatch failed on 1 nodes: [doit: AnsibleNonZero: Ansible exited with non-zero code.]}, Node failures: {doit=[AnsibleNonZero: Ansible exited with non-zero code.]}, status: failed]

Can I make this work Rundeck Ansible for below scenario

Question : We have a ansible setup to deploy multiple applications and each application in inventory has upto 10 servers(parallel execution) using playbook for each app. Can I run multiple playbooks parallel(i.e multiple apps parallel) to reduce my deploy time using rundeck and ansible plugin.

Inconsistent inventory in Resource Model Source and Jobs

Hi @frozenice ,

I came across an issue when configuring a custom inventory files at the project level, the jobs does not take that into consideration, so the same parameter need to be added in all jobs definition in order for it to work. for instance if I set an extra argument : '-i /path/to/custom/inventory' in Resource Model Source configuration, the same argument need to be added in all jobs in that project which is kind of confusing since most people will think that what they put in their project configuration (for host gathering) will be used for all Jobs.

I suggest adding a new option for the inventory in "Ansible Resource Model Source" that defaults to empty (/etc/ansible/hosts) then use that same inventory file for all Jobs defined for that project.

What do you think ?

After many jobs were done, got error: "Too many open files"

The error log

2016-03-23 11:28:24,041 [Thread-488] ERROR com.dtolabs.rundeck.core.execution.workflow.steps.node.NodeStepPluginAdapter - Error executing node step.
com.dtolabs.rundeck.core.execution.workflow.steps.node.NodeStepException: Error running Ansible.
at com.batix.rundeck.AnsibleModuleNodeStep.executeNodeStep(AnsibleModuleNodeStep.java:32)
at com.dtolabs.rundeck.core.execution.workflow.steps.node.NodeStepPluginAdapter.executeNodeStep(NodeStepPluginAdapter.java:106)
at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.executeNodeStep(ExecutionServiceImpl.java:149)
at com.dtolabs.rundeck.core.execution.dispatch.SequentialNodeDispatcher.dispatch(SequentialNodeDispatcher.java:116)
at com.dtolabs.rundeck.core.execution.dispatch.SequentialNodeDispatcher.dispatch(SequentialNodeDispatcher.java:58)
at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.dispatchToNodes(ExecutionServiceImpl.java:177)
at com.dtolabs.rundeck.core.execution.workflow.steps.NodeDispatchStepExecutor.executeWorkflowStep(NodeDispatchStepExecutor.java:66)
at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.executeStep(ExecutionServiceImpl.java:116)
at com.dtolabs.rundeck.core.execution.workflow.BaseWorkflowStrategy.executeWFItem(BaseWorkflowStrategy.java:225)
at com.dtolabs.rundeck.core.execution.workflow.BaseWorkflowStrategy.executeWorkflowItemsForNodeSet(BaseWorkflowStrategy.java:303)
at com.dtolabs.rundeck.core.execution.workflow.BaseWorkflowStrategy.executeWorkflowItemsForNodeSet(BaseWorkflowStrategy.java:258)
at com.dtolabs.rundeck.core.execution.workflow.StepFirstWorkflowStrategy.executeWorkflowImpl(StepFirstWorkflowStrategy.java:79)
at com.dtolabs.rundeck.core.execution.workflow.BaseWorkflowStrategy.executeWorkflow(BaseWorkflowStrategy.java:182)
at com.dtolabs.rundeck.core.execution.workflow.NodeFirstWorkflowStrategy$DispatchedWorkflow.dispatch(NodeFirstWorkflowStrategy.java:383)
at com.dtolabs.rundeck.core.execution.dispatch.ParallelNodeDispatcher$1.call(ParallelNodeDispatcher.java:179)
at com.dtolabs.rundeck.core.cli.CallableWrapperTask.execute(CallableWrapperTask.java:52)
at sun.reflect.GeneratedMethodAccessor2128.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Parallel$TaskRunnable.run(Parallel.java:435)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Cannot run program "ansible": error=24, Too many open files
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
at com.batix.rundeck.AnsibleRunner.run(AnsibleRunner.java:124)
at com.batix.rundeck.AnsibleModuleNodeStep.executeNodeStep(AnsibleModuleNodeStep.java:30)
... 22 more
Caused by: java.io.IOException: error=24, Too many open files
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.(UNIXProcess.java:186)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
... 24 more

Analyze

Rundeck run with user "rundeck" ,

ulimit -a

core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 15236
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

The error can be fixed by increasing "max open files", but I think maybe something wrong with closing the file descriptor.

lsof -p 2017

java 2107 rundeck 380r REG 253,0 8338 270599 /tmp/ansible-hosts1374348696218756678/data/xxxxx (deleted)
java 2107 rundeck 381r REG 253,0 6462 270656 /tmp/ansible-hosts1374348696218756678/data/xxxxx (deleted)
java 2107 rundeck 382r REG 253,0 9621 270650 /tmp/ansible-hosts1374348696218756678/data/xxxxx (deleted)
java 2107 rundeck 383r REG 253,0 7892 270646 /tmp/ansible-hosts1374348696218756678/data/xxxxx (deleted)
java 2107 rundeck 384r REG 253,0 6538 270626 /tmp/ansible-hosts1374348696218756678/data/xxxxx (deleted)
java 2107 rundeck 385r REG 253,0 6252 270638 /tmp/ansible-hosts1374348696218756678/data/xxxxx (deleted)
java 2107 rundeck 386r REG 253,0 6538 270627 /tmp/ansible-hosts1374348696218756678/data/xxxxx (deleted)
java 2107 rundeck 387r REG 253,0 6944 270634 /tmp/ansible-hosts1374348696218756678/data/xxxxx (deleted)
java 2107 rundeck 388r REG 253,0 6400 270617 /tmp/ansible-hosts1374348696218756678/data/xxxxx (deleted)
java 2107 rundeck 389r REG 253,0 6254 270648 /tmp/ansible-hosts1374348696218756678/data/xxxxx (deleted)
java 2107 rundeck 390r REG 253,0 6500 270658 /tmp/ansible-hosts1374348696218756678/data/xxxxx (deleted)
java 2107 rundeck 391r REG 253,0 6533 270633 /tmp/ansible-hosts1374348696218756678/data/xxxxx (deleted)
java 2107 rundeck 393r REG 253,0 461 1572615 /tmp/ansible-hosts5556455135585139371/AnsibleDev (deleted)
java 2107 rundeck 395r REG 253,0 383 1572619 /tmp/ansible-hosts5209006839202653699/AnsibleDev (deleted)
java 2107 rundeck 397r REG 253,0 375 1572621 /tmp/ansible-hosts1751269568005936368/AnsibleDev (deleted)

It seems that many deleted files was not closed by rundeck progress?

Thanks!

v2_runner_on_failed() got an unexpected keyword argument 'ignore_errors'

When using Rundeck (2.6.7) + Ansible (2.0.2) + rundeck-ansible-plugin (1.2.3)

The module "command" is failing with :
MyServerName | FAILED | rc=2 >>[Errno 2] No such file or directory [WARNING]: Failure when attempting to use callback plugin (</usr/lib/python2.7 /site-packages/ansible/plugins/callback/tree.CallbackModule object at 0x26c2fd0>): v2_runner_on_failed() got an unexpected keyword argument 'ignore_errors'

Any idea ?

Ansible Local Facts - Facts.d

I was wondering how this plugin could make use of local facts. I was reading issue #4 and discovered that facts are currently hardcoded. I've understood why it's difficult to implement something dynamic.

I'm using this feature a lot and it would be very nice to filter nodes by my local facts, I'm creating this issue to discuss how can we do this.

Not able to copy a file from ansible node to destination node

Hi i am running ansible playbook from rundeck.. In my ansible playbook there is command to copy a file from anisble node to dest node.. In play book i gave like this

  • name: copy file to the server
    copy: src=/root/{{ filename }}/ dest=/opt/
    register: status

    This thing works when i run ansible in command prompt.. But when i run through Rundeck it is showing error like it is not able to find the file.. During project creation i selected (Ansible File Copier) and gave arguments in a job in a correct format.. Output which i get in rundeck logs is


[copy file to the server] **********************************************
failed: [172.30.10.234] => {"failed": true}
msg: could not find src=/root/test

FATAL: all hosts have already failed -- aborting

Please help me what i am doing wrong

Running ansible playbook using the plugin

Trying to run Ansible using Rundeck user is asking for password.

neilh@ip-10-0-16-199:~$ su - rundeck -s /bin/bash/ -c "ansible all -m ping"
Password: 

I checked the user exist but don't remember setting up password for it. I tried using the GUI password but it didn't work.

neilh@ip-10-0-16-199:~$ cat /etc/passwd
rundeck:x:107:113:Rundeck user account:/var/lib/rundeck:/bin/false

Here is the job definition: https://gist.github.com/neil-mewe/4383cb19c1bf3d2138f77ad4b45e55a2
Here is the job report log: https://gist.github.com/neil-mewe/bbf19778a4b660c76a13e514a283c2d8

NOTE: Running the playbook directly via shell executes the commands correctly and successful. It's only having issue if run via Rundeck.

Just to give an overview what the playbook does. I have run rundeck on a jumphost that is used to spawn AWS EC2 using Ansible. Playbook is suppose to run locally and triggers AWS Console.

Add @yassineazzouz as a collaborator

Hey @yassineazzouz, I invited you as a collaborator to this repo, as you showed high interest in this project and did quite a bit of work already (during my vacation, from which I'm back now, and earlier).

I hope you will continue to contribute to this repo. Feel free to triage / issues and PRs!

I guess I'll need to add a CONTRIBUTING file to explain the build and release steps (basically IntelliJ + Gradle) and my idea of the issue labels etc., if it isn't clear.

I hope you accept. ;)

Ansible jobs hanging

Hi Guys,

I recently come across a very weird issue when running long ansible workflow jobs, after a certain time the job hangs and stop logging, I took a look at what the process is doing and it seems that it was stuck trying to write to a PIPE

[root@prssnbd1adm01 ~]# strace -p 11480
Process 11480 attached
write(1, "6.1M\t./hue_server_db_20160512-1"..., 4096

[rundeck@prssnbd1adm01 ~]$ lsof -p 28218
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ansible-p 28218 rundeck cwd DIR 253,25 4096 20840449 /var/lib/rundeck
ansible-p 28218 rundeck rtd DIR 253,1 4096 2 /
ansible-p 28218 rundeck txt REG 253,17 9032 11902 /usr/bin/python
......
ansible-p 28218 rundeck mem REG 253,17 99158576 4194 /usr/lib/locale/locale-archive
ansible-p 28218 rundeck 0r FIFO 0,8 0t0 35560664 pipe
ansible-p 28218 rundeck 1w FIFO 0,8 0t0 35560665 pipe
ansible-p 28218 rundeck 2w FIFO 0,8 0t0 35560665 pipe
......
ansible-p 28218 rundeck 4r FIFO 0,8 0t0 35560664 pipe
.....
ansible-p 28218 rundeck 7r FIFO 0,8 0t0 35560664 pipe
ansible-p 28218 rundeck 8r FIFO 0,8 0t0 35560664 pipe
ansible-p 28218 rundeck 9r FIFO 0,8 0t0 35560664 pipe
ansible-p 28218 rundeck 10w REG 253,15 17623859 33 /tmp/ansible.log
ansible-p 28218 rundeck 11w REG 253,15 0 45 /tmp/.ansible-lock.16928
ansible-p 28218 rundeck 12r FIFO 0,8 0t0 35560664 pipe
ansible-p 28218 rundeck 13r FIFO 0,8 0t0 35560664 pipe
ansible-p 28218 rundeck 14r FIFO 0,8 0t0 35560664 pipe

I tried to increase the Log output Limit parameter to 1GB but it does not seems to fix the issue. This is probably related to the maximum PIPE in Linux. I'm using centos 6.7 so it should be 64KB I think.

Plus the other weird thing is that logs are not updated dynamically in the UI while the job is running.

Thanks,

Can't get nodes from ansible

Hello,
I'm getting a similar error like the other issues.

ERROR ExceptionCatchingResourceModelSource: [ResourceModelSource: 2.com.batix.rundeck.AnsibleResourceModelSourceFactory (Ansible Resource Model Source), project: test]
com.dtolabs.rundeck.core.resources.ResourceModelSourceException: Error reading facts.
...
Caused by: java.nio.file.NoSuchFileException: /tmp/rundeck/ansible-hosts1781236957158666307/data
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
        at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:427)
        at java.nio.file.Files.newDirectoryStream(Files.java:457)
        at com.batix.rundeck.AnsibleResourceModelSource.getNodes(AnsibleResourceModelSource.java:71)
        ... 90 more

I'm in AWS and using dynamic list script.

  • Ubuntu 14.04.4 LTS
  • ansible 2.0.2.0
  • rundeck 2.6.6
  • ansible-plugin-1.2.3.jar

Rundeck user can run ansible fine.

  su rundeck -s /bin/bash -c "ansible all -m ping"

Also I tried to use a single node hosts ansible file.

  test01    ansible_ssh_host=10.0.0.100

Same result.

What can I check more to get it working?

is it possible to use the plugin with ssh where pubkey auth is not allowed (using password)?

I just started using rundeck and the rundeck-ansible-plugin. It works fine when I use ssh with public key authentication.

However I am also interested in making it work in an environment where it is not allowed/possible
to do public key authentication, so I must use password authentication. With the default nodeexecuter, connections works both with pubkey, and password authentication methods.

I did try to use password authentication with the ansible node executor by adding the -k as an extra argument, but then it hangs (as somewhat expected), probably waiting for the password during the authentication phase of the connection. I did not see an option to choose the authentication method as I can with the (native) default node executor (or file copier).

How can I pass in the password to use for the connection? Is it supported, or is only pubkey authentication supported at this time.

I looked at many articles that I found, but did not find information on running it with password authentication, instead of pubkey authentication.

I am not familiar with Java, so looking through the sources did not give me a clue either.

I am using rundeck version 2.6.8.1 with the ansible plugin version 1.3.0.

TIA,

Hans Feringa

Struggling when passing JSON to --extra-vars

Hi,

I am trying to run a playbook for which I need to pass a JSON structure to --extra-vars. The only way I can make this work is when no space is in the argument to --extra-vars.

This works:

--verbose --tags=some_tag --extra-vars='{"springbootapps":{"appname":{"version":"0.1.17","username":"someuser","urlbase":"https://some.site.com/a/path/to/a/file","nexususer":"someusername","nexuspasswd":"apassword","nexusname":"warname-0.1.17.war"}}}'

Putting a space inside the JSON string (anywhere) results in the plugin to treat it as a new commandline options (I think).

Is there a way to escape the spaces? Allowing spaces would increase legibility, and sometimes, I would need to have spaces inside some value in the JSON string.

Thanks!

Can not get nodes from ansible hosts

My environment:

CentOS6.7
Rundeck-2.6.4.jar
java version "1.7.0_67"
ansible 1.9.4
ansible-plugin-1.0.0.jar.

My ansible hosts file:

[ansible_dev]
AnsibleDev ansible_ssh_host=127.0.0.1
[Test]
192.168.20.10

I create a project followed your instructions, but can not get nodes from ansible hosts with this error:

2016-03-17 00:02:30,933 [qtp10900158-29] ERROR com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource - [ResourceMo delSource: 1.com.batix.rundeck.AnsibleResourceModelSourceFactory (Ansible Resource Model Source), project: test-project] java.lang.UnsupportedOperationException: JsonObject at com.google.gson.JsonElement.getAsString(JsonElement.java:191) at com.batix.rundeck.AnsibleResourceModelSource.getNodes(AnsibleResourceModelSource.java:206) at com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource.getNodes(ExceptionCatchingResourceModelSource.java:45) at com.dtolabs.rundeck.core.common.ProjectNodeSupport.getNodeSet(ProjectNodeSupport.java:88) at com.dtolabs.rundeck.core.common.IProjectNodes$getNodeSet.call(Unknown Source) at rundeck.services.nodes.CachedProjectNodes.reloadNodeSet(CachedProjectNodes.groovy:24) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1074) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)

Then, I turn off the option "Gather Facts", but still can't get nodes. The error is:
2016-03-17 00:26:36,951 [qtp10900158-31] ERROR com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource - [ResourceModelSource: 1.com.batix.rundeck.AnsibleResourceModelSourceFactory (Ansible Resource Model Source), project: test-project] java.lang.NullPointerException at com.batix.rundeck.AnsibleResourceModelSource.getNodes(AnsibleResourceModelSource.java:206) at com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource.getNodes(ExceptionCatchingResourceModelSource.java:45) at com.dtolabs.rundeck.core.common.ProjectNodeSupport.getNodeSet(ProjectNodeSupport.java:88) at com.dtolabs.rundeck.core.common.IProjectNodes$getNodeSet.call(Unknown Source) at rundeck.services.nodes.CachedProjectNodes.reloadNodeSet(CachedProjectNodes.groovy:24) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)

Working with virtual environment

I use the python virtual environment "virtualenv" where ansible is stored. Sourcing the environment is not the problem, but rundeck lose the environment settings especially the global variable path.

Is it possible to add a feature, that sources the virutalenv to hold the settings for ansible? Or did anyone know a solution for this behavior?

Resource Model Source - Permission problem

Hi, I have simmilar problem to other users.

I try gather facts with hosts file I have this error in service.log:
ERROR ExceptionCatchingResourceModelSource: [ResourceModelSource: 2.source (Ansible Resource Model Source), project: test] com.dtolabs.rundeck.core.resources.ResourceModelSourceException: Error deleting temporary directory. ... Caused by: java.nio.file.AccessDeniedException: /tmp/rundeck/ansible-hosts1103819196691470598/data/os1

When I check permissions of that directory I discovered that ansible-hosts is created by user rundeck, but directory data is created by root user. Other users don't have perrmission to modify directory and that cause error.

I have plugin version 1.3 and I use rundeck user to execute ansible.

Can you Investigate this?

The plugins is trying to create the data directory in / (root) instead of /tmp/rundeck/ansible-hosts.*.

Don't know why but the plugin is creating a data directory in "/" (root) instead of /tmp/rundeck/"ansible-hosts/"

This is the ansible log when it was trying to create a "data" directory in "/".
2016-04-26 06:27:34,810 p=1556 u=rundeck | invalid output was: Traceback (most recent call last): File "/var/lib/rundeck/.ansible/tmp/ansible-tmp-1461652054.64-12936011354221/file", line 1675, in <module> main() File "/var/lib/rundeck/.ansible/tmp/ansible-tmp-1461652054.64-12936011354221/file", line 216, in main os.mkdir(curpath) OSError: [Errno 13] Permission denied: '/data'

This is the ansible log after I created the '/data' directory in root (just to see if it works).
2016-04-26 06:46:05,945 p=1642 u=rundeck | TASK: [template src=host-tpl.j2 dest="data/{{inventory_hostname}}"] *********** 2016-04-26 06:46:06,172 p=1642 u=rundeck | failed: [my_ip -> 127.0.0.1] => {"failed": true} 2016-04-26 06:46:06,173 p=1642 u=rundeck | msg: Destination directory data does not exist

Obviously, "/tmp/rundeck/ansible-hosts/data" doesn't exist because data was created in "/" (root).

su rundeck -s /bin/bash -c "ansible all -m ping" works without any issues.

Is there something that I'm missing?

This is all on a fresh installation of Debian 8 on a VM via vagrant.
ansible 1.7.2
ansible-plugin-1.2.2

custom facts list / adding nics detailes

Hi,
is it possible to add/remove ansible facts in nodes facts list?
the most important for now is adding the nics detailes like:

    "ansible_default_ipv4": {
        "address": "", 
        "alias": "eth0", 
        "broadcast": "", 
        "gateway": "", 
        "interface": "eth0", 
        "macaddress": "", 
        "mtu": 1500, 
        "netmask": "", 
        "network": "", 
        "type": "ether"
    }, 

Many thanks,
Nir.

Speeding Up AWS Inventory

I found that it takes quite a while for Rundeck to pull a list nodes through Ansible. It seems that when you do pull a list of nodes, the ansible command gathers most of the facts during the process.

  • Use Rundeck as a the inventory source, since it appears to be able to generate a list of nodes far more quickly.
  • Also, try to read off the fact_cache (this requires that fact_cache be enabled first, though)before failing back to pulling facts from the AWS instances.

Can't load hosts from inventory

Hi,
I'm runnng v1.2.2 and ansible 2.0.2.0 on ubuntu 14.04. I-m able to create a new project with the settings specified in the readme but under Nodes i only see the local host

image

I'm able to run without any problem
su rundeck -s /bin/bash -c "ansible all -m ping"

the file permission for /etc/ansible/hosts and /etc/ansible/ansible.cfg are:

-rw-rw-rw- 1 root root 10462 Apr 27 15:34 ansible.cfg -rw-rw-rw- 1 root root 231 Apr 27 16:11 hosts

ansible hosts file contains a few entries like:

[fixed]
movvml120
movvml121
movvml122
movvml123

[floating]
movvml124

Service log reports the following error:

ERROR ExceptionCatchingResourceModelSource: [ResourceModelSource: 2.com.batix.rundeck.AnsibleResourceModelSourceFactory (Ansible Resource Model Source), project: Ansible]
com.dtolabs.rundeck.core.resources.ResourceModelSourceException: Error reading facts.
        at com.batix.rundeck.AnsibleResourceModelSource.getNodes(AnsibleResourceModelSource.java:227)
        at com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource.getNodes(ExceptionCatchingResourceModelSource.java:57)
        at com.dtolabs.rundeck.core.common.ProjectNodeSupport.getNodeSet(ProjectNodeSupport.java:91)
        at com.dtolabs.rundeck.core.common.ProjectNodeSupport$ProjectNodesSource.getNodes(ProjectNodeSupport.java:266)
        at com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource.getNodes(ExceptionCatchingResourceModelSource.java:57)
        at com.dtolabs.rundeck.core.resources.ResourceModelSource$getNodes.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
        at rundeck.services.nodes.CachedProjectNodes.reloadNodeSet(CachedProjectNodes.groovy:26)
        at rundeck.services.nodes.CachedProjectNodes$reloadNodeSet.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
        at rundeck.services.NodeService$_loadNodes_closure3.doCall(NodeService.groovy:232)
        at rundeck.services.NodeService$_loadNodes_closure3.doCall(NodeService.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
        at groovy.lang.Closure.call(Closure.java:423)
        at groovy.lang.Closure.call(Closure.java:417)
        at com.codahale.metrics.Timer.time(Timer.java:99)
        at com.codahale.metrics.Timer$time$0.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at com.codahale.metrics.Timer$time$0.call(Unknown Source)
        at MetricswebGrailsPlugin$_addDynamicMetricMethods_closure26.doCall(MetricswebGrailsPlugin.groovy:174)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
        at groovy.lang.Closure.call(Closure.java:423)
        at org.codehaus.groovy.runtime.metaclass.ClosureStaticMetaMethod.invoke(ClosureStaticMetaMethod.java:59)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoMetaMethodSiteNoUnwrap.invoke(PogoMetaMethodSite.java:230)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:68)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callSafe(AbstractCallSite.java:96)
        at rundeck.services.NodeService$_loadNodes_closure4.doCall(NodeService.groovy:239)
        at rundeck.services.NodeService$_loadNodes_closure4.doCall(NodeService.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
        at groovy.lang.Closure.call(Closure.java:423)
        at groovy.lang.Closure.call(Closure.java:417)
        at groovy.lang.Closure.run(Closure.java:504)
        at org.springframework.core.task.SimpleAsyncTaskExecutor$ConcurrencyThrottlingRunnable.run(SimpleAsyncTaskExecutor.java:251)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.nio.file.NoSuchFileException: /tmp/rundeck/ansible-hosts8704990301932554303/data
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
        at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:426)
        at java.nio.file.Files.newDirectoryStream(Files.java:413)
        at com.batix.rundeck.AnsibleResourceModelSource.getNodes(AnsibleResourceModelSource.java:73)
        ... 65 more

The folder /tmp/rundeck/ansible-hosts8704990301932554303/ contains the following entries:

-rw-rw-r--  1 rundeck rundeck   50 Apr 27 17:54 gather-hosts.retry
-rw-rw-r--  1 rundeck rundeck  238 Apr 27 17:54 gather-hosts.yml
drwx------  3 rundeck rundeck 4096 Apr 27 17:54 $HOME/
-rw-rw-r--  1 rundeck rundeck   53 Apr 27 17:54 host-tpl.j2

a folder named $HOME looks strange to me..

Rundeck failing execution of ansible commands/playbooks

Hello all, i know it is possible to use rundeck as an interface to ansible, however i'm having a problem where execution of ansible via rundeck fails.
I am using the ansible-plugin for rundeck to execute playbooks/modules but no matter what i try the execution is not successful as it complains about the node "is not reachable through ssh".

i'm suspecting this is because my localhost is executing the ansible commands as the rundeck user (even if i specify my username and ssh keys in the ansible host file).

I know it's probably a dumb question but i'm fairly new to rundeck+ansible. but is there a way i can install the rundeck user in my node and use the ssh keys its using? Or any tips or guides i can use to use rundeck+ansible?

Here's an example output i'm getting if i run "ansible all -m ping" command from rundeck:

12:59:26 localhost Using /etc/ansible/ansible.cfg as config file
12:59:26 ESTABLISH SSH CONNECTION FOR USER: elizaldd
12:59:26 SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/home/elizaldd/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=elizaldd -o ConnectTimeout=10 -o ControlPath=/var/lib/rundeck/.ansible/cp/ansible-ssh-%h-%p-%r node1 '/bin/sh -c '"'"'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python && sleep 0'"'"''
12:59:26 node1 | UNREACHABLE! => {
12:59:26 "changed": false,
12:59:26 "msg": "SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh",
12:59:26 "unreachable": true
12:59:26 }

And this is the output if run the same command from the command line:

Using /etc/ansible/ansible.cfg as config file
ESTABLISH SSH CONNECTION FOR USER: elizaldd
SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'IdentityFile="/home/elizaldd/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=elizaldd -o ConnectTimeout=10 -o ControlPath=/home/elizaldd/.ansible/cp/ansible-ssh-%h-%p-%r node1 '/bin/sh -c '"'"'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python && sleep 0'"'"''
node1 | SUCCESS => {
"changed": false,
"invocation": {
"module_args": {
"data": null
},
"module_name": "ping"
},
"ping": "pong"

Minimum ansible version

Ubuntu 14 ships with ansible version 1.5.4. This causes an error when executing gather-hosts.yml :

ERROR: run_once is not a legal parameter in an Ansible task or handler

You should add a note that minimum ansible version is 1.7.*

Struggling with "skipping: no hosts matched"

Hi there,

I started using Rundeck and Ansible for a few days from today, and, i've run into a lot of problem, but this one i'm not passing through.
I'm just trying to launch 2 simple playbook into a Cisco Switch who create an ACL Test, and destroy it. Just to test if playbook can work normally.

Playbooks work fine when:

  • Launch them from command line as root
    ansible-playbook /etc/ansible/playbooks/ios/ios-test-acl.yml
  • Launch them from command line as rundeck
    su rundeck -s /bin/bash -c "ansible-playbook /etc/ansible/playbooks/ios/ios-test-acl.yml
  • Launch them from Rundeck without the plugin (as Command Line)
    success-without

But they won't work when i launch them from Rundeck with the option coming from the plugin (to launch playbook)

failure-with

I'm pretty sure i'm missing something but i can't find what it is and it's pretty frustrating. Here what i've done at the moment.

Project configuration following the readme:

#Project Project_Ansible_Plugin configuration, generated
#Tue Jun 21 10:17:13 CEST 2016
project.name=Project_Ansible_Plugin
project.ssh-authentication=privateKey
service.NodeExecutor.default.provider=com.batix.rundeck.AnsibleNodeExecutor
resources.source.1.config.gatherFacts=false
resources.source.1.config.extraArgs=-u root
project.nodeCache.enabled=true
project.ssh-keypath=/var/lib/rundeck/.ssh/id_rsa
project.nodeCache.delay=30
project.description=Project using functionalities from the ansible plugin for rundeck
service.FileCopier.default.provider=com.batix.rundeck.AnsibleFileCopier
executable=/bin/bash
resources.source.1.type=com.batix.rundeck.AnsibleResourceModelSourceFactory

ownership from rundeck to /var/lib/rundeck:
drwxr-xr-x 12 rundeck root 4.0K Jun 20 16:59 rundeck

The test command is good:
pingtest

ansible config file:

[defaults]
log_path        = /var/log/ansible.log
inventory       = /etc/ansible/hosts
local_tmp       = $HOME/.ansible/tmp
#host_key_checking  = false

node rundeck can see:
nodes-from-rund

And the host file (with the password which is visible and not crypted for the ssh pass missing here):

[localhost]
rundeck ansible_connection=local ansible_host=127.0.0.1 ansible_user=root ansible_ssh_pass=<>
[nxos]
sdc9-n6k-01 ansible_connection=local
[ios]
172.30.253.30 ansible_connection=local

Tanks in advance !

Server:
Debian 8.4
Rundeck 2.6.7-1
Ansible 2.1.0.0
Plugin 1.2.4
Java 1.7.0_101
Python 2.7.9
Client:
Cisco IOS - C2960X - 15.0(2)EX5

Failed: AnsibleNonZero: Error running Ansible Node Step.

I'm using the latest Rundeck, Ansible, and Rundeck ansible plugin.

I keep getting this error:

08:31:59 localhost 1. Ansible Playbook Using /etc/ansible/ansible.cfg as config file
08:31:59 Failed: AnsibleNonZero: Error running Ansible Node Step.
08:31:59 Execution failed: 6: [Workflow result: , step failures: {1=Dispatch failed on 1 nodes: [localhost: AnsibleNonZero: Error running Ansible Node Step.]}, Node failures: {localhost=[AnsibleNonZero: Error running Ansible Node Step.]}, status: failed]

What do i wrong?

Unknown: java.lang.NullPointerException

Failed dispatching to node 10.1.15.61: java.lang.NullPointerException
Failed dispatching to node 10.1.15.94: java.lang.NullPointerException
Failed dispatching to node 10.1.15.95: java.lang.NullPointerException
Execution failed: 41: [Workflow result: , step failures: {1=Dispatch failed on 3 nodes: [10.1.15.95: Unknown: java.lang.NullPointerException, 10.1.15.94: Unknown: java.lang.NullPointerException, 10.1.15.61: Unknown: java.lang.NullPointerException]}, Node failures: {10.1.15.95=[Unknown: java.lang.NullPointerException], 10.1.15.94=[Unknown: java.lang.NullPointerException], 10.1.15.61=[Unknown: java.lang.NullPointerException]}, status: failed]

Problem with gathering facts

When I have gatherFacts=true, I hit major slowness whenever running a job/command. And if I have more than a few dozen hosts targeted, the job often just stalls out, forcing me to kill it. When that happens, there are usually defunct ansible processes hanging around.

I've set gatherFacts=False and things are working much better.

Question on facts... I use redis fact caching in ansible.cfg, with gathering = smart. Is it possible to have the plugin just import from the local Ansible redis fact cache? Gathering facts when calling ansible outside of Rundeck works fine, and I prefer to (micro)manage it that way anyways.

If that's not an option, is it possible to have gatherFacts=false and manually kick off a fact gathering to flush out the node attributes?

Thanks,
Reece

Nodes not importing

I'm running ansible & Rundeck in a test environment with a simple /etc/ansible/hosts with two hosts listed. For some reason, the plugin is not pulling in the Nodes. All of my permissions are configured correctly. Any thoughts?

can't execute commands on the ansible nodes

I have created a project called "ansible_test", the Ansible Resource Model Source configure is below:

  • leave blank about "Limit Targets".
  • Extra Arguments is "-i /home/test/ansible_test/",ansible inventory file is under the ansible_test

rundeck can discovery the inventory host,but when I execute commands,it complain with "Using /etc/ansible/ansible.cfg as config file Failed: AnsibleError: ERROR! Specified --limit does not match any hosts"

I stuck here, thanks for your help!

sorry for my poor english.

Manage ansible.cfg through Rundeck

It may be useful for an administrator to be able to manage the ansible.cfg from the rundeck interface. This allow ansible.cfg to be updated without any potential for error (e.g. typos or bad formatting).

Cannot get property 'nodeService' on null object

got this error while creating the project. have follwed your instructions selecting ansible model, executor and file copier.

text shown at web error page:

Request: /resources/createProjectPost?fcopy.0.config.keystoragepath=&fcopy=[0.config.keystoragepath:, 0:[config.keystoragepath:, config:[keystoragepath:, authentication:privateKey, keypath:, passwordstoragepath:], type:jsch-scp, config.authentication:privateKey, config.keypath:, config.passwordstoragepath:], 0.type:jsch-scp, 0.config.authentication:privateKey, 2.config.interpreter:, 2:[config.interpreter:, config:[interpreter:, filepath:, directory:, command:], type:script-copy, config.filepath:, config.directory:, config.command:], 2.type:script-copy, 0.config.keypath:, 0.config.passwordstoragepath:, 2.config.filepath:, 2.config.directory:, 2.config.command:, 1.type:com.batix.rundeck.AnsibleFileCopier, 1:[type:com.batix.rundeck.AnsibleFileCopier], 3.type:stub, 3:[type:stub]]&orig.nodeexec.0.config.passwordstoragepath=&orig=[nodeexec.0.config.passwordstoragepath:, nodeexec:[0.config.passwordstoragepath:, 0:[config.passwordstoragepath:, config:[passwordstoragepath:, authentication:, keypath:, keystoragepath:], config.authentication:, config.keypath:, config.keystoragepath:], 0.config.authentication:, 1.config.executable:/bin/bash, 1:[config.executable:/bin/bash, config:[executable:/bin/bash]], 0.config.keypath:, 2.config.command:, 2:[config.command:, config:[command:, interpreter:, directory:], config.interpreter:, config.directory:], 0.config.keystoragepath:, 2.config.interpreter:, 2.config.directory:], nodeexec.0.config.authentication:, fcopy.0.config.authentication:, fcopy:[0.config.authentication:, 0:[config.authentication:, config:[authentication:, keystoragepath:, keypath:, passwordstoragepath:], config.keystoragepath:, config.keypath:, config.passwordstoragepath:], 0.config.keystoragepath:, 2.config.command:, 2:[config.command:, config:[command:, interpreter:, directory:, filepath:], config.interpreter:, config.directory:, config.filepath:], 2.config.interpreter:, 0.config.keypath:, 0.config.passwordstoragepath:, 2.config.directory:, 2.config.filepath:], nodeexec.1.config.executable:/bin/bash, fcopy.0.config.keystoragepath:, fcopy.2.config.command:, fcopy.2.config.interpreter:, fcopy.0.config.keypath:, nodeexec.0.config.keypath:, fcopy.0.config.passwordstoragepath:, nodeexec.2.config.command:, nodeexec.0.config.keystoragepath:, fcopy.2.config.directory:, nodeexec.2.config.interpreter:, fcopy.2.config.filepath:, nodeexec.2.config.directory:]&nodeexec.2.config.directory=&nodeexec=[2.config.directory:, 2:[config.directory:, config:[directory:, interpreter:, command:], config.interpreter:, type:script-exec, config.command:], 0.config.keystoragepath:, 0:[config.keystoragepath:, config:[keystoragepath:, passwordstoragepath:, keypath:, authentication:privateKey], type:jsch-ssh, config.passwordstoragepath:, config.keypath:, config.authentication:privateKey], 3.type:stub, 3:[type:stub], 2.config.interpreter:, 0.type:jsch-ssh, 0.config.passwordstoragepath:, 0.config.keypath:, 1.config.executable:/bin/bash, 1:[config.executable:/bin/bash, config:[executable:/bin/bash], type:com.batix.rundeck.AnsibleNodeExecutor], 0.config.authentication:privateKey, 2.type:script-exec, 1.type:com.batix.rundeck.AnsibleNodeExecutor, 2.config.command:]&orig.nodeexec.0.config.authentication=&nodeexec.0.config.keystoragepath=&newproject=Ansible_TFG_Deployments&orig.fcopy.0.config.authentication=&orig.nodeexec.1.config.executable=/bin/bash&fcopy.0.type=jsch-scp&description=&fcopy.0.config.authentication=privateKey&nodeexec.3.type=stub&fcopy.2.config.interpreter=&fcopy.2.type=script-copy&index=1&orig.fcopy.0.config.keystoragepath=&plugin.1.type=com.batix.rundeck.AnsibleResourceModelSourceFactory&plugin=[1.type:com.batix.rundeck.AnsibleResourceModelSourceFactory, 1:[type:com.batix.rundeck.AnsibleResourceModelSourceFactory, saved:true, config.gatherFacts:true, config:[gatherFacts:true]], 1.saved:true, 1.config.gatherFacts:true]&fcopy.0.config.keypath=&fcopy.0.config.passwordstoragepath=&defaultNodeExec=1&nodeexec.2.config.interpreter=&orig.fcopy.2.config.command=&plugin.1.saved=true&create=Create&nodeexec.0.type=jsch-ssh&fcopy.2.config.filepath=&orig.fcopy.2.config.interpreter=&prefix=plugin.1.&nodeexec.0.config.passwordstoragepath=&nodeexec.0.config.keypath=&defaultFileCopy=1&orig.fcopy.0.config.keypath=&orig.nodeexec.0.config.keypath=&orig.fcopy.0.config.passwordstoragepath=&fcopy.2.config.directory=&nodeexec.1.config.executable=/bin/bash&SYNCHRONIZER_TOKEN=9c41755213c83ed083edb3e8144bbeaab2d4d58d9f3937f8aafb4f058f439a78&fcopy.2.config.command=&orig.nodeexec.2.config.command=&fcopy.1.type=com.batix.rundeck.AnsibleFileCopier&plugin.1.config.gatherFacts=true&nodeexec.0.config.authentication=privateKey&nodeexec.2.type=script-exec&SYNCHRONIZER_URI=/resources/createProject&orig.nodeexec.0.config.keystoragepath=&fcopy.3.type=stub&orig.fcopy.2.config.directory=&nodeexec.1.type=com.batix.rundeck.AnsibleNodeExecutor&nodeexec.2.config.command=&orig.nodeexec.2.config.interpreter=&orig.fcopy.2.config.filepath=&orig.nodeexec.2.config.directory=&33fbff4f_sel=/bin/bash
Message: Cannot get property 'nodeService' on null object
Caused by: Cannot get property 'nodeService' on null object
Class: FrameworkController
At Line: [862]
Code Snippet:

No matched nodes while executing playbooks

system: centos 6.8 x86_64 , ansible-2.1 , rundeck-2.6.8 Batix/rundeck-ansible-plugin v1.3.0

rundeck runs on the same ansible controller host, and i just want to run the playbooks from rundeck interface.

su rundeck -c "ansible all -m ping" , works well, but when i try to run playbooks from rundeck there's an error:

Execution failed: 10: No matched nodes: MultiNodeSelector{nodenames=[localhost]}

in the jobs the node selection is "Execute locally", on the second option "Dispatch to Nodes" there's no hosts on the list. the hosts specified in the ansible playbooks, so i don't really need to specify it to rundeck, am i missing something here? rundeck should run the playbooks on the same host, and the ansible will deploy to the remote systems.

Thanks, Nir.

Removing file logging and json log parsing

Hi @frozenice ,

I noticed that the jobs try to parse logs to json format after the Job finishes :
`private void parseOutput() {
if (type == AnsibleCommand.Playbook && doParseOutput) {
// TODO not all modules print JSON with -v (e.g. debug), drop all this? it's not used either...
AnsibleTask curTask = null;

  for (String line : output.split("\\r?\\n")) {
    line = line.trim();

    Matcher mTask = pTask.matcher(line);
    if (mTask.find()) {
      curTask = new AnsibleTask();
      results.add(curTask);
      curTask.name = mTask.group(1);
      continue;
    }

    if (curTask == null) continue;

    Matcher mHost = pHostPlaybook.matcher(line);
    if (mHost.find()) {
      AnsibleTaskResult taskResult = new AnsibleTaskResult();
      curTask.results.add(taskResult);

      taskResult.result = mHost.group(1);
      taskResult.host = mHost.group(2);
      String jsonStr = mHost.group(3);
      taskResult.json = new JsonParser().parse(jsonStr).getAsJsonObject();
    }
  }
}

}`

I think as you noted in your comments not all modules print Json, so from my personal opinion it is not really needed to try to parse logs after the Job finishes, just returning them to stdout will be good enough. For the file logging I beleive this is not needed either since rundeck will always keep a copy of the job logs when it finishes. What do you think ?

Don't see #Choose "Ansible Resource Model Source" as the resource model source# as an option?

Should I be seeing extra option ( ansible & rundeck on the same machine) ?
capture

root@ip-172-17-0-237:~/rundeck/libext# ll
total 5504
drwxr-xr-x 3 rundeck rundeck    4096 Jul  5 22:31 ./
drwxr-xr-x 8 rundeck rundeck    4096 Jun 30 22:29 ../
-rw-r--r-- 1 rundeck rundeck  247576 Jul  3 16:49 ansible-plugin-1.3.0.jar
drwxrwxr-x 4 root    root       4096 Jun 30 17:43 cache/
-rw-r--r-- 1 rundeck rundeck    3908 Jun 29 17:45 rundeck-copyfile-plugin-2.6.8.jar
-rw-r--r-- 1 rundeck rundeck    2301 Jun 29 17:45 rundeck-flow-control-plugin-2.6.8.jar
-rw-r--r-- 1 rundeck rundeck 2763242 Jun 29 17:45 rundeck-git-plugin-2.6.8.jar
-rw-r--r-- 1 rundeck rundeck 2546868 Jun 29 17:45 rundeck-jasypt-encryption-plugin-2.6.8.jar
-rw-r--r-- 1 rundeck rundeck    6075 Jun 29 17:45 rundeck-job-state-plugin-2.6.8.jar
-rw-r--r-- 1 rundeck rundeck    3473 Jun 29 17:45 rundeck-localexec-plugin-2.6.8.jar
-rw-r--r-- 1 rundeck rundeck    9526 Jun 29 17:45 rundeck-orchestrator-plugin-2.6.8.jar
-rw-r--r-- 1 rundeck rundeck   16139 Jun 29 17:45 rundeck-script-plugin-2.6.8.jar
-rw-r--r-- 1 rundeck rundeck   11029 Jun 29 17:45 rundeck-stub-plugin-2.6.8.jar

Extra Arguments Can not be null?

env

rundeck 2.6.4
ansible-plugin-1.2.1.jar

Description

Case 1

when you created a step use "Ansible Module" or "Ansible Playbook" with rundeck-ansible-plugin, if the "Extra Arguments" field was not input anything, you will got error like this:

2016-04-05 14:45:53,092 [Thread-52] ERROR com.dtolabs.rundeck.core.execution.workflow.steps.node.NodeStepPluginAdapter - Uncaught th
rowable executing node step.
java.lang.NullPointerException
at com.dtolabs.rundeck.core.utils.QuotedStringTokenizer.(QuotedStringTokenizer.java:24)
at com.dtolabs.rundeck.core.utils.QuotedStringTokenizer.collectTokens(QuotedStringTokenizer.java:53)
at com.dtolabs.rundeck.core.utils.QuotedStringTokenizer.tokenizeToArray(QuotedStringTokenizer.java:39)
at com.dtolabs.rundeck.core.utils.OptsUtil.burst(OptsUtil.java:50)
at com.batix.rundeck.AnsibleRunner.extraArgs(AnsibleRunner.java:83)
at com.batix.rundeck.AnsibleModuleNodeStep.executeNodeStep(AnsibleModuleNodeStep.java:28)
at com.dtolabs.rundeck.core.execution.workflow.steps.node.NodeStepPluginAdapter.executeNodeStep(NodeStepPluginAdapter.java:1
06)
at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.executeNodeStep(ExecutionServiceImpl.java:149)
at com.dtolabs.rundeck.core.execution.dispatch.SequentialNodeDispatcher.dispatch(SequentialNodeDispatcher.java:116)
at com.dtolabs.rundeck.core.execution.dispatch.SequentialNodeDispatcher.dispatch(SequentialNodeDispatcher.java:58)
at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.dispatchToNodes(ExecutionServiceImpl.java:177)
at com.dtolabs.rundeck.core.execution.workflow.steps.NodeDispatchStepExecutor.executeWorkflowStep(NodeDispatchStepExecutor.java:66)
at com.dtolabs.rundeck.core.execution.ExecutionServiceImpl.executeStep(ExecutionServiceImpl.java:116)
at com.dtolabs.rundeck.core.execution.workflow.BaseWorkflowStrategy.executeWFItem(BaseWorkflowStrategy.java:225)
at com.dtolabs.rundeck.core.execution.workflow.BaseWorkflowStrategy.executeWorkflowItemsForNodeSet(BaseWorkflowStrategy.java:303)
at com.dtolabs.rundeck.core.execution.workflow.BaseWorkflowStrategy.executeWorkflowItemsForNodeSet(BaseWorkflowStrategy.java:258)
at com.dtolabs.rundeck.core.execution.workflow.StepFirstWorkflowStrategy.executeWorkflowImpl(StepFirstWorkflowStrategy.java:

if input a blank (or space) in the "Extra Arguments" field, the step will run without errors.

Case2

if you not input anything in the "Extra Arguments field" when you configure the project Default Node Executor, then run a "Commands" with Ansible Ad-Hoc Node Executor, you will got error like this:

2016-04-08 11:25:06,650 ERROR ExecutionUtilService - Execution failed: 573: [Workflow result: , step failures: {1=Dispatch failed on 1 nodes: [172.17.20.79: Unknown: java.lang.NullPointerException]}, Node failures: {172.17.20.79=[Unknown: java.lang.NullPointerException]}, status: failed]

if input a blank (or space) in the "Extra Arguments" field, you will not see any errors.

No nodes are displayed if any are unreachable

If any of my hosts are unreachable the plugin seems to dislike the non-zero exit code returned by Ansible and won't show any hosts in the nodes section. If I change my hosts file so only the online hosts are in inventory, it works as expected.

PLAY RECAP *********************************************************************
SERVER-01 : ok=3    changed=2    unreachable=0    failed=0
SERVER-02 : ok=2    changed=1    unreachable=0    failed=0
SERVER-03 : ok=0    changed=0    unreachable=1    failed=0
SERVER-04 : ok=0    changed=0    unreachable=1    failed=0
SERVER-05 : ok=0    changed=0    unreachable=1    failed=0
SERVER-06 : ok=2    changed=1    unreachable=0    failed=0
SERVER-07 : ok=0    changed=0    unreachable=1    failed=0
SERVER-08 : ok=2    changed=1    unreachable=0    failed=0
SERVER-09 : ok=2    changed=1    unreachable=0    failed=0
SERVER-10 : ok=0    changed=0    unreachable=1    failed=0
SERVER-11 : ok=0    changed=0    unreachable=1    failed=0
SERVER-12 : ok=0    changed=0    unreachable=1    failed=0
SERVER-13 : ok=0    changed=0    unreachable=1    failed=0
SERVER-14 : ok=0    changed=0    unreachable=1    failed=0
SERVER-15 : ok=0    changed=0    unreachable=1    failed=0
SERVER-16 : ok=0    changed=0    unreachable=1    failed=0
SERVER-17 : ok=2    changed=1    unreachable=0    failed=0
SERVER-18 : ok=2    changed=1    unreachable=0    failed=0
SERVER-19 : ok=2    changed=1    unreachable=0    failed=0
SERVER-20 : ok=2    changed=1    unreachable=0    failed=0
SERVER-21 : ok=2    changed=1    unreachable=0    failed=0
SERVER-22 : ok=0    changed=0    unreachable=1    failed=0
SERVER-23 : ok=0    changed=0    unreachable=1    failed=0
SERVER-24 : ok=0    changed=0    unreachable=1    failed=0
SERVER-25 : ok=2    changed=1    unreachable=0    failed=0
SERVER-26 : ok=0    changed=0    unreachable=1    failed=0
DATABASE-19 : ok=0    changed=0    unreachable=1    failed=0
DATABASE-20 : ok=0    changed=0    unreachable=1    failed=0
DATABASE-21 : ok=0    changed=0    unreachable=1    failed=0
DATABASE-22 : ok=0    changed=0    unreachable=1    failed=0
DATABASE-23 : ok=0    changed=0    unreachable=1    failed=0
DATABASE-24 : ok=0    changed=0    unreachable=1    failed=0
DATABASE-25 : ok=0    changed=0    unreachable=1    failed=0

ERROR ExceptionCatchingResourceModelSource: [ResourceModelSource: 2.source (Ansible Resource Model Source), project: Ansible-test]
com.dtolabs.rundeck.core.resources.ResourceModelSourceException: Error running playbook.
        at com.batix.rundeck.AnsibleResourceModelSource.getNodes(AnsibleResourceModelSource.java:72)
        at com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource.getNodes(ExceptionCatchingResourceModelSource.java:57)
        at com.dtolabs.rundeck.core.common.ProjectNodeSupport.getNodeSet(ProjectNodeSupport.java:92)
        at com.dtolabs.rundeck.core.common.ProjectNodeSupport$ProjectNodesSource.getNodes(ProjectNodeSupport.java:292)
        at com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource.getNodes(ExceptionCatchingResourceModelSource.java:57)
        at com.dtolabs.rundeck.core.resources.ResourceModelSource$getNodes.call(Unknown Source)
        at rundeck.services.nodes.CachedProjectNodes.reloadNodeSet(CachedProjectNodes.groovy:26)
        at rundeck.services.nodes.CachedProjectNodes$reloadNodeSet.call(Unknown Source)
        at rundeck.services.NodeService$_loadNodes_closure3.doCall(NodeService.groovy:232)
        at rundeck.services.NodeService$_loadNodes_closure3.doCall(NodeService.groovy)
        at sun.reflect.GeneratedMethodAccessor820.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
        at groovy.lang.Closure.call(Closure.java:423)
        at groovy.lang.Closure.call(Closure.java:417)
        at com.codahale.metrics.Timer.time(Timer.java:99)
        at com.codahale.metrics.Timer$time.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at com.codahale.metrics.Timer$time.call(Unknown Source)
        at MetricswebGrailsPlugin$_addDynamicMetricMethods_closure26.doCall(MetricswebGrailsPlugin.groovy:174)
        at sun.reflect.GeneratedMethodAccessor516.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
        at groovy.lang.Closure.call(Closure.java:423)
        at org.codehaus.groovy.runtime.metaclass.ClosureStaticMetaMethod.invoke(ClosureStaticMetaMethod.java:59)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoMetaMethodSiteNoUnwrap.invoke(PogoMetaMethodSite.java:230)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:68)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callSafe(AbstractCallSite.java:96)
        at rundeck.services.NodeService.loadNodes(NodeService.groovy:244)
        at sun.reflect.GeneratedMethodAccessor813.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:80)
        at rundeck.services.NodeService.this$dist$invoke$1(NodeService.groovy)
        at rundeck.services.NodeService$2.methodMissing(NodeService.groovy)
        at sun.reflect.GeneratedMethodAccessor741.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:933)
        at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1256)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1209)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:807)
        at rundeck.services.NodeService$2.invokeMethod(NodeService.groovy)
        at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1272)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1166)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
        at rundeck.services.NodeService$_2_reload_closure1.doCall(NodeService.groovy:96)
        at rundeck.services.NodeService$_2_reload_closure1.doCall(NodeService.groovy)
        at sun.reflect.GeneratedMethodAccessor946.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
        at groovy.lang.Closure.call(Closure.java:423)
        at groovy.lang.Closure.call(Closure.java:417)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at org.springframework.core.task.SimpleAsyncTaskExecutor$ConcurrencyThrottlingRunnable.run(SimpleAsyncTaskExecutor.java:251)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.batix.rundeck.AnsibleStepException: ERROR: Ansible execution returned with non zero code.
        at com.batix.rundeck.AnsibleRunner.run(AnsibleRunner.java:298)
        at com.batix.rundeck.AnsibleResourceModelSource.getNodes(AnsibleResourceModelSource.java:70)
        ... 82 more
WARN  LoggingResourceModelSourceCache: [ResourceModelSource: 2.source (Ansible Resource Model Source), project: Ansible-test] Returning cached model data

and with the edited inventory:

PLAY RECAP *********************************************************************
SERVER-01 : ok=3    changed=2    unreachable=0    failed=0
SERVER-02 : ok=2    changed=1    unreachable=0    failed=0
SERVER-06 : ok=2    changed=1    unreachable=0    failed=0
SERVER-08 : ok=2    changed=1    unreachable=0    failed=0
SERVER-09 : ok=2    changed=1    unreachable=0    failed=0
SERVER-17 : ok=2    changed=1    unreachable=0    failed=0
SERVER-18 : ok=2    changed=1    unreachable=0    failed=0
SERVER-19 : ok=2    changed=1    unreachable=0    failed=0
SERVER-20 : ok=2    changed=1    unreachable=0    failed=0
SERVER-21 : ok=2    changed=1    unreachable=0    failed=0

INFO  ExecutionUtilService: Execution successful: 41466

Working with virtual environments (Part 2)

Being able to set an arbitrary virtualenv path would be huge. I have seen several use cases where there are multiple development teams that are authoring Ansible playbooks, over time there is a big gap between the versions that each of the teams are using.

The development teams will often not have the bandwidth to refactor their playbooks to support a specific (backwards-INcompitable) version of Ansible. This leads to an organization being stuck on an ancient version of Ansible configured on the Rundeck server - therefore making the usage of this plugin impossible (jobs then have to be managed with wrapper scripts to set the environments).

nodes from groups of groups

Hi,

We make pretty heavy use of groups of groups in our ansible inventory files. I just noticed that if we use something like the following in our /etc/ansible/hosts file our nodes list in rundeck does not return any nodes.

[group1]
nodeaaa

[group2]
nodebbb

[biggroup:children]
group1
group2

Im running rundeck2.6.7 on smartos. Is this known or am have I missed something?

Thanks

Pass Rundeck options through to playbooks

Not sure if this is a duplicate of #7 or not, but there needs to be a way to pass a Rundeck job's options through to Ansible. Right now I'm kinda stuck using a separate playbook for each permutation of a step that I'd normally parameterize, like deployments to different envs.

It'd be awesome if the playbook step automagically passed the job's options through as --extra-vars, but just making them available in the environment would be fine too.

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.