0
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

rundeckをdocker-composeで使う

Posted at

目的

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

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

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

0
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?