Ansible 썸네일형 리스트형 [Ansible] macOS에 ansible 설치 macOS에 ansible 설치 테스트 환경 system_profiler SPSoftwareDataType | egrep 'System Version' $ system_profiler SPSoftwareDataType | egrep 'System Version' System Version: macOS 12.5 (21G72) ansible 설치(brew install) ansible search brew search ansible $ brew search ansible ==> Formulae ansible ansible-cmdb ansible-language-server ansible-lint ansible@2.8 ansible@2.9 ==> Casks ansible-dk ansible informatio.. 더보기 ansible inventory(인벤토리) 설정 Ansible inventory 설정 Ansible은 인벤토리로 알려진 목록 또는 목록 그룹을 사용하여 인프라의 여러 관리 노드 또는 "호스트"에 대해 동시에 작동합니다. 인벤토리가 정의되면 패턴을 사용하여 Ansible을 실행할 호스트 또는 그룹을 선택합니다.(대상 서버 리스트) 구성 설정(Configuration settings) ANSIBLE_CONFIG (환경 변수에 지정한 경우) ansible.cfg (현재 디렉토리) ~/.ansible.cfg (홈 디렉토리) /etc/ansible/ansible.cfg (기본) vim ~/.ansible.cfg cat ~/.ansible.cfg [defaults] inventory = ~/inventory/hosts.ini host_key_checking = .. 더보기 [Ansible] shell, command, yum, user 모듈 Ansible shell, command, yum, user 모듈 Ansible에서 모듈 사용법 shell 모듈 $ ansible db1 -m shell -a "free -h" db1 | CHANGED | rc=0 >> total used free shared buff/cache available Mem: 3.8G 162M 2.7G 540K 997M 3.4G Swap: 0B 0B 0B command 모듈 $ ansible db1 -m command -a "cat /etc/passwd" db1 | CHANGED | rc=0 >> root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin ... ec2-user:x:1000:1000:EC2 Defaul.. 더보기 [Ansible] Amazon Linux에 Ansible 설치하기 Amazon Linux에 Ansible 설치하기 설치 환경 $ cat /etc/os-release NAME="Amazon Linux" VERSION="2" ID="amzn" ID_LIKE="centos rhel fedora" VERSION_ID="2" PRETTY_NAME="Amazon Linux 2" ANSI_COLOR="0;33" CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2" HOME_URL="https://amazonlinux.com/" Ansible 설치하기 $ amazon-linux-extras install ansible2 Installing: ansible Installing for dependencies: libtomcrypt libtommath python-.. 더보기 [Ansible] Amazon Linux에 Ansible AWX를 설치하는 방법 Amazon Linux에 Ansible AWX를 설치하는 방법 AWX 설치 스크립트(테스트 중) cat 더보기 [Ansible] ansible 인벤토리 설정 파일 ansible 인벤토리 설정 파일 인벤토리 설정 기본적으로 /etc/ansible/hosts 파일 사용한다 > vim /etc/ansible/hosts [aweb21] asweb21 ansible_host=10.21.3.54 ansible_connection=ssh ansible_por=22 ansible_user=ec2-user ansible_ssh_private_key_file=~/aws-key/keyfile.pem asweb22 ansible_host=10.21.4.199 ansible_connection=ssh ansible_por=22 ansible_user=ec2-user ansible_ssh_private_key_file=~/aws-key/keyfile.pem 인벤토리에 등록된 호스트로 핑 .. 더보기 [Ansible] ansible 인벤토리 설정 파일 ansible 인벤토리 설정 파일 인벤토리 설정 기본적으로 /etc/ansible/hosts 파일 사용한다 > vim /etc/ansible/hosts [aweb21] asweb21 ansible_host=10.21.3.54 ansible_connection=ssh ansible_por=22 ansible_user=ec2-user ansible_ssh_private_key_file=~/aws-key/keyfile.pem asweb22 ansible_host=10.21.4.199 ansible_connection=ssh ansible_por=22 ansible_user=ec2-user ansible_ssh_private_key_file=~/aws-key/keyfile.pem 인벤토리에 등록된 호스트로 핑 .. 더보기 [Ansible] MacOS에 Ansible을 설치하기 MacOS에 Ansible을 설치하기 pip로 Ansible 설치 > pip3 install ansible > ansible --version ansible 2.10.9 config file = None configured module search path = ['/Users/sangchul/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.9/site-packages/ansible executable location = /usr/local/bin/ansible python version = 3.9.1 (default, Jan 8 2021,.. 더보기 이전 1 2 3 4 5 다음