본문 바로가기

728x90

리눅스

[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.. 더보기
SSH 키를 생성하고 배포하여 원격 서버에 SSH 접속하는 방법 SSH 키를 생성하고 배포하여 원격 서버에 SSH 접속하는 방법 1. SSH 키 생성 [server 작업] 로컬 컴퓨터에서 SSH 키 쌍을 생성해야 합니다. 이를 위해 ssh-keygen 명령을 사용합니다. 터미널에서 다음 명령을 실행하여 SSH 키 쌍을 생성합니다 ssh-keygen -t rsa -b 4096 -C "your_email@example.com" 위 명령을 실행하면 키 쌍 생성을 위해 몇 가지 옵션을 설정하라는 메시지가 표시됩니다. 엔터를 눌러 기본값을 사용하거나 필요한 옵션을 설정합니다. ssh-keygen 사용법 더보기 usage: ssh-keygen [-q] [-b bits] [-t dsa | ecdsa | ed25519 | rsa | rsa1] [-N new_passphrase] [.. 더보기
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.. 더보기
CentOS 7에서 python3 업그레이드 CentOS 7에서 python3 업그레이드 테스트 환경 운영체제 버전 $ cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) python 버전 $ python --version Python 2.7.5 $ python3 --version Python 3.6.8 SCL 유틸리티 설치 yum install -y centos-release-scl python 업그레이드 python3.8 설치 yum install -y rh-python38 rh-python38-python-pip python 버전 $ /opt/rh/rh-python38/root/usr/bin/python --version Python 3.8.11 alternatives 확인 altern.. 더보기
[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_che.. 더보기
Ubuntu Server 22.04 LTS (Jammy Jellyfish) Ubuntu Server 22.04 LTS (Jammy Jellyfish) LTS Releases old releases - old-releases.ubuntu.com Ubuntu 22.04.1 LTS (Jammy Jellyfish) Ubuntu 20.04.4 LTS (Focal Fossa) Ubuntu 18.04.6 LTS (Bionic Beaver) Ubuntu Server 22.04 LTS (Jammy Jellyfish) Ubuntu Server 22.04 LTS (Jammy Jellyfish) Daily Build https://cdimage.ubuntu.com/ubuntu-server/daily-live/current/ Ubuntu 22.04 LTS (Jammy Jellyfish) Beta ht.. 더보기

728x90