본문 바로가기

Automation Tools/Ansible

2.2 ansible | [roles][CentOS 시스템 초기 설정] vars

반응형

[root@ANSIBLE vars]# pwd
/etc/ansible/roles/Init_Install/vars
 
[root@ANSIBLE vars]# cat main.yml
---
## 생성할 사용자 그룹 지정
ugroups:
  {group1}:
    gid: {gid1}
  {group2}:
    gid: {gid2}
 
## 생성할 사용자 지정
uusers:
  {user1}:
    uid: {uid1}
    group: {group1}
    home: {user1 home}
    upassword: "{user1 password}"
    shell: /bin/bash
  {user2}:
    uid: {uid2}
    group: {group2}
    home: {user2 home}
    upassword: "{user2 password}"
    shell: /bin/bash
 
## rsyslog에 설정할 로그 서버 주소
logserver: "{log server ip}"
 
## zabbixserver 주소
zabbixserver: "{zabbix server ip}"
 
## 설치할 zabbix agent 패키지. (zabbix-agent|zabbix-agent2)
zabbixagent: "zabbix-agent2"
 
## 설치 할 packages
upackages:
  - epel-release
  - ntp
  - bind-utils
  - tcpdump
  - net-snmp
  - net-snmp-utils
  - sysstat
  - vim
  - net-tools
  - conntrack*
  - iftop
  - smartmontools
  - lm_sensors
  - rdate
 
## sysctl.conf 에 추가할 커널 파라미터
usysctl:
  - fs.file-max = 999999
  - fs.inotify.max_user_watches = 65536
  - kernel.core_uses_pid = 1
  - kernel.msgmax = 65536
  - kernel.msgmnb = 65536
  - kernel.shmall = 268435456
  - kernel.shmmax = 4294967295
  - kernel.sysrq = 0
  - net.core.netdev_max_backlog = 10000
  - net.core.optmem_max = 524287
  - net.core.rmem_default = 25165824 
  - net.core.rmem_max = 25165824 
  - net.core.somaxconn = 60000
  - net.core.wmem_default = 65536 
  - net.core.wmem_max = 25165824 
  - net.ipv4.conf.all.accept_redirects = 0
  - net.ipv4.conf.all.accept_source_route = 0
  - net.ipv4.conf.all.log_martians = 0
  - net.ipv4.conf.all.promote_secondaries = 1
  - net.ipv4.conf.all.rp_filter = 0
  - net.ipv4.conf.all.secure_redirects = 1
  - net.ipv4.conf.default.accept_source_route = 0
  - net.ipv4.conf.default.promote_secondaries = 1
  - net.ipv4.conf.default.rp_filter = 0
  - net.ipv4.icmp_echo_ignore_broadcasts = 1
  - net.ipv4.ip_forward = 1
  - net.ipv4.ip_local_port_range = 2000 65000
  - net.ipv4.ip_nonlocal_bind = 1
  - net.ipv4.neigh.default.gc_thresh1 = 512
  - net.ipv4.neigh.default.gc_thresh2 = 1024
  - net.ipv4.neigh.default.gc_thresh3 = 2048
  - net.ipv4.tcp_fin_timeout = 5
  - net.ipv4.tcp_keepalive_intvl = 60 
  - net.ipv4.tcp_keepalive_probes = 5 
  - net.ipv4.tcp_keepalive_time = 600 
  - net.ipv4.tcp_max_orphans = 131072 
  - net.ipv4.tcp_max_syn_backlog = 60000
  - net.ipv4.tcp_max_tw_buckets = 11520000 
  - net.ipv4.tcp_mem = 10000000 10000000 10000000
  - net.ipv4.tcp_retries2 = 4 
  - net.ipv4.tcp_rfc1337 = 0 
  - net.ipv4.tcp_rmem = 10000000 10000000 10000000
  - net.ipv4.tcp_sack = 1 
  - net.ipv4.tcp_syn_retries = 3 
  - net.ipv4.tcp_synack_retries = 3 
  - net.ipv4.tcp_syncookies = 1
  - net.ipv4.tcp_tw_recycle = 1
  - net.ipv4.tcp_tw_reuse = 1 
  - net.ipv4.tcp_window_scaling = 0 
  - net.ipv4.tcp_wmem = 10000000 10000000 10000000
  - net.ipv6.conf.all.disable_ipv6 = 1
  - net.netfilter.nf_conntrack_generic_timeout = 15
  - net.netfilter.nf_conntrack_tcp_be_liberal = 1
  - net.netfilter.nf_conntrack_tcp_timeout_close = 5
  - net.netfilter.nf_conntrack_tcp_timeout_close_wait = 10
  - net.netfilter.nf_conntrack_tcp_timeout_established = 120
  - net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 10
  - net.netfilter.nf_conntrack_tcp_timeout_last_ack = 10
  - net.netfilter.nf_conntrack_tcp_timeout_max_retrans = 10
  - net.netfilter.nf_conntrack_tcp_timeout_syn_recv = 10
  - net.netfilter.nf_conntrack_tcp_timeout_syn_sent = 10
  - net.netfilter.nf_conntrack_tcp_timeout_time_wait = 5
  - net.netfilter.nf_conntrack_tcp_timeout_unacknowledged = 30
  - net.netfilter.nf_conntrack_max = 560000
  - net.netfilter.nf_conntrack_checksum = 1
  - net.netfilter.nf_conntrack_log_invalid = 0
  - net.nf_conntrack_max = 560000
  - "#net.netfilter.nf_conntrack_tcp_loose=0"
  - net.ipv4.tcp_timestamps = 1
 
## iptables 정책
uiptables:
  - "##  Policy Flush"
  - iptables -F
  - "##  Chain Initialize"
  - iptables -X
  - "##  Private"
  - iptables -A INPUT -p tcp --dport 22 -j ACCEPT
반응형