본문 바로가기

728x90

Ansible

[iac][ansible] 동적 인벤토리(aws_es2 plugin) 앤서블 동적 인벤토리(aws_es2 plugin) aws ec2 동적 인벤토리 플러그인 설치 Requirements - pthon >= 3.6 - boto3 >= 1.16.0 - botocore >= 1.19.0 sudo apt install -y python3-boto3 ansible-galaxy 명령으로 플러그인 설치 ansible-galaxy collection install amazon.aws $ ansible-galaxy collection list | grep amazon.aws amazon.aws 2.3.0 amazon.aws 4.1.0 ansible.cfg 생성 vim ansible.cfg [defaults] inventory = my_aws_ec2.yaml aws_ec2 모듈 문서 확인 .. 더보기
[iac][ansible] ansible-config 명령 ansible-config 명령 ansible-config -h $ ansible-config -h usage: ansible-config [-h] [--version] [-v] {list,dump,view,init} ... View ansible configuration. positional arguments: {list,dump,view,init} list Print all config options dump Dump configuration view View configuration file init Create initial configuration optional arguments: --version show program's version number, config file location, .. 더보기
[iac][ansible] ansible-doc 명령 ansible-doc 명령 ansible-doc -h $ ansible-doc -h usage: ansible-doc [-h] [--version] [-v] [-M MODULE_PATH] [--playbook-dir BASEDIR] [-t {become,cache,callback,cliconf,connection,httpapi,inventory,lookup,netconf,shell,vars,module,strategy,role,keyword}] [-j] [-r ROLES_PATH] [-e ENTRY_POINT | -s | -F | -l | --metadata-dump] [plugin [plugin ...]] plugin documentation tool positional arguments: plugin.. 더보기
[iac][ansible] 앤서블 인벤토리 앤서블 인벤토리 앤서블 버전 정보 ansible --version $ ansible --version ansible [core 2.12.8] config file = /etc/ansible/ansible.cfg configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible ansible collection location = /home/vagrant/.ansible/collections:/usr/share/ansible/collections.. 더보기
[iac][ansible] 앤서블 아키텍처 앤서블 아키텍처 - 인벤토리 - 모듈 - API - 플러그인 더보기
[iac][ansible] ansible-vault 명령 ansible-vault 명령 ansible-vault create a.yaml ansible-vault view a.yaml $ ansible-vault view a.yaml Vault password: --- - hosts: node1 tasks: - ping: ansible-vault edit a.yaml $ ansible-vault edit a.yaml Vault password: --- - hosts: node1 tasks: - ping: ansible-playbook a.yaml -i ../inventory.ini --ask-vault-pass $ ansible-playbook a.yaml -i ../inventory.ini --ask-vault-pass Vault password: PLAY .. 더보기
ansible-galaxy 명령어 ansible-galaxy 명령어 ansible-galaxy 명령어는 Ansible Galaxy와 관련된 작업을 수행하는 데 사용됩니다. 주요 기능으로는 역할(Role)의 설치, 제거, 초기화, 업데이트 등이 있습니다. ansible-galaxy : https://galaxy.ansible.com/ Ansible Galaxy 설치 sudo apt-get install ansible-galaxy 1. 역할 설치하기 Ansible Galaxy에서 지정한 username과 role_name에 해당하는 역할을 설치합니다. ansible-galaxy install username.role_name 2. 역할 제거하기 지정된 역할을 제거합니다. ansible-galaxy remove username.role_nam.. 더보기
Ansible 설치 및 업그레이드 Ansible 설치 및 업그레이드 테스트 환경 운영체제 버전 정보 $ cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) Ansible 설치 python 버전 $ python --version Python 2.7.5 앤서블 설치 yum install -y ansible ansible-python3 앤서블 버전 ansible --version $ ansible --version ansible 2.9.27 config file = /etc/ansible/ansible.cfg configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/mod.. 더보기

728x90