부트스트랩 스크립트로 클라이언트 등록

1. 소개

부트스트랩 스크립트로 클라이언트를 등록하면 파라미터를 제어할 수 있고, 다수의 클라이언트를 한 번에 등록해야 하는 경우 도움이 됩니다.

부트스트랩 스크립트를 사용하여 클라이언트를 등록하려면 먼저 템플릿 부트스트랩 스크립트를 생성한 다음 복사하고 수정하는 것이 좋습니다. 생성한 부트스트랩 스크립트는 클라이언트가 등록될 때 클라이언트에서 실행되며, 필요한 모든 패키지가 클라이언트에 배포되도록 합니다. 부트스트랩 스크립트의 일부 파라미터는 활성화 키와 GPG 키를 사용하여 클라이언트 시스템을 기본 채널에 할당할 수 있도록 합니다.

리포지토리 정보를 주의 깊게 확인하여 기본 채널 리포지토리와 일치하게 하는 것이 중요합니다. 리포지토리 정보가 정확히 일치하지 않으면 부트스트랩 스크립트가 패키지를 정확히 다운로드할 수 없습니다.

추가 고려 사항:

  • 모든 클라이언트에는 부트스트랩 리포지토리가 필요합니다. 부트스트랩 리포지토리는 제품이 동기화될 때 SUSE Multi-Linux Manager 서버에 자동으로 생성 및 재생성됩니다. 부트스트랩 리포지토리에는 클라이언트에 Salt를 설치하고 클라이언트를 등록하기 위한 패키지가 포함됩니다. 부트스트랩 리포지토리 만들기에 대한 자세한 내용은 부트스트랩 리포지토리에서 확인할 수 있습니다.

  • openSUSE Leap 15 및 SLES 15는 기본적으로 Python 3를 사용합니다. Python 2에 기반을 둔 부트스트랩 스크립트는 openSUSE Leap 15 및 SLE 15 시스템에 대해 다시 생성해야 합니다. Python 2를 사용해 openSUSE Leap 15 또는 SLE 15 시스템을 등록하는 경우 부트스트랩 스크립트는 실패합니다.

SUSE Multi-Linux Manager의 이전 버전에서 최신 버전으로 마이그레이션한 후에는 잠재적인 문제를 방지하기 위해 새 시스템을 온보딩하기 전에 부트스트랩 스크립트를 다시 생성하는 것이 적극 권장됩니다.

To access a shell inside the server container run mgrctl term on the container host. From there, one can run the CLI tools as usual.

2. Create a bootstrap script with mgr-bootstrap

The mgr-bootstrap command generates custom bootstrap scripts. A bootstrap script is used by SUSE Multi-Linux Manager client systems for simplifying their initial registration and configuration.

The arguments --activation-keys and --script, are the only mandatory arguments. On the SUSE Multi-Linux Manager Server, as root at the command line execute it with the mandatory arguments. Replace <ACTIVATION_KEY and <EDITED_NAME> with your values:

  1. SUSE Multi-Linux Manager 컨테이너 호스트의 명령 프롬프트에서 루트 사용자로 다음 명령어를 실행하여 서버 컨테이너에 진입합니다.

    mgrctl term
  2. 다음 명령을 실행합니다(필요에 따라 값 조정).

    mgr-bootstrap --activation-keys=<ACTIVATION_KEY> --script=bootstrap-<EDITED_NAME>.sh

The mgr-bootstrap command offers several other options, including the ability to set a specific hostname, set specific GPG keys, and set the registration method (salt-minion or salt-bundle).

  • 프록시에 등록하기 위한 부트스트랩 스크립트를 생성하려면 서버 컨테이너에서 다음 명령을 사용합니다.

    mgr-boostrap --hostname <PROXY_FQDN>

    This command will create a new bootstrap script with default name bootstrap.sh and it will overwrite the existing bootstrap.sh file which is used for the Server.

  • 다른 스크립트를 지정하려면 다음 명령을 실행합니다.

    mgr-bootstrap --hostname <PROXY_FQDN> --script=boostrap-<PROXY-SCRIPT>.sh

For more information, see the mgr-bootstrap man page, or run mgr-bootstrap --help.

3. Web UI에서 부트스트랩 스크립트 생성

SUSE Multi-Linux Manager Web UI를 사용하면 편집 가능한 부트스트랩 스크립트를 생성할 수 있습니다.

절차: 부트스트랩 스크립트 생성
  1. SUSE Multi-Linux Manager Web UI에서 관리  관리자 구성  부트스트랩 스크립트로 이동합니다.

  2. 필수 필드는 이전의 설치 단계에서 얻은 값으로 미리 채워져 있습니다. 각 설정에 대한 자세한 내용은 부트스트랩 스크립트에서 확인할 수 있습니다.

  3. 업데이트를 클릭하여 스크립트를 생성합니다.

  4. The bootstrap script is generated and stored on the server in the /srv/www/htdocs/pub/bootstrap directory. Alternatively, you can access the bootstrap script over HTTPS. Replace <example.com> with the host name of your SUSE Multi-Linux Manager Server:

    https://<example.com>/pub/bootstrap/bootstrap.sh

Do not disable SSL in your bootstrap script. Ensure that Enable SSL is checked in the Web UI, or that the setting USING_SSL=1 exists in the bootstrap script. If you disable SSL, the registration process requires custom SSL certificates.

사용자 정의 채널에 대한 자세한 내용은 SSL 인증서에서 확인할 수 있습니다.

4. 부트스트랩 스크립트 편집

