rundeck-plugins / ansible-plugin

Ansible Integration for Rundeck
MIT License
331 stars 100 forks source link

Build from Dockerfile fails | "Step 13/20 : COPY build/libs/ansible-plugin-*.jar ${RDECK_BASE}/libext/ No source files were specified" #142

Closed thecityofguanyu closed 7 years ago

thecityofguanyu commented 7 years ago

Title. Pulling the batix/rundeck-ansible image works fine.

I was getting some errors (not listed in this issue) when attempting to run Rundeck Workflows. A bit of Googling led me to where some people pointed rundeck-launcher-2.9.1.jar as exhibiting the same troubles that I was seeing.

As a troubleshooting step, I attempted to clone this repo, changed the curl line to pull down 2.9.2, and build the image. The build failed. Reverting the changed curl line results in the same issue.

user@localhost:~# docker build -t rundeck-ansible-292/opt/rundeck-ansible-plugin/
Sending build context to Docker daemon  8.704kB
Step 1/20 : FROM alpine
 ---> 7328f6f8b418
Step 2/20 : MAINTAINER David Kirstein <dak@batix.com>
 ---> Using cache
 ---> 952c2e73aeac
Step 3/20 : RUN apk --no-cache add sudo python py-pip openssl ca-certificates &&   apk --no-cache add --virtual build-deps python-dev libffi-dev openssl-dev build-base &&   pip --no-cache-dir install --upgrade pip cffi &&   pip --no-cache-dir install ansible==2.3.1.0 &&   apk del build-deps &&   mkdir -p /etc/ansible
 ---> Using cache
 ---> 24e48c8ae9cc
Step 4/20 : ENV RDECK_BASE /opt/rundeck
 ---> Using cache
 ---> 2ba3a726b443
Step 5/20 : ENV RDECK_JAR ${RDECK_BASE}/rundeck-launcher.jar
 ---> Using cache
 ---> 60eca7c7fb81
Step 6/20 : ENV PATH ${PATH}:${RDECK_BASE}/tools/bin
 ---> Using cache
 ---> 9cfc40ae2c37
Step 7/20 : ENV MANPATH ${MANPATH}:${RDECK_BASE}/docs/man
 ---> Using cache
 ---> f0aa2950c00a
Step 8/20 : ENV RDECK_ADMIN_PASS rdtest2017
 ---> Using cache
 ---> 2d8269bc21cc
Step 9/20 : RUN apk --no-cache add openjdk8-jre bash curl &&   mkdir -p ${RDECK_BASE} &&   mkdir ${RDECK_BASE}/libext &&   curl -SLo ${RDECK_BASE}/libext/ansible-plugin.jar http://dl.bintray.com/rundeck/rundeck-maven/rundeck-launcher-2.9.2.jar
 ---> Running in 5ba6ad232da8
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.6/community/x86_64/APKINDEX.tar.gz
(1/39) Installing bash (4.3.48-r1)
Executing bash-4.3.48-r1.post-install
(2/39) Installing libssh2 (1.8.0-r1)
(3/39) Installing libcurl (7.55.0-r0)
(4/39) Installing curl (7.55.0-r0)
(5/39) Installing libtasn1 (4.10-r2)
(6/39) Installing p11-kit (0.23.2-r1)
(7/39) Installing p11-kit-trust (0.23.2-r1)
(8/39) Installing java-cacerts (1.0-r0)
(9/39) Installing libxau (1.0.8-r1)
(10/39) Installing libbsd (0.8.3-r3)
(11/39) Installing libxdmcp (1.1.2-r3)
(12/39) Installing libxcb (1.12-r0)
(13/39) Installing libx11 (1.6.5-r0)
(14/39) Installing libxcomposite (0.4.4-r0)
(15/39) Installing libxext (1.3.3-r1)
(16/39) Installing libxi (1.7.9-r0)
(17/39) Installing libxrender (0.9.10-r1)
(18/39) Installing libxtst (1.2.3-r0)
(19/39) Installing alsa-lib (1.1.3-r0)
(20/39) Installing libpng (1.6.29-r1)
(21/39) Installing freetype (2.7.1-r1)
(22/39) Installing libgcc (6.3.0-r4)
(23/39) Installing giflib (5.1.4-r1)
(24/39) Installing libjpeg-turbo (1.5.1-r0)
(25/39) Installing libstdc++ (6.3.0-r4)
(26/39) Installing openjdk8-jre-lib (8.131.11-r2)
(27/39) Installing java-common (0.1-r0)
(28/39) Installing krb5-conf (1.0-r1)
(29/39) Installing libcom_err (1.43.4-r0)
(30/39) Installing keyutils-libs (1.5.9-r1)
(31/39) Installing libverto (0.2.5-r2)
(32/39) Installing krb5-libs (1.14.3-r2)
(33/39) Installing lcms2 (2.8-r1)
(34/39) Installing nspr (4.13.1-r0)
(35/39) Installing nss (3.30.1-r0)
(36/39) Installing pcsc-lite-libs (1.8.21-r0)
(37/39) Installing lksctp-tools (1.0.17-r0)
(38/39) Installing openjdk8-jre-base (8.131.11-r2)
(39/39) Installing openjdk8-jre (8.131.11-r2)
Executing busybox-1.26.2-r5.trigger
Executing ca-certificates-20161130-r2.trigger
Executing java-common-0.1-r0.trigger
OK: 142 MiB in 67 packages
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 94.3M  100 94.3M    0     0  22974      0  1:11:46  1:11:46 --:--:-- 10.6M
 ---> 93081c7c0c81
Removing intermediate container 5ba6ad232da8
Step 10/20 : COPY docker/realm.properties ${RDECK_BASE}/server/config/
 ---> d951c7dbb685
Removing intermediate container 31b44f7abc01
Step 11/20 : COPY docker/run.sh /
 ---> 57959841af7a
Removing intermediate container 8f05bf05979a
Step 12/20 : RUN chmod +x /run.sh
 ---> Running in 749712e786ee
 ---> 72f36a977534
Removing intermediate container 749712e786ee
Step 13/20 : COPY build/libs/ansible-plugin-*.jar ${RDECK_BASE}/libext/
No source files were specified
frozenice commented 7 years ago

You need to build the .jar first, this is done with ./gradlew jar, for example. This is only mentioned in old release docs, because the Docker image creation and upload is done automatically via Travis CI. May I ask why you want to build your own image?

thecityofguanyu commented 7 years ago

@frozenice thanks for the heads up there! I couldn't find those old release docs detailing those instructions.

May I ask why you want to build your own image?

I was getting some errors (not listed in this issue OP) when attempting to run anisble playbooks via Rundeck Workflows from the prebuilt batix/rundeck-ansible image. A bit of Googling led me to where some people pointed rundeck-launcher-2.9.1.jar as exhibiting similar troubles to that I was seeing. It also noted that those troubles may be fixed in 2.9.2.

I wanted to test rundeck-launcher-2.9.2.jar to see for myself; however, but the Dockerfile for the master branch here looks like it still pulls 2.9.1. I figured building my own build be easier to at least test 2.9.2 (not realizing you need to build the jar).

As far as the error that prompted this goes: I believe it was java.lang.NoSuchMethodError: com.dtolabs.rundeck.core.execution.ExecutionContext.getDataContext()Ljava/util/Map. That build be the error when trying to run any Ansible playbook from the Rundeck WebUI. Node discovery from the inventory.ini file was fine, but it would throw the error on attempted playbook execution.

frozenice commented 7 years ago

@thecityofguanyu Okay, awesome. :) Feel free to open an issue or PR if you find out details.