7.6. Playbook 사용
일부 플레이북은 이 문서에 설명되어 있지만 일부 플레이북은 설명되지 않습니다. 여기에서는 클라우드의 Ansible 배포에서 정보를 검색하거나 설명이 있는지 확인하는 데 사용되는 정보입니다. 이러한 플레이북은 배포를 수정하지 않습니다.
aws_add_labels
이 플레이북은 배포에 레이블을 추가합니다.
$ docker run --rm $IMAGE command_generator_vars aws_add_labels
다음 출력을 생성하는 방법은 다음과 같습니다.
=============================================== Playbook: aws_add_labels Description: This playbook adds labels to the deployment. ----------------------------------------------- Add labels to the Ansible Automation Platform from AWS Marketplace deployment. ----------------------------------------------- Command generator template: docker run --rm $IMAGE command_generator aws_add_labels -d <deployment_name> -c <cloud_credentials_path> --extra-vars 'aws_region=<aws_region> aws_labels=<aws_labels>' ===============================================
aws_labels 매개변수는 추가하거나 업데이트할 키=값 쌍으로 이루어진 쉼표로 구분된 목록입니다. 예: key1=value1,key2=value2
매개변수를 교체하여 이 명령을 시작하면 시작 및 출력할 새 명령이 생성됩니다.
... PLAY RECAP ********************************************************************* localhost : ok=22 changed=2 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
aws_check_aoc_version
이 플레이북은 Cloud 버전의 Ansible이 명령 생성기 컨테이너와 같은지 확인합니다. 이 검사는 플레이북이 호출될 때마다 수행됩니다.
$ docker run --rm $IMAGE command_generator_vars aws_check_aoc_version
다음 출력을 생성하는 방법은 다음과 같습니다.
=============================================== Playbook: aws_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 aws_check_aoc_version [--ansible-config ansible_config_path>] -d <deployment_name> -c <cloud_credentials_path> --extra-vars 'aws_region=<aws_region> aws_ssm_bucket_name=<aws_ssm_bucket_name>' ===============================================
매개변수를 교체하여 이 명령을 시작하면 시작 및 출력할 새 명령이 생성됩니다.
...
TASK [redhat.ansible_on_clouds.standalone_check_aoc_version : Verify operational playbook and Ansible on Clouds deployment versions] ***
fatal: [localhost]: FAILED! => {
"assertion": "ops_version == aoc_version",
"changed": false,
"evaluated_to": false,
"msg": "This operation playbook version 2.4.20230606-00 is not valid for the Ansible on Clouds deployment version 2.4.20230531-00"
}
PLAY RECAP *********************************************************************
localhost : ok=7 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
실패한 0은 Clouds 배포 버전의 Ansible이 command_generator 컨테이너와 일치하지 않으며 명령 생성기가 해당 배포를 관리하는 데 다른 버전이 필요함을 나타냅니다.
aws_get_aoc_version
이 플레이북은 Clouds 배포에서 Ansible 버전을 검색합니다.
$ docker run --rm $IMAGE command_generator_vars aws_get_aoc_version
다음 출력을 생성하는 방법은 다음과 같습니다.
=============================================== Playbook: aws_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 aws_get_aoc_version [--ansible-config ansible_config_path>] -d <deployment_name> -c <cloud_credentials_path> --extra-vars 'aws_region=<aws_region> aws_ssm_bucket_name=<aws_ssm_bucket_name>' ===============================================
매개변수를 교체하여 이 명령을 시작하면 시작 및 출력할 새 명령이 생성됩니다.
...
TASK [Print version] ***********************************************************
ok: [localhost] => {
"msg": "The AOC version is 2.4.20230531-00"
}
PLAY RECAP *********************************************************************
localhost : ok=5 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0aws_remove_labels
이 플레이북은 배포에서 레이블을 제거합니다.
$ docker run --rm $IMAGE command_generator_vars aws_remove_labels
다음 출력을 생성하는 방법은 다음과 같습니다.
=============================================== Playbook: aws_remove_labels Description: This playbook removes labels from the deployment. ----------------------------------------------- Remove labels from the Ansible Automation Platform from AWS Marketplace deployment. ----------------------------------------------- Command generator template: docker run --rm $IMAGE command_generator aws_remove_labels -d <deployment_name> -c <cloud_credentials_path> --extra-vars 'aws_region=<aws_region> aws_labels=<aws_labels>' ===============================================
aws_labels 매개변수는 제거할 단일 키입니다. 예를 들면 key1 입니다. 여러 키를 제거하려면 명령을 여러 번 실행합니다.
매개변수를 교체하여 이 명령을 시작하면 시작 및 출력할 새 명령이 생성됩니다.
... PLAY RECAP ********************************************************************* localhost : ok=22 changed=2 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0