생성한 템플릿 부트스트랩 스크립트를 복사 및 수정하여 사용자 정의할 수 있습니다. SUSE Multi-Linux Manager에서 사용할 부트스트랩 스크립트를 수정할 때 충족해야 할 최소 요구사항은 활성화 키를 포함해야 한다는 것입니다. 대부분의 패키지는 GPG로 서명되므로 패키지를 설치할 시스템에 신뢰할 수 있는 GPG 키도 있어야 합니다.

In this procedure, you need to know the exact name of your activation keys. Navigate to Home  Overview and, in the Tasks box, click Manage Activation Keys. All keys created for channels are listed on this page. You must enter the full name of the key you wish to use in the bootstrap script exactly as presented in the key field. For more information about activation keys, see 활성화 키.

절차: 부트스트랩 스크립트 수정
  1. SUSE Multi-Linux Manager 컨테이너 호스트의 명령 프롬프트에서 루트 사용자로 다음 명령어를 실행하여 서버 컨테이너에 진입합니다.

    mgrctl term
  2. SUSE Multi-Linux Manager 서버에서 명령줄의 루트 권한으로 다음과 같이 부트스트랩 디렉토리로 변경합니다.

    cd /srv/www/htdocs/pub/bootstrap/
  3. 각 클라이언트에서 사용할 템플릿 부트스트랩 스크립트 사본 2개를 생성하여 이름을 변경합니다.

    cp bootstrap.sh bootstrap-sles12.sh
    cp bootstrap.sh bootstrap-sles15.sh
  4. Open bootstrap-sles15.sh for modification. Scroll down until you can see the text shown below. If exit 1 exists in the file, comment it out by typing a hash or pound sign (#) at the beginning of the line. This activates the script. Enter the name of the key for this script in the ACTIVATION_KEYS= field:

    echo "Enable this script: comment (with #'s) this block (or, at least just"
    echo "the exit below)"
    echo
    #exit 1
    
    # 수정할 수 있으나 아마 정확할 것입니다(초기 설치 중에 생성하지 않은 경우):
    # 참고: ACTIVATION_KEYS는 클라이언트 시스템을 부트스트래핑하는 데 *반드시* 사용해야 합니다.
    ACTIVATION_KEYS=1-sles15
    ORG_GPG_KEY=

    스크립트를 수작업으로 편집하는 대신, 사용자는 실행 시점에 다음 환경 변수를 전달할 수 있습니다.

    • ACTIVATION_KEYS: 등록에 사용할 활성화 키

    • ORG_GPG_KEY: GPG 키의 경로 또는 식별자

    • REACTIVATION_KEY: 이전에 등록된 시스템의 재활성화 키

    • MGR_SERVER_HOSTNAME: 클라이언트를 등록할 서버 또는 프록시의 호스트 이름

    환경 변수를 사용하면 런타임에 동적 입력을 허용하고 여러 시스템이나 환경에서 동일한 부트스트랩 스크립트를 쉽게 재사용할 수 있습니다.

  5. 완료한 후 파일을 저장하고 두 번째 부트스트랩 스크립트에 대해 이 절차를 반복하십시오.

By default, bootstrap script will try to install venv-salt-minion if it is available in the bootstrap repository and salt-minion if there is no Salt bundle in the bootstrap repository. It is possible to avoid installing Salt bundle and keep using salt-minion if you need it for some reason.

자세한 내용은 Salt Bundle에서 확인할 수 있습니다.

5. 부트스트랩 스크립트를 실행하는 클라이언트 등록

스크립트 생성을 완료했으면 이 스크립트를 사용해 클라이언트를 등록할 수 있습니다.

절차: 부트스트랩 스크립트 실행
  1. SUSE Multi-Linux Manager 컨테이너 호스트의 명령 프롬프트에서 루트 사용자로 다음 명령어를 실행하여 서버 컨테이너에 진입합니다.

    mgrctl term
  2. SUSE Multi-Linux Manager 서버에서 부트스트랩 디렉토리로 변경합니다.

    cd /srv/www/htdocs/pub/bootstrap/
  3. Run this command to execute the bootstrap script on the client; replace EXAMPLE.COM with the host name of your client:

    cat bootstrap-sles15.sh | ssh root@EXAMPLE.COM /bin/bash
  4. 또는 클라이언트에서 다음 명령을 실행합니다.

    ACTIVATION_KEYS="17-someactivationkey" \
    MGR_SERVER_HOSTNAME="proxy.example.com" \
    ORG_GPG_KEY="mykey" \
    REACTIVATION_KEY=my-reactivation-key \
    curl -Sks https://server_hostname/pub/bootstrap/bootstrap.sh | /bin/bash

    값을 재정의할 필요가 없는 경우 다음과 같이 환경 변수를 완전히 생략할 수 있습니다.

    curl -Sks https://server_hostname/pub/bootstrap/bootstrap.sh | /bin/bash

    To avoid problems, make sure the bootstrap script is executed using bash.

    이 스크립트는 앞서 생성한 리포지토리 디렉토리에 있는 필수 종속성을 다운로드합니다.

  5. 스크립트 실행이 완료되면 클라이언트가 올바르게 등록되었는지 확인할 수 있습니다. productname} Web UI를 열고 시스템  개요로 이동하여 새 클라이언트가 나열되었는지 확인합니다. 클라이언트가 나열되지 않으면 SUSE Multi-Linux Manager Web UI에서 Salt  로 이동하여 클라이언트 키가 허용되는지 확인합니다.

SUSE Multi-Linux Manager를 사용해 클라이언트에 새 패키지 또는 업데이트를 설치하면 최종 사용자 라이선스 계약(EULA)이 자동으로 수락됩니다. 패키지 EULA를 검토하려면 Web UI에서 패키지 상세 정보 페이지를 여십시오.