roles (4) 썸네일형 리스트형 2.4 ansible | [roles][CentOS 시스템 초기 설정] role 수행(vault 포함) role 수행 [root@ANSIBLE roles]# pwd /etc/ansible/roles ## host 정의 [root@ANSIBLE roles]# cat ../hosts ... [test] test02 ansible_host={host ip} ansible_user=root ansible_port=22 ansible_connection=ssh ansible_ssh_pass="{ssh password}" test03 ansible_host={host ip} ansible_user=root ansible_port=22 ansible_connection=ssh ansible_ssh_pass="{ssh password}" ## role 수행 [root@ANSIBLE roles]# cat 00.init.i.. 2.3 ansible | [roles][CentOS 시스템 초기 설정] tasks main.yml [root@ANSIBLE tasks]# pwd /etc/ansible/roles/Init_Install/tasks [root@ANSIBLE tasks]# ll total 48 -rw-r--r-- 1 root root 1131 Feb 9 13:37 01.init.rsyslog_selinux.yml -rw-r--r-- 1 root root 648 Feb 9 13:37 02.init.add_user.yml -rw-r--r-- 1 root root 522 Feb 9 13:37 03.init.ssh_config.yml -rw-r--r-- 1 root root 213 Feb 9 13:38 04.init.yum_install.yml -rw-r--r-- 1 root root 739 Feb 9 13:38.. 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 .. 2.1 ansible | [roles][CentOS 시스템 초기 설정] README ## 작업을 수행하기 전 선작업을 README.md 파일에 써 놓음. ## ip, nds, hostname 작업 후 selinux disabled. ## 이후 재기동 후 role 작업 수행 [root@ANSIBLE Init_Install]# pwd /etc/ansible/roles/Init_Install [root@ANSIBLE Init_Install]# cat README.md Role Name ========= CentOS6,7 초기 설정 role Requirements ------------ 1. IP, DNS, HOSTNAME setting 2. selinux off and reboot ... 이전 1 다음