7.6. Playbook 사용
일부 플레이북은 이 문서에 설명되어 있지만 일부 플레이북은 설명되지 않습니다. 여기에서는 클라우드의 Ansible 배포에서 정보를 검색하거나 설명이 있는지 확인하는 데 사용되는 정보입니다. 이러한 플레이북은 배포를 수정하지 않습니다.
gcp_aap_health_check
이 플레이북은 Ansible 애플리케이션이 정상인지 확인합니다.
$ docker run --rm $IMAGE command_generator_vars gcp_aap_health_check
다음 출력을 생성하는 방법은 다음과 같습니다.
=============================================== Playbook: gcp_aap_health_check Description: This playbook checks if the deployment is healthy using the Ansible health service. ----------------------------------------------- The health check consists of checking the Ansible Automation Platform from GCP Marketplace environemnt to verify it is healthy. ----------------------------------------------- Command generator template: docker run --rm $IMAGE command_generator gcp_aap_health_check [--ansible-config ansible_config_path>] -d <deployment_name> -c <cloud_credentials_path> --extra-vars 'gcp_compute_region=<gcp_compute_region> gcp_compute_zone=<gcp_compute_zone>' ===============================================
매개변수를 교체하여 이 명령을 시작하면 시작 및 출력할 새 명령이 생성됩니다.
... PLAY RECAP ********************************************************************* localhost : ok=29 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
0 과 같지 않으면 Ansible이 클라우드 배포에서 문제가 있음을 나타냅니다.
gcp_add_labels
이 플레이북은 배포에 레이블을 추가합니다.
$ docker run --rm $IMAGE command_generator_vars gcp_add_labels
다음 출력을 생성하는 방법은 다음과 같습니다.
=============================================== Playbook: gcp_add_labels Description: This playbook adds labels to the deployment. ----------------------------------------------- Add labels to the Ansible Automation Platform from GCP Marketplace deployment. ----------------------------------------------- Command generator template: docker run --rm $IMAGE command_generator gcp_add_labels -d <deployment_name> -c <cloud_credentials_path> --extra-vars 'gcp_compute_region=<gcp_compute_region> gcp_compute_zone=<gcp_compute_zone> gcp_labels=<gcp_labels>' ===============================================
gcp_labels 매개변수는 추가하거나 업데이트할 키=값 쌍으로 이루어진 쉼표로 구분된 목록입니다. 예: key1=value1,key2=value2
매개변수를 교체하여 이 명령을 시작하면 시작 및 출력할 새 명령이 생성됩니다.
... PLAY RECAP ********************************************************************* localhost : ok=22 changed=2 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
gcp_remove_labels
이 플레이북은 배포에서 레이블을 제거합니다.
$ docker run --rm $IMAGE command_generator_vars gcp_remove_labels
다음 출력을 생성하는 방법은 다음과 같습니다.
=============================================== Playbook: gcp_remove_labels Description: This playbook removes labels from the deployment. ----------------------------------------------- Remove labels from the Ansible Automation Platform from GCP Marketplace deployment. ----------------------------------------------- Command generator template: docker run --rm $IMAGE command_generator gcp_remove_labels -d <deployment_name> -c <cloud_credentials_path> --extra-vars 'gcp_compute_region=<gcp_compute_region> gcp_compute_zone=<gcp_compute_zone> gcp_labels=<gcp_labels>' ===============================================
gcp_labels 매개변수는 제거할 쉼표로 구분된 키 목록입니다. 예: key1,key2
매개변수를 교체하여 이 명령을 시작하면 시작 및 출력할 새 명령이 생성됩니다.
... PLAY RECAP ********************************************************************* localhost : ok=22 changed=2 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
gcp_check_aoc_version
이 플레이북은 Cloud 버전의 Ansible이 명령 생성기 컨테이너와 같은지 확인합니다. 이 검사는 플레이북이 호출될 때마다 수행됩니다.
$ docker run --rm $IMAGE command_generator_vars gcp_check_aoc_version
다음 출력을 생성하는 방법은 다음과 같습니다.
=============================================== Playbook: gcp_check_aoc_version Description: Check the operational container version matches the Ansible on Clouds version. ----------------------------------------------- Check the operational container version matches the Ansible on Clouds version. ----------------------------------------------- Command generator template: docker run --rm $IMAGE command_generator gcp_check_aoc_version [--ansible-config ansible_config_path>] -c <cloud_credentials_path> -d <deployment_name> ===============================================
매개변수를 교체하여 이 명령을 시작하면 시작 및 출력할 새 명령이 생성됩니다.
...
TASK [redhat.ansible_on_clouds.standalone_check_aoc_version : Verify operational playbook and Ansible on Clouds deployment versions] ***
ok: [localhost] => {
"changed": false,
"msg": "This operation playbook version and the Ansible on Clouds deployment version are identical: 2.4.20230606-00"
}
PLAY RECAP *********************************************************************
localhost : ok=8 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
실패한 0은 Clouds 배포 버전의 Ansible이 command_generator 컨테이너와 일치하지 않으며 명령 생성기가 해당 배포를 관리하는 데 다른 버전이 필요함을 의미합니다.
gcp_get_aoc_version
이 플레이북은 Clouds 배포에서 Ansible 버전을 검색합니다.
$ docker run --rm $IMAGE command_generator_vars gcp_get_aoc_version
다음 출력을 생성하는 방법은 다음과 같습니다.
=============================================== Playbook: gcp_get_aoc_version Description: Get the current Ansible on Clouds version. ----------------------------------------------- Get the current Ansible on Clouds version. ----------------------------------------------- Command generator template: docker run --rm $IMAGE command_generator gcp_get_aoc_version [--ansible-config ansible_config_path>] -c <cloud_credentials_path> -d <deployment_name> ===============================================
매개변수를 교체하여 이 명령을 시작하면 시작 및 출력할 새 명령이 생성됩니다.
...
TASK [Print version] ***********************************************************
ok: [localhost] => {
"msg": "The AOC version is 2.4.20230606-00"
}
PLAY RECAP *********************************************************************
localhost : ok=5 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0gcp_health_check
이 플레이북은 노드와 Ansible 애플리케이션이 정상인지 확인합니다.
$ docker run --rm $IMAGE command_generator_vars gcp_health_check
다음 출력을 생성하는 방법은 다음과 같습니다.
=============================================== Playbook: gcp_health_check Description: This playbook checks if the Ansible Automation Platform from GCP Marketplace deployment is healthy. ----------------------------------------------- The health check consists of checking the Ansible Automation Platform from GCP Marketplace heatlh checks and the health of the monitoring exporter. ----------------------------------------------- Command generator template: docker run --rm $IMAGE command_generator gcp_health_check [--ansible-config ansible_config_path>] -c <cloud_credentials_path> -d <deployment_name> --extra-vars 'gcp_compute_region=<gcp_compute_region> gcp_compute_zone=<gcp_compute_zone>' ===============================================
매개변수를 교체하여 이 명령을 시작하면 시작할 새 명령이 생성되고 출력됩니다.
... PLAY RECAP ********************************************************************* localhost : ok=47 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
0 과 같지 않으면 클라우드 배포에서 노드 또는 Ansible에 문제가 있음을 나타냅니다.
gcp_list_deployments
이 Playbook은 배포, 지역 및 영역은 선택 사항입니다.
$ docker run --rm $IMAGE command_generator_vars gcp_list_deployments
다음 출력을 생성하는 방법은 다음과 같습니다.
=============================================== Playbook: gcp_list_deployments Description: This playbook generates a list of available Ansible Automation Platform from GCP Marketplace deployments. ----------------------------------------------- This playbook is used to generate a list of available Ansible Automation Platform from GCP Marketplace deployments. ----------------------------------------------- Command generator template: docker run --rm $IMAGE command_generator gcp_list_deployments -c <cloud_credentials_path> --extra-vars '[gcp_compute_region=<gcp_compute_region>] [gcp_compute_zone=<gcp_compute_zone>]' ===============================================
매개변수를 교체하여 이 명령을 시작하면 시작 및 출력할 새 명령이 생성됩니다.
...
TASK [Show deployment list] ****************************************************
ok: [localhost] => {
"msg": [
"Deployment list: ['dep1', 'dep2', 'dep3']"
]
}
PLAY RECAP *********************************************************************
localhost : ok=7 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0gcp_nodes_health_check
이 플레이북은 노드가 정상인지 확인합니다.
$ docker run --rm $IMAGE command_generator_vars gcp_nodes_health_check
다음 출력을 생성하는 방법은 다음과 같습니다.
=============================================== Playbook: gcp_nodes_health_check Description: This role runs a health check on a group of nodes in the Ansible Automation Platform from GCP Marketplace deployment ----------------------------------------------- The playbook checks if the Ansible Automation Platform from GCP Marketplace monitoring exporter is up and running. ----------------------------------------------- Command generator template: docker run --rm $IMAGE command_generator gcp_nodes_health_check [--ansible-config ansible_config_path>] -d <deployment_name> -c <cloud_credentials_path> --extra-vars 'check_monitoring=True' ===============================================
매개변수를 교체하여 이 명령을 시작하면 시작 및 출력할 새 명령이 생성됩니다.
... PLAY RECAP ********************************************************************* localhost : ok=47 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
0 과 일치하지 않으면 배포 중 노드에서 문제가 있음을 나타냅니다.