Coder Social home page Coder Social logo

ansible-toolkit-ucd's People

Contributors

fewproud avatar

Stargazers

 avatar

Watchers

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

Forkers

osmanburucu-ibm

ansible-toolkit-ucd's Issues

Tutorial

Do you have a tutorial how to use ansible plugin with urban deploy?

java exception in every step of plugin (doesn't matter which one)

during execution i get java exceptions, but step works..
here the output of the step:

plugin: AnsibleToolkit, id: com.urbancode.air.plugin.AnsibleToolkit, version: 53
plugin command: '/opt/ucd/agent/opt/groovy-2.4.15/bin/groovy' '-cp' '/opt/ucd/agent/var/plugins/com.urbancode.air.plugin.AnsibleToolkit_53_64fea7060cb6109785ac23130dd0820245a7b0a452098e29b4fbbbfe57ca65c1/classes:/opt/ucd/agent/var/plugins/com.urbancode.air.plugin.AnsibleToolkit_53_64fea7060cb6109785ac23130dd0820245a7b0a452098e29b4fbbbfe57ca65c1/lib/groovy-plugin-utils-1.2.jar' '/opt/ucd/agent/var/plugins/com.urbancode.air.plugin.AnsibleToolkit_53_64fea7060cb6109785ac23130dd0820245a7b0a452098e29b4fbbbfe57ca65c1/file.groovy' '/opt/ucd/agent/var/temp/logs-11712852-f88a-4f52-b50f-57e741df2a0f/input.props' '/opt/ucd/agent/var/temp/logs-11712852-f88a-4f52-b50f-57e741df2a0f/output.props'
working directory: /opt/ucd/agent/var/work/apache-tomcat
properties:
PLUGIN_INPUT_PROPS=/opt/ucd/agent/var/temp/logs-11712852-f88a-4f52-b50f-57e741df2a0f/input.props
PLUGIN_OUTPUT_PROPS=/opt/ucd/agent/var/temp/logs-11712852-f88a-4f52-b50f-57e741df2a0f/output.props
dest=
group=
mode=
owner=
path=/opt/webservers/sit-apache-tomcat-7.0.42
recurse=yes
src=
state=directory
with_items=
environment:
AGENT_HOME=/opt/ucd/agent
AH_AUTH_TOKEN=****
AH_WEB_URL=https://cos8l.local.net:8443
AUTH_TOKEN=****
DS_AUTH_TOKEN=****
DS_SYSTEM_ENCODING=UTF-8
JAVA_OPTS=-Dfile.encoding=UTF-8 -Dconsole.encoding=UTF-8
PLUGIN_HOME=/opt/ucd/agent/var/plugins/com.urbancode.air.plugin.AnsibleToolkit_53_64fea7060cb6109785ac23130dd0820245a7b0a452098e29b4fbbbfe57ca65c1
UD_DIALOGUE_ID=11712852-f88a-4f52-b50f-57e741df2a0f
WE_ACTIVITY_ID=173540b2-ed59-37d0-d2a2-9ebc4dfe4b4f

command is ansible-playbook tmp1594842898467.yml -vvvv
Exception in thread "Thread-1" groovy.lang.GroovyRuntimeException: exception while reading process stream
at org.codehaus.groovy.runtime.ProcessGroovyMethods$TextDumper.run(ProcessGroovyMethods.java:496)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Stream closed
at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:170)
at java.io.BufferedInputStream.read(BufferedInputStream.java:336)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:161)
at java.io.BufferedReader.readLine(BufferedReader.java:324)
at java.io.BufferedReader.readLine(BufferedReader.java:389)
at org.codehaus.groovy.runtime.ProcessGroovyMethods$TextDumper.run(ProcessGroovyMethods.java:489)
... 1 more
ansible-playbook 2.9.10
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
executable location = /usr/local/bin/ansible-playbook
python version = 3.6.8 (default, Apr 16 2020, 01:36:27) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
No config file found; using defaults
setting up inventory plugins
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Set default localhost to localhost
Parsed /etc/ansible/hosts inventory source with ini plugin
Loading callback plugin default of type stdout, v2.0 from /usr/local/lib/python3.6/site-packages/ansible/plugins/callback/default.py

PLAYBOOK: tmp1594842898467.yml *************************************************
Positional arguments: tmp1594842898467.yml
verbosity: 4
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/etc/ansible/hosts',)
forks: 5
1 plays in tmp1594842898467.yml

PLAY [localhost] ***************************************************************

