LoginSignup
1
0

More than 5 years have passed since last update.

JenkinsのRole-based Authorization Strategyプラグイン使用時にリモートビルドでエラー

Last updated at Posted at 2019-02-04

Jenkinsのユーザ情報をActive Directoryで制御していて、且つ、権限管理を「Role-Based Strategy」に設定した場合に、リモートビルドがうまくいかなくてハマったので残しておきます。

環境

  • Jenkins : 2.150.1
  • Role-Based Strategyプラグイン : 2.9.0

Jenkinsの管理設定

Active Directory管理

  • [Jenkinsの管理]→[グローバルセキュリティの設定]→[セキュリティを有効化]にチェックを入れて、Active Directory情報を入力し保存します。
    image.png

Role-Based Strategy設定

  • [Jenkinsの管理]→[プラグインの管理]の順に選択し、「Role-based Authorization Strategy」にチェックを入れてインストールします。

    image.png

  • [Jenkinsの管理]→[グローバルセキュリティの設定]→[権限管理]の順に選択し、「Role-Based Strategy」にチェックを入れて保存します。

    image.png

  • [Jenkinsの管理]→[Manage and Assign Roles]の順に選択します(Manage and Assign Rolesは、前の手順でRole-Based Strategyにチェックを入れてないと表示されません)

    image.png

  • [Assign Roles]を選択します。

    image.png

  • 初期状態はこんな感じになってるはずです。

    image.png

リモートビルドでエラー

この状態でリモートビルドを実行しようとするとエラーになります。
これは大文字のユーザ「Shingo_Kawahara」ではadmin権限があるが、リモートビルドからユーザ指定で実行しようとした場合、JenkinsユーザIDの小文字「shingo_kawahara」を使おうとして、権限を持っていない為です。(エラーメッセージ見ても分からない・・・)

image.png

  • ということで、小文字のJenkinsユーザIDも権限を付与してあげると、無事リモートビルドが通ります。表示名じゃなくて、JenkinsIDをちゃんと確認したほうがいいですね。。
    image.png

参考:リモートビルド実行手順

Jenkinsでパラメータ付きジョブをリモートビルドする

1
0
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
1
0