반응형

ansible 3

Ansible 사용하여 WordPress, Haproxy 설정 해보기

Ansible 설치 및 설정에 이어서 진행 해보도록 하겠습니다. 우선 wordpress를 2번 서버에 설치하고 설정하는 작업을 ansible을 사용하여 해보겠습니다. 처음 작성한 코드 --- - name: wordpress down and start hosts: web tasks: - name: wget, httpd install yum: name: "{{ item }}" state: latest loop: - wget - httpd - epel-release - yum-utils - http://rpms.remirepo.net/enterprise/remi-release-7.rpm - php - php-common - php-opcache - php-mcrypt - php-cli - php-gd - ph..

Ansible 2024.02.11

Ansible 모듈 사용해보기 (shell, user, file, copy ...등)

오늘은 모듈 shell, user, file, copy, fetch, yum, service, lineinfile에 대해 알아보았습니다. Ad-hoc 명령어 module: user ansible all -m user -a "name=a" => 모든 서버에 'a'라는 이름의 유저 생성 ansible all -m user -a "name=a state=absent" => 모든 서버에 'a'라는 이름의 유저 삭제 => 다만 user 모듈로 유저 생성 후 삭제하면 /home, /var/spool/mail 디렉토리에 생성된 유저 디렉토리는 삭제 되지 않는다. ansible all -m user -a "name=a update_password=always password={{ 'It1' | password_hash..

Ansible 2024.02.05

Ansible 설치 및 설정

Ansible 체계 구성도 HOSTC7-1C7-2C7-3C7-4 Hostname cont ma1 ma2 ma3 IP 10.0.0.1 10.0.0.2 10.0.0.3 10.0.0.4 SM 255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.0 Default-gateway 10.0.0.254 10.0.0.254 10.0.0.254 10.0.0.254 DNS 168.126.63.1 168.126.63.1 168.126.63.1 168.126.63.1 Roles Controller manage1 manage2 manage3 1. 설치 및 설정 ansible은 SSH를 이용하여 통신을 합니다. 따라서 SSH 통신이 되도록 설정을 해줍니다. 저희는 테스트하는 경우라 ss..

Ansible 2024.01.18
반응형