TASK [Gathering Facts] *********************************************************
task path: /opt/ucd/agent/var/work/apache-tomcat/tmp1594842898467.yml:1
ESTABLISH LOCAL CONNECTION FOR USER: root
EXEC /bin/sh -c 'echo ~root && sleep 0'
EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /root/.ansible/tmp"&& mkdir /root/.ansible/tmp/ansible-tmp-1594842900.3265662-53680-200575824555424 && echo ansible-tmp-1594842900.3265662-53680-200575824555424="echo /root/.ansible/tmp/ansible-tmp-1594842900.3265662-53680-200575824555424" ) && sleep 0'
Attempting python interpreter discovery
EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
EXEC /bin/sh -c '/usr/bin/python3.6 && sleep 0'
Using module file /usr/local/lib/python3.6/site-packages/ansible/modules/system/setup.py
PUT /root/.ansible/tmp/ansible-local-53672mkaps7wb/tmp0b3_yv5g TO /root/.ansible/tmp/ansible-tmp-1594842900.3265662-53680-200575824555424/AnsiballZ_setup.py
EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1594842900.3265662-53680-200575824555424/ /root/.ansible/tmp/ansible-tmp-1594842900.3265662-53680-200575824555424/AnsiballZ_setup.py && sleep 0'
EXEC /bin/sh -c '/usr/libexec/platform-python /root/.ansible/tmp/ansible-tmp-1594842900.3265662-53680-200575824555424/AnsiballZ_setup.py && sleep 0'
EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1594842900.3265662-53680-200575824555424/ > /dev/null 2>&1 && sleep 0'
ok: [localhost]
META: ran handlers

TASK [file] ********************************************************************
task path: /opt/ucd/agent/var/work/apache-tomcat/tmp1594842898467.yml:4
ESTABLISH LOCAL CONNECTION FOR USER: root
EXEC /bin/sh -c 'echo ~root && sleep 0'
EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /root/.ansible/tmp"&& mkdir /root/.ansible/tmp/ansible-tmp-1594842901.3811712-53802-170310842457955 && echo ansible-tmp-1594842901.3811712-53802-170310842457955="echo /root/.ansible/tmp/ansible-tmp-1594842901.3811712-53802-170310842457955" ) && sleep 0'
Using module file /usr/local/lib/python3.6/site-packages/ansible/modules/files/file.py
PUT /root/.ansible/tmp/ansible-local-53672mkaps7wb/tmpxi4b8ml8 TO /root/.ansible/tmp/ansible-tmp-1594842901.3811712-53802-170310842457955/AnsiballZ_file.py
EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1594842901.3811712-53802-170310842457955/ /root/.ansible/tmp/ansible-tmp-1594842901.3811712-53802-170310842457955/AnsiballZ_file.py && sleep 0'
EXEC /bin/sh -c '/usr/libexec/platform-python /root/.ansible/tmp/ansible-tmp-1594842901.3811712-53802-170310842457955/AnsiballZ_file.py && sleep 0'
EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1594842901.3811712-53802-170310842457955/ > /dev/null 2>&1 && sleep 0'
changed: [localhost] => {
"changed": true,
"diff": {
"after": {
"path": "/opt/webservers/sit-apache-tomcat-7.0.42",
"state": "directory"
},
"before": {
"path": "/opt/webservers/sit-apache-tomcat-7.0.42",
"state": "absent"
}
},
"gid": 0,
"group": "root",
"invocation": {
"module_args": {
"_diff_peek": null,
"_original_basename": null,
"access_time": null,
"access_time_format": "%Y%m%d%H%M.%S",
"attributes": null,
"backup": null,
"content": null,
"delimiter": null,
"directory_mode": null,
"follow": true,
"force": false,
"group": null,
"mode": null,
"modification_time": null,
"modification_time_format": "%Y%m%d%H%M.%S",
"owner": null,
"path": "/opt/webservers/sit-apache-tomcat-7.0.42",
"recurse": true,
"regexp": null,
"remote_src": null,
"selevel": null,
"serole": null,
"setype": null,
"seuser": null,
"src": null,
"state": "directory",
"unsafe_writes": null
}
},
"mode": "0775",
"owner": "root",
"path": "/opt/webservers/sit-apache-tomcat-7.0.42",
"size": 6,
"state": "directory",
"uid": 0
}
META: ran handlers
META: ran handlers

PLAY RECAP *********************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

Does not work with Groovy V3 (UCD 7.2.1 or newer)

Step is working with older UCD Agent version and Groovy V2.x, but as soon a newer UCD agent (7.2.1 or newer) with Groovy V3 is used i get this error message:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
file:/opt/ucd/agent/var/plugins/com.urbancode.air.plugin.AnsibleToolkit_53_64fea7060cb6109785ac23130dd0820245a7b0a452098e29b4fbbbfe57ca65c1/classes/com/urbancode/air/AirPluginTool.groovy: 34: The variable [inputPropsStream] is declared final but is reassigned
. At [34:13]  @ line 34, column 13.
               inputPropsStream = new FileInputStream(inputPropsFile);
               ^

1 error

stdOut.txt
Screenshot 2022-05-01 at 15 03 20

UrbanCode Ansible Plugin hangs

Issuing the command from the server runs just fine. Below is the command.

ansible-playbook ./playbooks/appserver/deploy_cluster.yml -i inventories/dev/hosts -e "platform_properties=DR2 cluster_name=RxNovaProvider cluster_version=trunk"

When entering the same command from UrbanCode the ansible command never completes. It will run until I issue a kill on the process.

When it hangs there are two processes running. The parent is "/usr/bin/python2 /bin/ansible-playbook tmp1551815896637.yml -vvvv". The other process is a defunct process and looks like this "[ansible-playboo] "

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.