Help us understand the problem. What is going on with this article?

rundeckをdocker-composeで使う

目的

rundeck にアクセスでき、使用できるようになる。

前提

以下のセットアップが完了していること。
・CentOS7
・docker
・docker-compose
  → /usr/local/bin/docker-compose にあるものとする

動作を確認した構成は次の通り。

 # cat /etc/centos-release
 CentOS Linux release 7.6.1810 (Core)

 # docker -v
 Docker version 18.09.6, build 481bc77156

 # docker-compose -v
 docker-compose version 1.23.2, build 1110ad01

ディレクトリ構造

ディレクトリ構造は以下の通り。

/root/dev/rundeck/
docker-compose.yaml
projects/
 → Projet 保存場所
scripts/
 → script 保管場所

docker-compose.yaml

rundeck の RUNDECK_GRAILS_URL: には任意の URL を設定します。
例:RUNDECK_GRAILS_URL: http://192.168.1.15:4440

以下設定しているのは、ssh の鍵を共有するためと名前解決のため
- /root/dev/rundeck/.ssh:/home/rundeck/.ssh/
- /etc/hosts:/etc/hosts

docker-compose.yaml
version: '3'

services:
    rundeck:
        image: rundeck/rundeck:SNAPSHOT
        hostname: rundeck
        links:
          - mysql
        environment:
            RUNDECK_DATABASE_DRIVER: com.mysql.jdbc.Driver
            RUNDECK_DATABASE_USERNAME: rundeck
            RUNDECK_DATABASE_PASSWORD: rundeck
            RUNDECK_DATABASE_URL: jdbc:mysql://mysql/rundeck?autoReconnect=true&useSSL=false
            RUNDECK_GRAILS_URL: http://<URL>:4440
        volumes:
          - ${RUNDECK_LICENSE_FILE:-/dev/null}:/home/rundeck/etc/rundeckpro-license.key
          - /root/dev/rundeck/projects/:/home/rundeck/projects/
          - /root/dev/rundeck/scripts:/home/rundeck/scripts/
          - /root/dev/rundeck/.ssh:/home/rundeck/.ssh/
          - /etc/hosts:/etc/hosts
        ports:
          - 4440:4440
    mysql:
        image: mysql:5.7
        environment:
          - MYSQL_ROOT_PASSWORD=root
          - MYSQL_DATABASE=rundeck
          - MYSQL_USER=rundeck
          - MYSQL_PASSWORD=rundeck
        volumes:
          - dbdata:/var/lib/mysql

volumes:
    dbdata:

docker-compose 起動

rundeck コンテナが UP になっても、web画面にアクセスできるようになるまでしばらく時間がかかります。

# cd /root/dev/rundeck/
# docker-compose up -d

起動状況を確認する
# docker-compose logs rundeck
★出力例
rundeck_1  | [2019-06-15 15:35:53.332]  INFO BootStrap --- [           main] Starting Rundeck 3.1.0-SNAPSHOT (2019-06-04) ...
rundeck_1  | [2019-06-15 15:35:53.358]  INFO BootStrap --- [           main] using rdeck.base config property: /home/rundeck
rundeck_1  | [2019-06-15 15:35:53.395]  INFO BootStrap --- [           main] loaded configuration: /home/rundeck/etc/framework.properties
rundeck_1  | [2019-06-15 15:35:53.408]  WARN BootStrap --- [           main] Cluster mode enabled, this server's UUID: a14bc3e6-75e8-4fe4-a90d-a16dcc976bf6
rundeck_1  | [2019-06-15 15:35:53.562]  INFO BootStrap --- [           main] RSS feeds disabled
rundeck_1  | [2019-06-15 15:35:53.563]  INFO BootStrap --- [           main] Using jaas authentication
rundeck_1  | [2019-06-15 15:35:53.579]  INFO BootStrap --- [           main] Preauthentication is disabled
rundeck_1  | [2019-06-15 15:35:53.584]  WARN BootStrap --- [           main] Feature 'cleanExecutionHistoryJob' is enabled
rundeck_1  | [2019-06-15 15:35:55.513]  INFO BootStrap --- [           main] Rundeck is ACTIVE: executions can be run.
rundeck_1  | [2019-06-15 15:35:55.852]  INFO BootStrap --- [           main] Rundeck startup finished in 3039ms
rundeck_1  | Grails application running at http://0.0.0.0:4440/ in environment: production

これでとりあえずログインまでできるようになりました。

http://192.168.1.15:4440

デフォルトのユーザ名は admin で、パスワードも同様でした。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away