GalaxyNGのインストール

GalaxyNGを利用すると、オンプレミス環境に以下の機能をもつAutomation Hubを構築することができる。

  1. Community Galaxyが提供しているAnsibleのRoleやCollectionsのリポジトリ機能
  2. Quayのようなコンテナレジストリサイトが提供する、Execution Environmentのコンテナイメージのレジストリ機能

2022年4月現在のインストール方法を備忘録として残しておく。

環境

GalaxyNGのインストール

公式のガイドにしたがってインストールする。 <=できなかった。

まずはAnsible Coreのインストールから。インストールガイドの要件にAnsible 2.10+とあるので、Fedora35ではansible (2.9系)ではなくansible-core(2.12系)をdnfコマンドでインストールする。

$ sudo dnf install -y ansible-core

ansible-coreには、ansible.posixやcommunity.galaxyのようなCollectionは含まれないので、Collectionsは必要に応じてansible-galaxyコマンドでインストールする。

GalaxyNGの実体は、Pulpプラグインなので、pulpをインストールするためのCollection(pulp_installer)を利用してインストールすることになる。そこで、あらかじめpulp_installerを利用したインストールに必要となる設定ファイルとPlaybook一式を用意しておいた。

Playbookの実行前に、pulp_installerと、それが依存しているRoleとCollectionをインストールしておくのを忘れずに。

$ git clone https://github.com/saito-hideki/galaxyng_installer
$ cd galaxyng_installer
$ ansible-galaxy collection install pulp.pulp_installer
$ ansible-galaxy install -r collections/ansible_collections/pulp/pulp_installer/requirements.yml
$ ansible-playbook -i hosts --extra-vars "@version.yml" --ask-become-pass install.yml

インストールに利用する各設定ファイルとPlaybookは、いまのところ以下の通り。version.ymlに設定しているプラグインは、それぞれ要求するpulpcoreバージョンが違うので、単純に最新版を...というインストールを行おうとすると失敗するので要注意。

  • ansible.cfg
[defaults]
host_key_checking = False
collections_paths = ./collections
  • hosts(FQDNを適切に変更する)
galaxyng.example.com ansible_connection=local
  • install.yml(secret_keyとpulp_default_admin_passwordを適切に変更する)
---
- hosts: all
  force_handlers: True
  vars:
    pulp_settings:
      secret_key: changeme
      content_origin: "https://{{ inventory_hostname }}"
    pulp_default_admin_password: changeme
  roles:
    - pulp.pulp_installer.pulp_all_services
  environment:
    DJANGO_SETTINGS_MODULE: pulpcore.app.settings
  • version.yml(2022/04現在で各プラグインのバージョン間でミスマッチがでない最新版を設定している)
---
pulpcore_version: 3.15.7
pulp_install_plugins:
  galaxy-ng:
    version: 4.4.3
  pulp-ansible:
    version: 0.10.3
  pulp-container:
    version: 2.8.6

いまのところ、公式ドキュメントのインストールガイドで提供されているPlaybookを利用するよりも、pulp_installerのドキュメントを参考に、各プラグインを適切にバージョン指定してインストールしたほうが良いという点に要注意。

GalaxyNGへのログイン

インストールが完了すると、Webブラウザから https://{{ inventory_hostname }}/ にアクセスすることで、ダッシュボードにログインして操作できるようになっているはず。

f:id:pyde:20220404004750p:plain

起動停止

GalaxyNGの起動・停止はsystemctlコマンドで実行できる。

$ sudo systemctl [start|stop|restart] pulpcore*