機械翻訳について

9 Oracle Linux Automation Managerのアップグレード

次の章では、Oracle Linux Automation Managerをアップグレードする手順について説明します。

リリース1.0.Xからリリース2.0単一ホスト・デプロイメントへのアップグレード

Oracle Linux Automation Managerリリース1.0.xの単一ホスト・インスタンスをOracle Linux Automation Managerリリース2.0の単一ホスト・インスタンスにアップグレードするには、次を実行します:

  1. アップグレードするOracle Linux Automation Managerリリース1.0.xバージョンの端末にログインします。
  2. /etc/tower/SECRET_KEYファイルを安全なロケーションにバックアップします。 たとえば、ファイルをホーム・ディレクトリにコピーできます:
    sudo cp /etc/tower/SECRET_KEY ~
  3. Oracle Linux Automation Managerを停止します。
    sudo systemctl stop ol-automation-manager
  4. データベースを制御するユーザー・アカウントにログインします。
    sudo su - postgres
  5. データベースをリストアするために必要なすべてのSQLコマンドおよび入力データを含むスクリプト・ファイルを作成する次のコマンドを使用して、データベースをエクスポートします。 たとえば、このコマンドは、データベース・ホーム・ディレクトリにolam1.dumpファイルを作成します。
    pg_dumpall > olamv1.dump
  6. データベースを制御するユーザー・アカウントを終了します。
    exit
  7. データベース・サーバーを停止します。
    sudo systemctl stop postgresql
  8. 既存のデータベース・データ・ディレクトリを削除(およびオプションでバックアップ)します。 たとえば、次のコマンドは、ホーム・ディレクトリ内のバックアップ・ファイルを削除して作成します。
    sudo mv /var/lib/pgsql/data/ ~/data.old
  9. データベースの現在のバージョンを削除します。
    sudo dnf remove postgresql
  10. postgresql 12またはpostgresql 13モジュール・ストリームを有効にします。
    sudo dnf module reset postgresql
    sudo dnf module enable postgresql:12

    または

    sudo dnf module reset postgresql
    sudo dnf module enable postgresql:13

    ノート:

    Postgresql 12および13のライフサイクルの詳細については、「Oracle Linux: Oracle Linuxでのソフトウェアの管理」にあるストリーム・モジュールのアプリケーション・ライフ・サイクルに関する付録を参照してください。
  11. 「Oracle Linux Automation Managerパッケージへのアクセスの有効化」の説明に従って、リリース2のOracle Linux Automation Manager Yumリポジトリを有効にします。
  12. Oracle Linux Automation Managerを更新します。
    sudo dnf update ol-automation-manager

    注意:

    別のリポジトリからansibleパッケージをインストールした場合(たとえば、EPEL)、インストールおよびアップグレード・プロセスによって、このパッケージがansible-coreパッケージで上書きされます。

    ノート:

    アップグレード・プロセス中に確認された次のメッセージは、障害を示していないため無視しても問題ありません:

    ValueError: File context for /var/run/tower(/.*)? already defined
  13. データベースをインストールします。
    sudo dnf install postgresql-server
  14. 更新が完了したら、データベースを設定します。
    sudo postgresql-setup --initdb
    sudo systemctl start postgresql
    sudo su - postgres
    psql -d postgres -f olamv1.dump
    exit
  15. 次のコマンドを実行して、データベースが使用可能かどうかを確認します:
    sudo su - postgres -c "psql -l |grep awx"
    出力は次のようになります:
    awx       | awx      | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
  16. /etc/tower/settings.py/etc/tower/settings.py.rpmnewに置き換えます。 たとえば:
    sudo mv /etc/tower/settings.py /etc/tower/settingsold.py
    sudo mv /etc/tower/settings.py.rpmnew /etc/tower/settings.py
  17. /etc/tower/settings.py ファイルで、CLUSTER_HOST_IDを次のように設定します:
    CLUSTER_HOST_ID = "hostname or ip address"
    前の例では、「ホスト名またはIPアドレス」は、Oracle Linux Automation Managerを実行しているシステムのホスト名またはIPアドレスです。 ホスト名を使用する場合は、ホストが解決可能である必要があります。
  18. /etc/nginx/nginx.confで、既存の構成をすべて削除し、次のテキストに置き換えます:
    user nginx;
    worker_processes auto;
    error_log /var/log/nginx/error.log;
    pid /run/nginx.pid;
     
    # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
    include /usr/share/nginx/modules/*.conf;
     
    events {
     worker_connections 1024;
    }
     
    http {
     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                       '$status $body_bytes_sent "$http_referer" '
                       '"$http_user_agent" "$http_x_forwarded_for"';
     
     access_log  /var/log/nginx/access.log  main;
     
     sendfile            on;
     tcp_nopush          on;
     tcp_nodelay         on;
     keepalive_timeout   65;
     types_hash_max_size 2048;
     
     include             /etc/nginx/mime.types;
     default_type        application/octet-stream;
     
     # Load modular configuration files from the /etc/nginx/conf.d directory.
     # See http://nginx.org/en/docs/ngx_core_module.html#include
     # for more information.
     include /etc/nginx/conf.d/*.conf;
    }
  19. /etc/nginx/conf.d/ol-automation-manager-nginx.confで、既存の構成をすべて削除し、次のテキストに置き換えます:
    upstream uwsgi {
        server unix:/var/run/tower/uwsgi.sock;
    }
    
    upstream daphne {
        server unix:/var/run/tower/daphne.sock;
    }
    
    server {
        listen 443 default_server ssl;
        listen 127.0.0.1:80 default_server;
        listen [::]:443 default_server ssl;
        listen [::1]:80 default_server;
    
        # If you have a domain name, this is where to add it
        server_name _;
        keepalive_timeout 65;
    
        ssl_certificate /etc/tower/tower.crt;
        ssl_certificate_key /etc/tower/tower.key;
    
        ssl_session_timeout 1d;
        ssl_session_cache shared:SSL:50m;
        ssl_session_tickets off;
    
        # intermediate configuration. tweak to your needs.
        ssl_protocols TLSv1.2;
        ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
        ssl_prefer_server_ciphers on;
    
        # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months)
        add_header Strict-Transport-Security max-age=15768000;
        # add_header Content-Security-Policy "default-src 'self'; connect-src 'self' ws: wss:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' *.pendo.io; img-src 'self' *.pendo.io data:; report-uri /csp-violation/";
        # add_header X-Content-Security-Policy "default-src 'self'; connect-src 'self' ws: wss:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' *.pendo.io; img-src 'self' *.pendo.io data:; report-uri /csp-violation/";
    
        location /favicon.ico { alias /var/lib/awx/venv/awx/lib/python3.8/site-packages/awx/ui/build/static/media/favicon.ico; }
    
        location /static/ {
            alias /var/lib/awx/venv/awx/lib/python3.8/site-packages/awx/ui/build/static/;
        }
    
        location /websocket {
            # Pass request to the upstream alias
            proxy_pass http://daphne;
            # Require http version 1.1 to allow for upgrade requests
            proxy_http_version 1.1;
            # We want proxy_buffering off for proxying to websockets.
            proxy_buffering off;
            # http://en.wikipedia.org/wiki/X-Forwarded-For
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            # enable this if you use HTTPS:
            proxy_set_header X-Forwarded-Proto https;
            # pass the Host: header from the client for the sake of redirects
            proxy_set_header Host $http_host;
            # We've set the Host header, so we don't need Nginx to muddle
            # about with redirects
            proxy_redirect off;
            # Depending on the request value, set the Upgrade and
            # connection headers
            proxy_set_header Upgrade $http_upgrade;
            # proxy_set_header Connection $connection_upgrade;
            proxy_set_header Connection upgrade;
        }
    
        location / {
            # Add trailing / if missing
            rewrite ^(.*[^/])$ $1/ permanent;
            uwsgi_read_timeout 120s;
            uwsgi_pass uwsgi;
            include /etc/nginx/uwsgi_params;
        }
    }
  20. Receptorのデフォルト構成をすべて削除します。 /etc/receptor/receptor.confを編集して、次の構成を含めます:

    ---
    - node:
        id: <hostname or ip address>
     
    - log-level: debug
     
    - tcp-listener:
        port: 27199
     
    #- work-signing:
    #    privatekey: /etc/receptor/work_private_key.pem
    #    tokenexpiration: 1m
     
    #- work-verification:
    #    publickey: /etc/receptor/work_public_key.pem
     
    #- tcp-peer:
    #    address: 100.100.253.53:27199
    #    redial: true
     
    #- tls-server:
    #    name: mutual-tls
    #    cert: /etc/receptor/certs/awx.crt
    #    key: /etc/receptor/certs/awx.key
    #    requireclientcert: true
    #    clientcas: /etc/receptor/certs/ca.crt
     
    - control-service:
        service: control
        filename: /var/run/receptor/receptor.sock
     
    - work-command:
        worktype: local
        command: /var/lib/ol-automation-manager/venv/awx/bin/ansible-runner
        params: worker
        allowruntimeparams: true
    #    verifysignature: true

    前の例では、「ホスト名またはIPアドレス」は、Oracle Linux Automation Managerを実行しているシステムのホスト名またはIPアドレスです。 ホスト名を使用する場合は、ホストが解決可能である必要があります。

  21. awxユーザーとしてOracle Linux Automation Managerデプロイメントを準備します。 次を実行します。

    1. 次のコマンドを実行します。

      sudo su -l awx -s /bin/bash
      podman system migrate
      podman pull container-registry.oracle.com/oracle_linux_automation_manager/olam-ee:latest
      awx-manage makemigrations --merge
      awx-manage migrate
      awx-manage register_default_execution_environments

      ノート:

      Oracle Linux Automation Managerのアップグレードが終了したら、実行環境でプレイブックの実行時に常に最新のolam-eeコンテナ・イメージをプルするか、他のオプションを使用するかを構成できます。 これらのオプションの詳細は、「Oracle Linux Automation Manager 2.1: ユーザーズ・ガイド」を参照してください。
    2. awxシェル環境を終了します。
      exit
  22. /etc/tower/SECRET_KEYファイルをリストアします。 たとえば:
    sudo cp ~/SECRET_KEY /etc/tower/SECRET_KEY
  23. /etc/tower/settings.py ファイルに、次の行を追加します:
    DEFAULT_EXECUTION_QUEUE_NAME = 'tower'
    DEFAULT_CONTROL_PLANE_QUEUE_NAME = 'tower' 
  24. NGINXを再起動します。
    sudo systemctl restart nginx
  25. Oracle Linux Automation Managerを起動します。
    sudo systemctl start ol-automation-manager

リリース2.0からリリース2.1へのアップグレード

このアップグレードは、Oracle Linux Automation ManagerがPrivate Automation Hub実行環境のコンテナ・イメージおよびコレクションを利用するために必要です。
  1. すべてのOracle Linux Automation Manager 2.0ノードで、端末にログインします。
  2. 更新の実行:
    sudo dnf clean all
    sudo dnf update oraclelinux-automation-manager-release-el8
    sudo dnf update ol-automation-manager ol-automation-manager-cli uwsgi 
  3. 最新のolam-eeイメージをプルします。
    sudo su -l awx -s /bin/bash
    podman pull container-registry.oracle.com/oracle_linux_automation_manager/olam-ee:latest
    exit
  4. 次のパラメータを/etc/tower/settings.pyファイルに追加します:
    # OLAM Reaper Job Status Tracking
    REAPER_TIMEOUT_SEC = 60

    REAPER_TIMEOUT_SECパラメータは、「実行中」または「待機中」状態のジョブがスタックしているとみなされ、リーパーによって「失敗」状態に遷移する時間を秒単位で指定します。 このパラメータは、60秒より長く実行されるプレイブックがある場合に変更できます。 このパラメータの詳細は、「Oracle Linux Automation Manager 2.1: インストレーション・ガイド」を参照してください。

  5. すべてのノードで次のサービスを再起動します:
    sudo systemctl restart ol-automation-manager
    sudo systemctl restart nginx
    sudo systemctl restart receptor-awx
  6. 必要に応じて、新しいカスタム実行環境インスタンスのデフォルトの実行環境のロケーションをプライベート自動化ハブ・インスタンスに変更できます。 また、olam-eecontainer-registry.oracle.comからダウンロードしてPrivate Automation Hubでホストし、コントロール・プレーン・インスタンスに使用できます。 これらのデフォルト設定を設定するには、次を実行します:
    1. /etc/tower/settings.pyファイルを次のように編集します:
      GLOBAL_JOB_EXECUTION_ENVIRONMENTS = [{'name': '<customer_execution_environment>)', 'image': '<private_automation_hub_hostname_or_ip_address>/<customer_execution_environment>:latest'}]
      CONTROL_PLANE_EXECUTION_ENVIRONMENT = '<private_automation_hub_hostname_or_ip_address>/olam-ee:latest'
    2. 次のコマンドを使用して、新しいデフォルト環境を登録します:
      sudo su -l awx -s /bin/bash
      awx-manage register_default_execution_environments
      exit
    3. すべてのノードでOracle Linux Automation Managerを再起動します。

      sudo systemctl restart ol-automation-manager

クラスタ化されたデプロイメントへの単一インスタンス・デプロイメントの移行

Oracle Linux Automation Managerの単一ホスト・インスタンス・デプロイメントをクラスタ化されたデプロイメントに移行するには、次を実行します:

  1. 単一インスタンス・ホストをリリース2.0にアップグレードする必要がある場合は、「リリース1.0.Xからリリース2.0単一ホスト・デプロイメントへのアップグレード」のアップグレード手順を完了してください。
  2. アップグレードされたインスタンスが動作していることを確認します。
  3. 端末で、Oracle Linux Automation Managerを停止します。
    sudo systemctl stop ol-automation-manager
  4. データベース・ダンプ・ファイルを作成します。
    sudo su - postgres
    pg_dumpall > olamv2upg.dump
  5. 「ファイアウォール・ルールの設定」の説明に従って、リモート・データベースでファイアウォール・ポートを開きます。
  6. 次の例外を除いて、「ローカルまたはリモート・データベースの設定」でリモート・データベースを設定する手順を実行します:
    1. 手順を開始する前に、ダンプ・ファイルをリモート・データベースにコピーします。 たとえば、scpを使用します。
    2. ステップ7でデータベースを起動した後、ダンプ・ファイルをインポートします:
      sudo su - postgres
      psql -d postgres -f /dirwithbackup/olamv2upg.dump
      exit
    3. データベース・ユーザー・アカウントの作成とデータベースの作成のステップ8から10は、すでにダンプ・ファイルに含まれているためスキップします。
    4. ステップ11でステップを続行します。
  7. リモート・データベースで、パスワードをデータベース・ユーザー・アカウントに再適用します:
    sudo -u postgres psql
    \password awx
  8. awxユーザーのパスワードを入力して確認します。
    Enter new password for user "awx": 
    Enter it again: 
    exit
  9. データベースを再起動します。
    sudo systemctl restart postgresql
  10. アップグレードされたインスタンスに戻り、/etc/tower/settings.pyファイルで、既存のDATABASESフィールドを次のフィールドに置き換えます:
    DATABASES = {
        'default': {
            'ATOMIC_REQUESTS': True,
            'ENGINE': 'awx.main.db.profiled_pg',
            'NAME': 'awx',
            'USER': 'awx',
            'PASSWORD': 'password',
            'HOST': 'database hostname or ip address',
            'PORT': '5432',
        }
    }
    前の例では、「データベースのホスト名またはIPアドレス」はリモート・データベースのホスト名またはIPアドレスです。 ホスト名を使用する場合は、ホストを解決可能である必要があります。「パスワード」は、リモート・データベースを構成した場合のパスワードです。
  11. ローカル・データベースを停止します。
    sudo systemctl stop postgresql
  12. サービス・メッシュに使用されるポートを開きます。
    sudo firewall-cmd --add-port=27199/tcp --permanent
    sudo firewall-cmd --reload
  13. Oracle Linux Automation Managerを起動します。
    sudo systemctl start ol-automation-manager
  14. ローカル・データベースは不要になったため削除します。
    sudo dnf remove postgresql
  15. 次のコマンドを実行します。
    sudo su -l awx -s /bin/bash
  16. Oracle Linux Automation Managerリリース2では使用されないため、towerインスタンス・グループ(キュー名)を削除します。
    awx-manage remove_from_queue --queuename tower --hostname <hostname or IP address>
    

    前の例では、「ホスト名またはIPアドレス」は、Oracle Linux Automation Managerを実行しているシステムのホスト名またはIPアドレスです。

  17. 次のコマンドを実行します
    awx-manage provision_instance --hostname=<hostname or IP address> --node_type=control
    awx-manage register_queue --queuename=controlplane --hostnames=<hostname or IP address>
    exit

    前の例では、「ホスト名またはIPアドレス」は、Oracle Linux Automation Managerを実行しているシステムのホスト名またはIPアドレスです。 ホスト名またはIPアドレスの選択は、/etc/receptor/receptor.confファイル・ノードIDを構成したときに使用したホスト名またはIPアドレスと一致する必要があります(「コントロール・プレーン・サービス・メッシュの構成および起動」を参照)。 ホスト名を使用する場合は、ホストが解決可能である必要があります。

  18. /etc/tower/settings.pyファイルで、次の行を置き換えます。
    DEFAULT_EXECUTION_QUEUE_NAME = 'tower'
    DEFAULT_CONTROL_PLANE_QUEUE_NAME = 'tower'

    これらの行とともに。

    DEFAULT_EXECUTION_QUEUE_NAME = 'execution'
    DEFAULT_CONTROL_PLANE_QUEUE_NAME = 'controlplane'
  19. Oracle Linux Automation Managerを再起動します。
    sudo systemctl restart  ol-automation-manager.service
  20. アップグレードした元のノードが制御ノードに変換されます。 アップグレードしたクラスタが完全に機能するには、実行ノードをもう1つ追加する必要があります。 クラスタの他のすべてのメンバーについては、「データベースおよびホストの準備」で説明されている手順に従いますが、リモート・データベースの設定は完了しているためです。 次に、「クラスタ化されたデプロイメントへのOracle Linux Automation Managerのインストール」の説明に従って、他のすべてのホストをクラスタの一部としてインストールおよび構成する手順に従います。

プレイブックのOracle Linux Automation Engineリリース2.0への移行

Oracle Linux Automation Engineリリース1.0.xプレイブックをテストし、Oracle Linux Automation Managerリリース2.0で適切に機能するかどうかを確認します。 アップストリーム・プロジェクトでモジュール数、一部のモジュールがコレクションになり、一部のモジュールが他のモジュールまたはコレクションに統合されているため、プレイブックを更新する必要がある場合があります。