본문 바로가기

ansible20

Ansible Module - File https://docs.ansible.com/ansible/latest/collections/ansible/builtin/file_module.html#file-module ansible.builtin.file module – Manage files and file properties — Ansible Documentation The permissions the resulting filesystem object should have. For those used to /usr/bin/chmod remember that modes are actually octal numbers. You must give Ansible enough information to parse them correctly. For co.. 2023. 6. 27.
Ansible Playbooks Inventory 에서 정의된 호스트에서 무엇을 해야할지를 정의한 것. 자동화 절차를 기술한 코드 파일 코드 Set을 의미함. YAML 형식으로 기록 playbook의 목표는 호스트의 그룹을 정의된 Ansible내에서 테스크로 불리는 역할(Role)에 매핑해주는 것 - name: 'Execute two commands on localhost' hosts: web_node1 tasks: - name: 'Execute a date command' command: date - name: 'Execute a command to display hosts file' command: 'cat /etc/hosts' Play name 1개 + 그룹에 속한 hosts - name: 'Execute two commands .. 2023. 6. 27.
Ansible Inventory 인벤토리 설정 파일은 기본적으로 /etc/ansible/hosts에 정의 되어있다 ansible_host : 연결할 호스트의 이름. 당신이 원하는 호스트 별칭과 다를 경우 사용하여 임의 지정 가능 ansible_port : SSH 포트 번호. 기본값인 22가 아닐 경우 사용 ansible_user : SSH 접속에 사용할 유저 이름 ansible_ssh_pass : SSH 연결시 사용할 비밀번호. 이것은 보안에 취약하므로 –ask-pass 또는 SSH Keys 방식을 사용할 것은 권장 ansible_ssh_private_key_file : SSH 연결시에 사용할 SSH 비밀키 파일 ansible_ssh_common_args : sftp, scp, ssh와 같은 기본 명력을 사용할 때 항상 추가할 설정을 .. 2023. 6. 27.
Ansible Configuration Management tools 로 Puppet, Chef, Ansible, Saltstack 대표적이다. Ansible은 IaC (Infrastructure as Code)를 지향하는 자동화 관리 도구로 오픈 소스 기반으로 제작되었다. Ansible을 구동하는 모듈 및 라이브러리는 Python을 기반으로 하며, YAML 포맷을 기반으로 플레이북을 실행시켜서 원하는 자동화를 구현하거나, Ad hoc 모드로 모듈을 실행시켜 상태를 조회해 볼 수 있다. 또한 기존 Chef/Puppet 처럼 기존에 알려진 IaC 솔루션들이 Target Host들에 Agent를 반드시 설치해야 하는 것과 비교해서, Ansible은 SSH를 기반으로 Target Host에 Agentless방식으로 자동화를.. 2023. 6. 27.