InfoGrab Docs

Ansible

Teleport와 Ansible 함께 사용하기

Ansible은 기본적으로 OpenSSH 클라이언트를 사용합니다. Teleport는 SSH 프로토콜을 지원하며 SSH 점프호스트로 동작합니다. 이 가이드에서는 Teleport Proxy와 함께 작동하도록 OpenSSH 클라이언트를 구성하고 샘플 ansible 플레이북을 실행하는 방법을 안내합니다. 작동 방식 # 이 가이드에서 설명하는 설정에서는, Teleport가 발급한 SSH 인증서를 사용하여 Teleport로 보호된 서버에 연결하는 OpenSSH 구성을 생성합니다. 그런 다음 이 OpenSSH 구성과 Teleport로 보호된 서버의 인벤토리를 Ansible 호스트에 제공합니다. Ansible은 OpenSSH 구성을 사용하여 서버를 관리하기 위해 Teleport가 발급한 자격 증명을 제시합니다. 사전 요구 사항 # A running Teleport cluster. If you want to get started with Teleport, sign up for a free trial or set up a demo environment . The tctl and tsh clients. Installing `tctl` and `tsh` clients Determine the version of your Teleport cluster. The tctl and tsh clients must be at most one major version behind your Teleport cluster version. Send a GET request to the Proxy Service at /v1/webapi/find and use a JSON query tool to obtain your cluster version. Replace with the web address of your Teleport Proxy Service: $ TELEPORT_DOMAIN= $ TELEPORT_VERSION="$(curl -s https://$TELEPORT_DOMAIN/v1/webapi/find | jq -r '.server_version')" Follow the instructions for your platform to install tctl and tsh clients: ssh openssh 도구 ansible >= [ansible.min_version] JSON 출력을 처리하기 위한 선택적 도구 jq 1단계/3단계. 로그인 및 SSH 구성 # tsh 로 Teleport에 로그인합니다: $ tsh login --proxy= tsh config 단축키를 사용하여 openssh 구성을 생성합니다: $ tsh config > ssh.cfg Tip 기본 설정으로 작동하지 않는 경우 ssh.cfg 에서 사용되는 매칭 패턴을 수정할 수 있습니다. 2단계/3단계. Ansible 구성 # 생성된 모든 파일을 모을 ansible 폴더를 만듭니다: $ mkdir -p ansible # 이전 단계에서 생성한 openssh 구성을 ansible 디렉토리로 복사합니다 $ cp ss