일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- DB
- elasticsearch
- Selenium
- GCP
- Linux
- 8.0
- 크롤링
- ELK
- 데이터 분석
- crawling
- module
- python
- zabbix
- EC2
- Automation
- EKS
- tcp
- AWS
- GIT
- API
- 5.0
- ansible
- apt
- kibana
- MySQL
- 자동화
- 시스템자동화
- ubuntu
- airflow
- powershell
- Today
- Total
목록Ansible (6)
Oops - IT
Ansible의 community.zabbix 모듈을 이용하여 Zabbix 서버를 운영 관리하는 몇 가지 예제에 대해서 정리해보겠습니다. 1. community.zabbix 모듈 설치 - 사전 작업 # apt-get install python-pip # pip install zabbix-api - Ansible이 설치되어 있다는 가정하에 community.zabbix 모듈 설치를 진행합니다. # ansible-galaxy collection install community.zabbix * 오류 발생 * * 해결 방법 * - Ansible 버전이 낮아서 발생하는 문제로 Ansible 레포 추가 후 Ansible 업데이트 - 아마 기본 레포에서 설치 시 해당 버전이 설치가 되는거 같네요... # echo "..
Ansible을 이용하여 Windows 서버에 파일을 배포하는 방법에 대해서 알아보겠습니다.Ansible에서 Windows 서버 통신을 위해 Winrm이라는 모듈을 사용하며 Python에 pywinrm 라이브러리를 Install 하는 작업이 필요합니다. ** OS 환경: Ansilbe 서버(Ubuntu 18.04) / Windows 서버(Windows 2019) 1. Winrm 동작 상태 확인 - Windows 서버 접속 후에 WInrm 서비스가 동작 중인지 먼저 확인하겠습니다. - 실행->Services.msc 접속 후 아래와 같이 Winrm 서비스가 실행 중인지 체크해주세요 - Linux 서버와 통신 상태 확인 - https: 5986 / http: 5985 -> HTTPS 작업을 위해서는 Windo..
1. Command, System 명령어 # 파일 체크 - name: Check /etc/zabbix/zabbix_agent.d/server.conf file stat: path: /etc/zabbix/zabbix_agent.d/server.conf register: server_conf_stat_1 # 파일 수정 - name: Amend /etc/zabbix/zabbix_agent.d/server.conf file shell: sed -i 's/ServerActive=.*/ServerActive=10.10.10.1/g' /etc/zabbix/zabbix_agent.conf.d/server.conf when: server_conf_stat_1.stat.exist == True # 스크립트 실행 - nam..
** OS 환경: ubuntu 16.04 1. Task 생성 : 지난 Post에서 ansible-galaxy 명령어를 통해 role을 생성했다면 /etc/ansible/roles/[role 이름]/tasks/main.yml 파일이 생성되었을 겁니다. : 해당 파일에 Ansible에서 관리하는 실제 Host들에서 동작할 작업을 명시 해줍니다. : 첫번째 동작 - /tmp/test.sh 파일 유무 확인 : 두번째 동작 - /tmp/test.sh 파일이 존재하지 않을 경우 파일 생성 #vim /etc/ansible/roles/update-zabbix/tasks/main.yml - name: Check /tmp/test.sh stat: path: /tmp/test.sh register: script_check ..
** OS 환경: ubuntu 16.04 1. Ansible Repository 추가 # apt-add-repository ppa:ansible/ansible 2. APT Update 실행 # apt-update 3. Ansible 패키지 설치 : 의존성 파일들이 설치되며 설치가 진행 된다. # apt-get install -y ansible 4. 설치 확인 # ansible --version 5. Hosts 파일에 관리할 서버 추가 : Ansible을 통해서 관리를 할 서버를 명시하면 Inventory 파일이라고도 한다. : Ansible 패키지 설치 시 자동적으로 /etc/ansible 경로 밑에 파일이 생성이 된다. * 계정 정보나, 보안 측면의 관리가 필요한 내용이 hosts에 들어가는 경우 : ..
1. ansible [machinename] -u root -k -m setup : 장비에서 setup 모듈을 사용하기 위한 명령어 2. ansible [machinename] -u root -k -m file -a 'path=/etc/fstab' : fstab 디렉토리에 대한 상세 정보 출력 3. ansible [machinename] -u root -k -m file -a 'path=/tmp/test state=directory mode=0070 owner=root' : /tmp/test 디렉토리를 생성 4. ansible [machinename] --m copy -a 'src=/etc/fstab dest=/tmp/fstab' : /etc/fstab 디렉토리를 /tmp/fstab 경로로 복사 5. a..