urbancode / ansible-toolkit-ucd Goto Github PK
View Code? Open in Web Editor NEWAn IBM UrbanCode Deploy plugin to integrate with Ansible
An IBM UrbanCode Deploy plugin to integrate with Ansible
Do you have a tutorial how to use ansible plugin with urban deploy?
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
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
An ssh connection to localhost is opened during execution as no local connection is defined in the playbook or in ansible.cfg. This doesn't work well with most settings.
Please add connection: local to the playbook generation.
See following information:
https://www.middlewareinventory.com/blog/run-ansible-playbook-locally/
https://droidrant.com/ansible-local-playbooks/
https://docs.ansible.com/ansible/latest/user_guide/playbooks_delegation.html
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] "
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.