분류 전체보기26 Ansible Module - Package Create a playbook httpd.yml under ~/playbooks/ to install httpd package on web1 node using Ansible’s yum module. --- - name: install httpd hosts: web1 tasks: - yum: name: httpd state: installed We have an rpm available for wget package on URL http://mirror.centos.org/centos/7/os/x86_64/Packages/wget-1.14-18.el7_6.1.x86_64.rpm. Create a playbook with name wget.yml under ~/playbooks to install tha.. 2023. 6. 27. Ansible Module - Setup ansible facts 란 ansible facts 는 remote host 에 대한 정보를 의미하며 배포판 종류, 버전, IP Address, file system 정보등을 포함. ansible 은 playbook 실행시 자동으로 fact 를 수집하고 저장한다. playbook을 작성하지 않고 간단하게 fact 만 출력하려면 builtin 모듈인 setup 을 사용한다. ansible -m setup localhost ansible -m setup localhost | grep distribution inventory 파일을 사용 ansible -i inventory -m setup web1 | grep distribution playbook - hosts: db1 gather_facts: true .. 2023. 6. 27. 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. 이전 1 2 3 4 5 6 7 다음